Skip to content

Commit 923b9e0

Browse files
authored
Pass residue information to parmed during save (#1281)
1 parent 77430fe commit 923b9e0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

mbuild/conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ def save(
10421042
output_sdf.write(pybel_molecule)
10431043
output_sdf.close()
10441044
else: # ParmEd supported saver.
1045-
structure = compound.to_parmed(include_ports=include_ports)
1045+
structure = compound.to_parmed(residues=residues, include_ports=include_ports)
10461046
structure.save(filename, overwrite=overwrite, **kwargs)
10471047

10481048

mbuild/tests/test_compound.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,9 @@ def test_from_parmed(self):
22652265
struc = pmd.load_file(get_fn("spc.pdb"))
22662266
comp.from_parmed(struc)
22672267
assert comp.children[0].name == "SPC"
2268+
comp.save("test.pdb", residues=["SPC"])
2269+
struc2 = pmd.load_file("test.pdb")
2270+
assert struc2.residues[0].name == struc.residues[0].name
22682271

22692272
@pytest.mark.skipif(not has_mdtraj, reason="MDTraj not installed")
22702273
def test_complex_from_trajectory(self):

0 commit comments

Comments
 (0)