Open joelaforet opened 1 year ago
Hi @joelaforet,
It looks like the element labels in the final column are a little mixed up (we need those to be accurate to match to the chemical graph during loading). The problems are a mix of atom types being substituted in (ca
instead of C
) and in some of the ZSO molecules, the wrong element being present (some H
s are listed as C
s)
To illustrate the issue, I reduced your box to one molecule of each type and still got the error. Then I went through and manually relabeled the elements based on the atom names, and the box loads successfully. See the following two attached files for reference.
box_fixed_atom_types.txt box_minimal.txt
So in a pinch, you can make a script to relabel the elements after packmol runs, but maybe there's something earlier in your pipeline that's mangling the element column.
Could you let me know if this solves your problem?
(Also, thanks for the excellent issue report and reproducing example)
Hi @j-wags,
Thanks for your reply! I was wondering, what atom types I should be using when trying to work with OpenFF? Is the system smart enough to recognize different formats like GAFF2 or Sybyl? I am still confused on what exactly needs to be in the .pdb file that we feed in to the topology generator.
I re-named the atoms in my molecule pdb files according to your adjustments, but now the cell that creates the interchange takes a very long time to run. It appears to be getting caught in the create_interchange step. Is this process supposed to take a long time? I've attached my new files to this message. Thanks! box_Sorafenib_CholicAcid_1_1.txt CholicAcid.txt Sorafenib.txt
what atom types I should be using when trying to work with OpenFF?
OpenFF doesn't use atom types - An OpenFF Molecule is defined by atoms (with element, formal charge, and stereochemistry) and bonds (with bond order and stereochemistry). Atom types aren't needed, and parameter assignment is performed directly on the chemical graph.
When loading PDB files, OpenFF sticks right to the PDB spec - So the final column should be elements, not types from any scheme. While we hold on to the atom name, residue name, residue number, insertion code, and chain for each atom loaded from PDB, those don't have any effect on the parameter assignment.
And the create_interchange
step took about 4 minutes to run for me - 90% of this time was probably the AM1BCC charge assignment for the molecules, using Antechamber. This will only run once for each unique molecule in the topology, so the runtime should be similar for the larger topology containing many copies of the same two mols.
Thanks for the great explanation, that all makes a lot of sense! I am also using PackMol to make my system, and it looks like OpenFF needs the connect records inside the PDB file to run properly. Also, to limit test, I tried generating a topology for a system with 200 molecules in it, but my kernel crashed. Do you have any advice on what may be causing this/ how to remedy it? I've attached the PDB file to this message.
Thank you! box_Sorafenib_CholicAcid_100_5.zip
I can't reproduce a crash with that file
In [3]: sorafenib = Molecule.from_smiles(
...: "CNC(=O)C1=NC=CC(=C1)OC2=CC=C(C=C2)NC(=O)NC3=CC(=C(C=C3)Cl)C(F)(F)F"
...: )
...: cholic_acid = Molecule.from_smiles(
...: "C[C@H](CCC(=O)O)[C@H]1CC[C@@H]2[C@@]1([C@H](C[C@H]3[C@H]2[C@@H](C[C@H]4[C@@]3(CC[C@H](C4)O)C)O)O)C"
...: )
...:
In [4]: Topology.from_pdb(
...: "../../Downloads/box_Sorafenib_CholicAcid_100_5.pdb",
...: unique_molecules=[sorafenib, cholic_acid],
...: )
Out[4]: <openff.toolkit.topology.topology.Topology at 0x15aae1a50>
Hello!
I would like to parametrize a system of small molecules that I constructed using PackMol. I generated my Molecule objects from SMILES according to the tutorial. I then used PackMol to generate a pdb file of many different molecules arranged in a box (attached as a .txt github won't let me upload the pdb). When I try to generate the topology from the pdb file, I get the following error:
To Reproduce Python Code to reproduce:
If the problem involves a specific molecule or file, please upload that as well. [-->] box_Sorafenib_CholicAcid_100_5.txt
Output
.... Repeats for all atoms in system
Computing environment (please complete the following information):
conda list