-
Notifications
You must be signed in to change notification settings - Fork 266
Add Protparam #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Protparam #168
Conversation
Hi @speleo3 , I have updated the code according to the proposed changes. I also removed a test because it was failing😁 |
How about a test that works? def test_protparam(capsys):
cmd.reinitialize()
cmd.fab("A// ACD B// EFG", "m1")
cmd.fab("HIKL", "m2")
cmd.alter("resn CYS", "resn='UNK'")
protparam()
captured = capsys.readouterr()
assert "Protein name: m1" in captured.out
assert "Protein name: m2" in captured.out
assert "Sequence: ADEFG\n" in captured.out
assert "Sequence: HIKL\n" in captured.out
assert "Protein length: 2 aa" not in captured.out
assert "Protein length: 3 aa" not in captured.out
assert "Protein length: 4 aa" in captured.out
assert "Protein length: 5 aa" in captured.out
assert "Count of aminoacids: {'A': 1," in captured.out
protparam(bychain=1)
captured = capsys.readouterr()
assert "Protein name: m1" in captured.out
assert "Protein name: m2" in captured.out
assert "Sequence: AD\n" in captured.out
assert "Sequence: EFG\n" in captured.out
assert "Protein length: 2 aa" in captured.out
assert "Protein length: 3 aa" in captured.out
assert "Protein length: 4 aa" in captured.out
assert "Protein length: 5 aa" not in captured.out
assert "Molecular Weight: 204.2 Da" in captured.out
protparam("resn LYS")
captured = capsys.readouterr()
assert "Protein name: m1" not in captured.out
assert "Protein name: m2" in captured.out
assert "Protein length: 1 aa" in captured.out
assert "Isoelectric point: 8.75" in captured.out |
Thanks! I've updated the code with this test. I added extra test for "empty" output. I am not very familiar with pytests so it might fail. In that case, I will try to fix and push it again. Update: since NameError: name 'SeqIO' is not defined I could "fix" it by adding biopython to |
That's the correct solution, please add |
…tent Correcting for PR comments 1 Correcting for PR comments 2. Added test and biopython import for github actions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, thank you
Created protparam script to calculate common properties for a model.
Depends on Biopython. Since it might be missing from standard PyMOL installation, the script installs it if import fails.