Open hjuinj opened 7 years ago
If you turn off sanitization (is there a reason you are doing this?) then things like valence are not calculated. If you need to read without sanitization, then be sure to call 'mol.UpdatePropertyCache()' before you do the substructure match
Hi Greg,
Thank you for your help. I am working on the open force field project that John showed at the UGM. The reason for no sanitization is because the philosophy that the input molecule should already be in the user-intended form to be simulated. Thus the molecule is left untouched before matching against SMIRKS patterns.
May I ask why when I read molecules in mol2 files I do not need to perform 'mol.UpdatePropertyCache()' ? Additionally UpdatePropertyCache() will not alter the molecular topology right?
It's safe to call mol.updatePropertyCache()
; it just calculates valence states of the atoms. There are no topology changes.
Thanks again Greg :) Have you had the chance to take a look at the other issue I seem to encounter (#1590) regarding difference in interpretation between mol2 and sdf molecules?
Hi Greg,
I am having problems using updatePropertyCache(), regardless of whether the molecule is read from sdf or mol2 or from smiles, I get AttributeError: 'Mol' object has no attribute 'updatePropertyCache'
e.g. :
m1 = Chem.MolFromSmiles('Cc1ccccc1')
print(m1) <rdkit.Chem.rdchem.Mol object at 0x7f3bb90e1c60>
m1.updatePropertyCache()
AttributeError: 'Mol' object has no attribute 'updatePropertyCache'
You’ve got the capitalization wrong: The Python call is UpdatePropertyCache()
I am using rdkit 2017.03.3
When I am reading in molecules from sdf stream via SDMolSupplier without sanitization, and then trying to match the molecules to SMARTS pattern which includes the total connectivity atomic property requirement, I get RuntimeError regarding implicit hydrogens.
Here I use cyclohexane as an example:
I get:
Am I using the SDMolSupplier correctly? If I am, it seems some information is lost when parsing the sdf molecule. It I set
sanitize
to True this issue disappears.sdf of cyclohexane: