OpenFreeEnergy / gufe

grand unified free energy by OpenFE
https://gufe.readthedocs.io
MIT License
28 stars 8 forks source link

Have a `from_pdb_string` and `to_pdb_string` method in `ProteinComponent`? #207

Closed hmacdope closed 11 months ago

hmacdope commented 1 year ago

I may be missing something but as far as I can tell you can only easily construct a ProteinComponent from files, not from an in memory representation. Would it be possible to have some methods for ingesting a pdb file as a string?

This will likely help a lot in interconverting between toolkits on the fly such as openff-toolkit and openeye etc

richardjgowers commented 1 year ago

The init method takes an rdkit Molecule, but creating that is your own problem admittedly (see pdbinf and similar). To/from string isn't terrible, but it would keep the openmm dependency

hmacdope commented 11 months ago

@jthorton this is the issue I was referring to the other day. Similar thing applies for sdf

I suppose we could do rdkit.MolFromPDBBlock, i assume some equivalent exists for an SDF file.

richardjgowers commented 11 months ago

@hmacdope yeah Chem.MolFromMolFile. I think rather than load up the Components with a bunch of from_X classmethods, I'd rather just make it first create your rdkit/openff mol, then put it into a Component and job's done.

hmacdope commented 11 months ago

I will close.