Skip to content

Commit

Permalink
Merge pull request #524 from juminlee/master
Browse files Browse the repository at this point in the history
Fix a typo in pdb.py that causes DSSP to fail
  • Loading branch information
pckroon committed Jun 22, 2023
2 parents b450b67 + 7bf77f1 commit 1ee3d4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion vermouth/pdb/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def write_pdb_string(system, conect=True, omit_charges=True, nan_missing_pos=Fal
resname = get_not_none(node, 'resname', '')
chain = get_not_none(node, 'chain', '')
resid = get_not_none(node, 'resid', 1)
insertion_code = get_not_none(node, 'insertioncode', '')
insertion_code = get_not_none(node, 'insertion_code', '')
try:
# converting from nm to A
x, y, z = node['position'] * 10 # pylint: disable=invalid-name
Expand Down
10 changes: 5 additions & 5 deletions vermouth/tests/pdb/test_write_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def dummy_system():
{'atomname': 'E', 'resname': 'A', 'resid': 4, },
{'atomname': 'F', 'resname': 'B', 'resid': 4, },
{'atomname': 'G', 'resname': 'B', 'resid': 4, },
{'atomname': 'H', 'resname': 'B', 'resid': 4, },
{'atomname': 'H', 'resname': 'B', 'resid': 4, 'insertion_code': 'A'},
)
edges = [(0, 1), (2, 3), (4, 5), (5, 6), (5, 7)]
graph = nx.Graph()
Expand Down Expand Up @@ -100,8 +100,8 @@ def test_conect(dummy_system):
ATOM 7 E A 4 10.000 20.000 -30.000 1.00 0.00 E
ATOM 8 F B 4 10.000 20.000 -30.000 1.00 0.00 F
ATOM 9 G B 4 10.000 20.000 -30.000 1.00 0.00 G
ATOM 10 H B 4 10.000 20.000 -30.000 1.00 0.00 H
TER 11 B 4
ATOM 10 H B 4A 10.000 20.000 -30.000 1.00 0.00 H
TER 11 B 4A
CONECT 1 2
CONECT 4 5
CONECT 7 8
Expand Down Expand Up @@ -141,8 +141,8 @@ def test_write_success_missing_pos(missing_pos_system):
ATOM 7 E A 4 10.000 20.000 -30.000 1.00 0.00 E
ATOM 8 F B 4 10.000 20.000 -30.000 1.00 0.00 F
ATOM 9 G B 4 10.000 20.000 -30.000 1.00 0.00 G
ATOM 10 H B 4 10.000 20.000 -30.000 1.00 0.00 H
TER 11 B 4
ATOM 10 H B 4A 10.000 20.000 -30.000 1.00 0.00 H
TER 11 B 4A
END
'''
assert pdb_found.strip() == expected.strip()

0 comments on commit 1ee3d4b

Please sign in to comment.