You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
"Not" queries get turned into the atom that I'm looking to exclude.
To Reproduce
In [1]: from rdkit import Chem
In [2]: text = """
...: RDKit 2D
...:
...: 0 0 0 0 0 0 0 0 0 0999 V3000
...: M V30 BEGIN CTAB
...: M V30 COUNTS 1 0 0 0 0
...: M V30 BEGIN ATOM
...: M V30 1 "NOT [N]" -2.742857 0.057143 0.000000 0
...: M V30 END ATOM
...: M V30 END CTAB
...: M END
...: $$$$
...: """
In [3]: mol = Chem.MolFromMolBlock(text)
In [4]: print(Chem.MolToMolBlock(mol, forceV3000=True))
RDKit 2D
0 0 0 0 0 0 0 0 0 0999 V3000
M V30 BEGIN CTAB
M V30 COUNTS 1 0 0 0 0
M V30 BEGIN ATOM
M V30 1 N -2.742857 0.057143 0.000000 0
M V30 END ATOM
M V30 END CTAB
M END
Expected behavior
I'd expect to get back the "not N". This also happens if I use the forceV3000 flag, it must be happening on read. If I change the input atom name from "NOT [N]" to "NOT [N,C]", then everything works as expected and the output matches the input.
Configuration (please complete the following information):
RDKit version: 2022.09.3
Are you using conda? no, a local Schrodinger build.
The text was updated successfully, but these errors were encountered:
It does look like things get parsed properly (look at the output SMARTS):
In [9]: m = Chem.MolFromMolBlock('''
...: Mrv2211 01052304532D
...:
...: 0 0 0 0 0 999 V3000
...: M V30 BEGIN CTAB
...: M V30 COUNTS 2 1 0 0 0
...: M V30 BEGIN ATOM
...: M V30 1 C -4.375 5.4583 0 0
...: M V30 2 "NOT [N]" -3.0413 6.2283 0 0
...: M V30 END ATOM
...: M V30 BEGIN BOND
...: M V30 1 1 1 2
...: M V30 END BOND
...: M V30 END CTAB
...: M END
...: ''');print(Chem.MolToSmarts(m));print(Chem.MolToV3KMolBlock(m));
[#6]-[!#7]
RDKit 2D
0 0 0 0 0 0 0 0 0 0999 V3000
M V30 BEGIN CTAB
M V30 COUNTS 2 1 0 0 0
M V30 BEGIN ATOM
M V30 1 C -4.375000 5.458300 0.000000 0
M V30 2 N -3.041300 6.228300 0.000000 0
M V30 END ATOM
M V30 BEGIN BOND
M V30 1 1 1 2
M V30 END BOND
M V30 END CTAB
M END
And the output problem is limited to single element not lists:
...: Mrv2211 01052304532D
...:
...: 0 0 0 0 0 999 V3000
...: M V30 BEGIN CTAB
...: M V30 COUNTS 2 1 0 0 0
...: M V30 BEGIN ATOM
...: M V30 1 C -4.375 5.4583 0 0
...: M V30 2 "NOT [N,O]" -3.0413 6.2283 0 0
...: M V30 END ATOM
...: M V30 BEGIN BOND
...: M V30 1 1 1 2
...: M V30 END BOND
...: M V30 END CTAB
...: M END
...: ''');print(Chem.MolToSmarts(m));print(Chem.MolToV3KMolBlock(m));
[#6]-[!#7&!#8]
RDKit 2D
0 0 0 0 0 0 0 0 0 0999 V3000
M V30 BEGIN CTAB
M V30 COUNTS 2 1 0 0 0
M V30 BEGIN ATOM
M V30 1 C -4.375000 5.458300 0.000000 0
M V30 2 "NOT [N,O]" -3.041300 6.228300 0.000000 0
M V30 END ATOM
M V30 BEGIN BOND
M V30 1 1 1 2
M V30 END BOND
M V30 END CTAB
M END
Describe the bug
"Not" queries get turned into the atom that I'm looking to exclude.
To Reproduce
Expected behavior
I'd expect to get back the "not N". This also happens if I use the
forceV3000
flag, it must be happening on read. If I change the input atom name from "NOT [N]" to "NOT [N,C]", then everything works as expected and the output matches the input.Configuration (please complete the following information):
The text was updated successfully, but these errors were encountered: