Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't type p3ht #153

Open
StephMcCallum opened this issue Jul 22, 2024 · 4 comments
Open

Can't type p3ht #153

StephMcCallum opened this issue Jul 22, 2024 · 4 comments

Comments

@StephMcCallum
Copy link

from flowermd.base import Molecule
from flowermd.base import Pack
from flowermd.library.forcefields import FF_from_file
import unyt

p3ht = Molecule(num_mols=20, smiles="CCCCCCc1ccsc1")
system = Pack(molecules=p3ht, density=0.5 * unyt.g/unyt.cm**3)
p3ht_ff = FF_from_file(forcefield_files="/home/smccallum/flowerMD/P3HT.xml")
system.apply_forcefield(r_cut=2.5, force_field=p3ht_ff, auto_scale=True)

For the minimal working example above, Foyer isn't getting the expected atom types.

File ~/miniforge3/envs/flowermd/lib/python3.11/site-packages/foyer/atomtyper.py:228, in _resolve_atomtypes(topology_graph, typemap)
222 raise FoyerError(
223 "Found multiple types for atom {} ({}): {}.".format(
224 atom_id, atoms[atom_id].atomic_number, atomtype
225 )
226 )
227 else:
--> 228 raise FoyerError(
229 "Found no types for atom {} ({}).".format(
230 atom_id, atoms[atom_id].atomic_number
231 )
232 )

FoyerError: Found no types for atom 0 (6).

@chrisjonesBSU
Copy link
Member

Can you upload, or post a code snippet of the contents of the xml file you're using?

@marjanalbooyeh
Copy link
Collaborator

If this is a missing parameter issue I think Espaloma could be helpful.
@madilynpaul you already typed p3ht, right? Do you have the xml for that by any chance so that we can add it to the flowermd ff library?

@madilynpaul
Copy link

Yes, I have! I have the typed mol2 file as well as the xml.

@madilynpaul
Copy link

I think I see the problem! @StephMcCallum If you are using the espaloma generated xml file, you have to load your molecule from the mols2 file that contains the correct atomtype names. I sent you a longer explanation on slack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants