Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computed props on non-sanitized molecule interfering with substructure matching #360

Closed
greglandrum opened this issue Oct 25, 2014 · 1 comment
Assignees
Labels
Milestone

Comments

@greglandrum
Copy link
Member

In [67]:

db_mol=Chem.MolFromSmiles('C1Cc2ccccc2CN1')
mb="""
  Mrv0541 10251405512D          

 10 11  0  0  1  0            999 V2000
  -17.2624   14.4196    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -17.9768   14.0071    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -17.9768   13.1821    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
  -17.2624   12.7696    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -16.5479   14.0071    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -16.5479   13.1821    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.8334   12.7696    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.1189   13.1821    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.1189   14.0071    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.8334   14.4196    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  5  1  0  0  0  0
  2  1  1  0  0  0  0
  3  2  1  0  0  0  0
  3  4  1  0  0  0  0
  4  6  1  0  0  0  0
  5 10  4  0  0  0  0
  6  5  4  0  0  0  0
  6  7  4  0  0  0  0
  8  7  4  0  0  0  0
  9  8  4  0  0  0  0
 10  9  4  0  0  0  0
M  END
"""
template = Chem.MolFromMolBlock(mb, False)
for atom in template.GetAtoms():
    atom.SetIsAromatic(False)  # set atoms as non-aromatic
for bond in template.GetBonds():
    bond.SetIsAromatic(False)  # set bonds as non-aromatic
    bond.SetBondType(Chem.rdchem.BondType.UNSPECIFIED)
template
print db_mol.HasSubstructMatch(template)
template.ClearComputedProps()
print db_mol.HasSubstructMatch(template)

False
True
@greglandrum
Copy link
Member Author

Further simplification:

In [72]:

db_mol=Chem.MolFromSmiles('C1Cc2ccccc2CN1')
mb="""
  Mrv0541 10251405512D          

 10 11  0  0  1  0            999 V2000
  -17.2624   14.4196    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -17.9768   14.0071    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -17.9768   13.1821    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
  -17.2624   12.7696    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -16.5479   14.0071    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -16.5479   13.1821    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.8334   12.7696    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.1189   13.1821    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.1189   14.0071    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  -15.8334   14.4196    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  5  1  0  0  0  0
  2  1  1  0  0  0  0
  3  2  1  0  0  0  0
  3  4  1  0  0  0  0
  4  6  1  0  0  0  0
  5 10  4  0  0  0  0
  6  5  4  0  0  0  0
  6  7  4  0  0  0  0
  8  7  4  0  0  0  0
  9  8  4  0  0  0  0
 10  9  4  0  0  0  0
M  END
"""
template = Chem.MolFromMolBlock(mb, False)
# template
print db_mol.HasSubstructMatch(template)
template.ClearComputedProps()
print db_mol.HasSubstructMatch(template)

False
True

@greglandrum greglandrum added this to the 2014_09_1 milestone Oct 26, 2014
@greglandrum greglandrum self-assigned this Oct 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant