hi all, Is it possible to read smarts with nitro group in form 'N(=O)(=O)'?
Here is the context of my question: The example below shows that there is some problem with nitro group and MolFromSmarts: >>> m1=Chem.MolFromSmiles('c1ccccc1[N+](=O)[O-]') >>> m2=Chem.MolFromSmiles('c1ccccc1N(=O)(=O)') >>> m11=Chem.MolFromSmarts('c1ccccc1[N+](=O)[O-]') >>> m22=Chem.MolFromSmarts('c1ccccc1N(=O)(=O)') >>> Chem.MolToSmiles(m1) 'O=[N+]([O-])c1ccccc1' >>> Chem.MolToSmiles(m2) 'O=[N+]([O-])c1ccccc1' >>> Chem.MolToSmiles(m22) 'O=N(=O)c1ccccc1' >>> Chem.MolToSmiles(m11) 'O=N(O)c1ccccc1' Function MolFromSmiles accept both form ('[N+](=O)[O-]' and 'N(=O) (=O)') and return the same canonical smiles. This make sense to me. The behaviour of MolFromSmarts is strange, nitro in form '[N+](=O) [O-]' is correctly detected but return different canonical smiles (why? ). However 'N(=O)(=O)' form is interpreted incorectly. Is this bug or feature? I have a lot of smarts which can have nitro group written either as 'N(=O)(=O)' or '[N+](=O)[O-]'. What should I do to correctly read them all? Replace all 'N(=O)(=O)' string (and all possible variations) to ionic form? Best, RafaĆ ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss