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

missing key6 during the fragment process and Explicit valence for atom # 5 N, 8 #65

Open
pengacid opened this issue Jan 6, 2025 · 5 comments

Comments

@pengacid
Copy link

pengacid commented Jan 6, 2025

I am a newcomer to the AMOEBA team and Poltype2 project, and I have encountered some unresolved issues. The problem occurred in the fragment steps, and specific errors can be found in the log text below. Thank you all.

/home/amoeba/poltype2/PoltypeModules/torsiondatabaseparser.py:3125: UserWarning: # Missing vdw parameters
warnings.warn(transferinfoline)
/home/lzp/amoeba/poltype2/PoltypeModules/torsiondatabaseparser.py:3125: UserWarning: # WARNING DEFAULT MM3 OPBEND VALUES USED
warnings.warn(transferinfoline)
[12:33:58] Explicit valence for atom # 5 N, 8, is greater than permitted
Traceback (most recent call last):
File "/home/lzp/amoeba/poltype2/PoltypeModules/lTorsionFragmentPostProcessing.py", line 418, in
Chem.SanitizeMol(mol2)
rdkit.Chem.rdchem.AtomValenceException: Explicit valence for atom # 5 N, 8, is greater than permitted
TOR [1, 5, 16, 19]
TOR [5, 16, 19, 20]
TOR [16, 19, 20, 21]
TOR [22, 21, 24, 25]
Traceback (most recent call last):
File "/home/amoeba/3f2/../poltype2/PoltypeModules/poltype.py", line 8230, in RunPoltype
poltype.main()
File "/home/amoeba/3f2/../poltype2/PoltypeModules/poltype.py", line 3655, in main
params= self.GenerateParameters()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/amoeba/3f2/../poltype2/PoltypeModules/poltype.py", line 5129, in GenerateParameters
frag.GrabVdwAndTorsionParametersFromFragments(self,rotbndindextofragmentfilepath,equivalentrotbndindexarrays,rotbndindextoringtor,self.key6fname,self.key7fname,rotbndindextoparentrotbndindexes,rotbndindextosmartsindexarray) # just dump to key_6 since does not exist for parent molecule

File "/home/amoeba/poltype2/PoltypeModules/fragmenter.py", line 324, in GrabVdwAndTorsionParametersFromFragments
raise ValueError('Fragment job did not finish '+filename)
ValueError: Fragment job did not finish 5_16_Index_0.mol
Traceback (most recent call last):
File "/home/amoeba/3f2/../poltype2/PoltypeModules/poltype.py", line 8230, in RunPoltype
poltype.main()
File "/home/amoeba/3f2/../poltype2/PoltypeModules/poltype.py", line 3655, in main
params= self.GenerateParameters()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/amoeba/3f2/../poltype2/PoltypeModules/poltype.py", line 5129, in GenerateParameters
frag.GrabVdwAndTorsionParametersFromFragments(self,rotbndindextofragmentfilepath,equivalentrotbndindexarrays,rotbndindextoringtor,self.key6fname,self.key7fname,rotbndindextoparentrotbndindexes,rotbndindextosmartsindexarray) # just dump to key_6 since does not exist for parent molecule

File "/home/amoeba/poltype2/PoltypeModules/fragmenter.py", line 324, in GrabVdwAndTorsionParametersFromFragments
raise ValueError('Fragment job did not finish '+filename)
ValueError: Fragment job did not finish 5_16_Index_0.mol

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/amoeba/3f2/../poltype2/PoltypeModules/poltype.py", line 8254, in
RunPoltype()
File "/home/amoeba/3f2/../poltype2/PoltypeModules/poltype.py", line 8253, in RunPoltype
raise ValueError('Houston, we have a problem. Buy a developer some coffee!')
ValueError: Houston, we have a problem. Buy a developer some coffee!

@leucinw
Copy link
Member

leucinw commented Jan 6, 2025

As indicated the error is due to that the Nitrogen atom has 8 explicit valence.
It will be better for me to look into the issue if you could provide the parent molecule sdf file and 5_16_Index_0.mol that poltype generated.

@pengacid
Copy link
Author

pengacid commented Jan 7, 2025

As indicated the error is due to that the Nitrogen atom has 8 explicit valence. It will be better for me to look into the issue if you could provide the parent molecule sdf file and 5_16_Index_0.mol that poltype generated.

Thank you for your reply. I have attached the sdf file of the entire molecule and the 5_16_idex_0.mol generated by poltype. It is worth mentioning that there is no nitrogen atom in this mol file.
sdf_5_16_Index_0.zip

@Yunhao-Mei
Copy link

I have encountered the exactly same problem. The exception message was rdkit.Chem.rdchem.AtomValenceException: Explicit valence for atom # 0 P, 6, is greater than permitted, but there is no phosphorus in my molecule.

Btw I have tried to fix this issue by myself, but torsiondatabaseparser.py is terribly organized without any comments.

@leucinw
Copy link
Member

leucinw commented Jan 15, 2025

Hi @Yunhao-Mei and @pengacid , one Poltype user identified the issue you saw. This was actually due to the RDKit version you guys are using. Please try 2024.3.6 (or older) version of RDKit and re-run your poltype job.

@pengacid
Copy link
Author

Hi @Yunhao-Mei and @pengacid , one Poltype user identified the issue you saw. This was actually due to the RDKit version you guys are using. Please try 2024.3.6 (or older) version of RDKit and re-run your poltype job.

This error still exists. My computer's RDKit version was 2024.3. I tried 2023.09, but still got this error.

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

3 participants