Re: [Rdkit-discuss] MSC using atomCompare set to 'isotopes'
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2014-01-10 13:16:58
|
Hi Liz, On Thu, Jan 9, 2014 at 4:35 PM, Elizabeth Wylie <ewy...@gm...> wrote: > Hi All, > > I think I've run into either some unexpected behavior or misleading > documentation in the MCS module. In the guide it reads: "An atomCompare of > 'any' says that any atom matches any other atom, 'elements' compares by > element type, and 'isotopes' matches based on the isotope label. Isotope > labels can be used to implement user-defined atom types." I've created a > sort of hash based on the element and hybridization of the atom and stored > it in the isotope label. FindMCS generates the correct results but the > SMARTS in the MCSResult is garbage. > "garbage" is a bit strong. It is returning the SMARTS corresponding to what it matched. I can understand that this isn't what you're looking for, but fortunately it's not a giant amount of work to get what (I think) you want. See below. > > MCSResult(numAtoms=35, numBonds=39, smarts='[46*]-[38*]-[36*]:1:[36*]:[36*]:[36*](:[36*]:[36*]:1)-[46*](-[36*]:1:[36*]:[36*]:[36*]:[36*]:[36*]:1)(-[36*]:1:[36*]:[36*]:[36*]:[36*]:[36*]:1)-[37*]-[36*]:1:[37*]:[36*]:2:[36*](:[36*](:[37*]:1)=[38*]):[37*]:[36*]:[37*]:2-[46*]-[48*]-[46*]', completed=1) > > > My isotope label has overwritten the other element information. The SMILES > I'm comparing are > "COc1ccc(C(Nc2nc3c(ncn3COCC=O)c(=O)[nH]2)(c2ccccc2)c2ccccc2)cc1" and > "COc1ccc(C(Nc2nc3c(ncn3COC(CO)(CO)CO)c(=O)[nH]2)(c2ccccc2)c2ccccc2)cc1". > > Is there a way to produce the same matching behavior (hybridization and > element must match) and still produce usable SMARTS? I specifically wanted > to be able to use a hash so that I could extend this to other features. > I put together an IPython notebook showing one way to do this. Here's an nbviewer link: http://nbviewer.ipython.org/gist/greglandrum/8351725 and here's the example itself: https://gist.github.com/greglandrum/8351725 It's a fun example; thanks! -greg |