pren / poltype

POLTYPE: AMOEBA parametrization tool
https://pren.github.io/poltype
Other
4 stars 11 forks source link

Issue with N+ atom during torsion fitting/fragmentation #29

Closed leucinw closed 4 years ago

leucinw commented 4 years ago

This molecule has an N+ atom which has a valence of 4. Poltype complained about this and crashed. All the files are located at /home/liuchw/forEW/30e_n1_opt-1 (Ren lab cluster).

 1 [22:35:05] Explicit valence for atom # 0 N, 4, is greater than permitted
 2 Traceback (most recent call last):
 3   File "/home/liuchw/forPoltype/poltype/PoltypeModules/poltype.py", line 1096, in <module>
 4     params=poltype.main()
 5   File "/home/liuchw/forPoltype/poltype/PoltypeModules/poltype.py", line 872, in main
 6     params= self.GenerateParameters()
 7   File "/home/liuchw/forPoltype/poltype/PoltypeModules/poltype.py", line 1045, in GenerateParameters
 8     rotbndindextoparentindextofragindex,rotbndindextofragment,rotbndindextofragmentfilepath,equivalentrotbndindexarrays=frag.GenerateFragments(self,self.mol,torlist,WBOmatrix) # returns list of bond indexes that need parent mo
   lecule to do torsion scan for (fragment generated was same as the parent0
 9   File "/home/liuchw/forPoltype/poltype/PoltypeModules/fragmenter.py", line 723, in GenerateFragments
10     fragmol,parentindextofragindex=GenerateFrag(poltype,indexes,mol)
11   File "/home/liuchw/forPoltype/poltype/PoltypeModules/fragmenter.py", line 585, in GenerateFrag
12     AllChem.EmbedMolecule(newmol)
13 Boost.Python.ArgumentError: Python argument types in
14     rdkit.Chem.rdDistGeom.EmbedMolecule(NoneType)
15 did not match C++ signature:
16     EmbedMolecule(RDKit::ROMol {lvalue} mol, RDKit::DGeomHelpers::EmbedParameters {lvalue} params)
17     EmbedMolecule(RDKit::ROMol {lvalue} mol, unsigned int maxAttempts=0, int randomSeed=-1, bool clearConfs=True, bool useRandomCoords=False, double boxSizeMult=2.0, bool randNegEig=True, unsigned int numZeroFail=1, boost::pyt
   hon::dict {lvalue} coordMap={}, double forceTol=0.001, bool ignoreSmoothingFailures=False, bool enforceChirality=True, bool useExpTorsionAnglePrefs=True, bool useBasicKnowledge=True, bool printExpTorsionAngles=False)
mquevill commented 4 years ago

This error comes from setting the formal charges on every atom in a 2D molecule to 0 (atom.SetFormalCharge(0)). N+ should have a valence of 3, but setting its formal charge to 0 gives it a valence of 4.

https://github.com/pren/poltype/blob/b3b7f698058270fb2008e9e3ec90c7610c6d78b9/PoltypeModules/poltype.py#L668-L682

misterbrandonwalker commented 4 years ago

Michael,

I believe the code you are referencing in this case is for when there was a strange flat input molecule (was it Ammonia?) had inconsistent charge and bond structure in the input file. We can remove the two lines referring to formal charge here. The error that was referenced in this case was for something regarding the fragmenter lib, which has been fixed, although I had not closed this issue.

On Fri, Aug 7, 2020 at 10:10 AM Michael Quevillon notifications@github.com wrote:

This error comes setting the formal charges on every atom in a 2D molecule to 0 (atom.SetFormalCharge(0)). N+ should have a valence of 3, but setting its formal charge to 0 gives it a valence of 4.

https://github.com/pren/poltype/blob/b3b7f698058270fb2008e9e3ec90c7610c6d78b9/PoltypeModules/poltype.py#L668-L682

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pren/poltype/issues/29#issuecomment-670564614, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNB26JARRKJZFJJMWP5MVLR7QKMVANCNFSM4PDTO46Q .