I've been trying to use the smarts facilities of CDK to detect
functional groups within SMILES strings.  The
UniversalIsomorphismTester.getSubgraph*() methods seem to be what I
want.  I can get the bond mapping to work but the
UniversalIsomorphismTest.getSubgraphAtomsMaps() method doesn't seem to
work.  Below is some Jython code to illustrate my point.  I hope it's
self explanitory even for those not familiar with python:

<jython-code>

import org.openscience.cdk as CDK
U = CDK.isomorphism.UniversalIsomorphismTester

mol = CDK.smiles.SmilesParser().parseSmiles('OCCC=CCO')
smarts = CDK.smiles.smarts.SMARTSParser.parse('CO')

bondMatches = U.getSubgraphMaps(mol, smarts)

for match in bondMatches:
    print 'BondMatch:',
    for rMap in match:
        print '%d-%d' % (rMap.getId1(), rMap.getId2())
        
atomMatches = U.getSubgraphAtomsMaps(mol, smarts)

for match in atomMatches:
    print 'AtomMatch: ', match

</jython-code>

<output>
BondMatch: 0-0
BondMatch: 5-0
AtomMatch:  []
AtomMatch:  []
</output>

The atom mapping are empty, even though the bond mappings are correct.
Am I missunderstanding the purpose of getSubgraphAtomsMaps()?
Converting from a bond mapping to an atom mapping doesn't look easy,
since a bond could match in either direction (e.g. above the first match
is an O-C bond, the second match is a C-O bond).  Is there a facility in
CDK to do this?

Thanks,
Stephen

---
Stephen Pascoe  01235 445980
Climateprediction.net data scientist
Rutherford Appleton Laboratory, CCLRC


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to