Closed JosieHong closed 1 year ago
Please try the latest version of molmass, v2022.12.9:
>>> from rdkit import Chem
>>> from rdkit.Chem.rdMolDescriptors import CalcMolFormula
>>> from molmass import Formula
>>>
>>> s = '[O-]C(CCNC1=CC(N2CCC3=CC=CC=C3CC2)=NC(C4=CC=CN=C4)=N1)=O'
>>> f = CalcMolFormula(Chem.MolFromSmiles(s))
>>> Formula(f)
Formula('[C22H22N5O2]-')
I tried to convert this SMILES string to a formula by following codes:
Then I met the following error:
Is there a way to process this type of formula, which contains '-'? Thanks!