Chemistry Toolkit Rosetta Wiki
Line 56: Line 56:
 
</pre>
 
</pre>
   
  +
Yesterday, my friend bought a http://www.ebuyrosettastone.com Rosetta Stone Spanish which is so beautiful, i am surprised by the design and style. Do you have a pair of http://www.christianlouboutinsoutlet.com/ cheap coach handbags now? if not, go to online store and have one, it is so amazing!!!
The results are 24, 4 and 2. "Unique" in Cactvs match nomenclature means that not only the matched atoms cannot be the same set, but they also must be topologically distinct from any other match set. The "distinct" match mode simply checks whether a different set of structure atoms was matched (the Rosetta problem), which is a far simpler task.
 
 
 
[[Category:SMARTS]]
 
[[Category:SMARTS]]
 
[[Category:feature counts]]
 
[[Category:feature counts]]

Revision as of 01:51, 9 May 2011

A number of molecular descriptors are based on how many times a given SMARTS pattern is uniquely found in a structure. For example, the CACTVS substructure key 122 is set if there are ">= 2 any ring size 3". That query can be written in SMARTS as "*1**1", but of course each ring of size 3 will match 6 times because of symmetry.

Most toolkits have have a way to find all matches for a given SMARTS and a way to find all unique matches for a given SMARTS. "Unique" here means that no two different matches will have the same set of matched atoms. The point of this task is to show how that's done.

Implementation

Yesterday, my friend bought a http://www.ebuyrosettastone.com Rosetta Stone Spanish which is so beautiful, i am surprised by the design and style. Do you have a pair of http://www.christianlouboutinsoutlet.com/ cheap coach handbags now? if not, go to online store and have one, it is so amazing!!!

OpenBabel/Pybel

import pybel
mol = pybel.readstring("smi", "C1CC12C3(C24CC4)CC3")
smarts = pybel.Smarts("*1**1")

# pybel doesn't have a direct way to get the non-unique matches, so
# use the lower-level OpenBabel API directly
smarts.obsmarts.Match(mol.OBMol)
num_matches = sum(1 for indicies in smarts.obsmarts.GetMapList())

num_unique_matches = len(smarts.findall(mol))

print "number of matches:", num_matches
print "number of unique matches:", num_unique_matches

Yesterday, my friend bought a http://www.ebuyrosettastone.com Rosetta Stone Spanish which is so beautiful, i am surprised by the design and style. Do you have a pair of http://www.christianlouboutinsoutlet.com/ cheap coach handbags now? if not, go to online store and have one, it is so amazing!!!

OpenEye/Python

from openeye.oechem import *

mol = OEGraphMol()
OEParseSmiles(mol, "C1CC12C3(C24CC4)CC3")
pat = OESubSearch("*1**1")

num_matches = sum(1 for match in pat.Match(mol))
num_unique_matches = sum(1 for match in pat.Match(mol, True))

print "number of matches:", num_matches
print "number of unique matches:", num_unique_matches

Yesterday, my friend bought a http://www.ebuyrosettastone.com Rosetta Stone Spanish which is so beautiful, i am surprised by the design and style. Do you have a pair of http://www.christianlouboutinsoutlet.com/ cheap coach handbags now? if not, go to online store and have one, it is so amazing!!!

RDKit/Python

from rdkit import Chem
mol = Chem.MolFromSmiles('C1CC12C3(C24CC4)CC3')
patt = Chem.MolFromSmarts('*1**1')

print "number of matches:", len(mol.GetSubstructMatches(patt,uniquify=False))
print "number of unique matches:", len(mol.GetSubstructMatches(patt))

Yesterday, my friend bought a http://www.ebuyrosettastone.com Rosetta Stone Spanish which is so beautiful, i am surprised by the design and style. Do you have a pair of http://www.christianlouboutinsoutlet.com/ cheap coach handbags now? if not, go to online store and have one, it is so amazing!!!

Cactvs/Tcl

set eh [ens create C1CC12C3(C24CC4)CC3]
puts "Number of matches: [match ss -mode all *1**1 $eh]"
puts "Number of atom set unique matches: [match ss -mode distinct *1**1 $eh]"
puts "Number of topologically unique matches: [match ss -mode unique *1**1 $eh]"

Yesterday, my friend bought a http://www.ebuyrosettastone.com Rosetta Stone Spanish which is so beautiful, i am surprised by the design and style. Do you have a pair of http://www.christianlouboutinsoutlet.com/ cheap coach handbags now? if not, go to online store and have one, it is so amazing!!!