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 definedI 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
speleo3
left a comment
There was a problem hiding this comment.
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.