mosdef-hub / mbuild

A hierarchical, component based molecule builder
https://mbuild.mosdef.org
Other
173 stars 81 forks source link

`mb.Compound.save()` feature returns a PDB file without bonds #1190

Open Pablo-Pomares opened 5 months ago

Pablo-Pomares commented 5 months ago

Bug summary

When trying to save to a PDB file, it returns a file without bonds.

Code to reproduce the behavior

Please include a code snippet that can be used to reproduce this bug.

import mbuild as mb
from mbuild.lib.recipes import Alkane
hex = Alkane(6)

hex.save("hexane.pdb", overwrite=True)

The previous command yields (converted to txt for attachment):

hexane.txt

But the following is expected (converted to txt for attachment):

hexane1.txt

Software versions

jpotoff commented 5 months ago

Normally, we are using the PDB file in connection with the PSF file, which contains all of the connectivity information. To put connectivity information in a PDB file is, therefore, redundant.

CalCraven commented 3 weeks ago

Just following up on this issue as we are aware of the lack of support. Since mBuild 1.0 will strip out most writers and migrate them to GMSO, we can dump reliance on other packages that perform some of these operations. For instance, ParmEd is used to save pdb, and mdtraj to write pdb currently. So this should be switched over so GMSO can handle both file types, and we can be certain to get support for reading and writing bonds.