Dear PyMOL Users,
I am using Open source PyMOL 2.1 installed on Windows 10 (Python 3.6). I
found a very interesting ability of PyMOL which is related to SMILES
pattern matching. With the help of following code, I am able to get count
of matches for a specified SMILES pattern. For example, I used
"C1*CC*CC*N1" pattern to get number of Pyridine rings (actually the pattern
refers to "six membered aromatic ring containing Nitrogen"). Now, I want to
develop a method to use this pattern recognition ability of PyMOL to select
the atoms which matches the given SMILES pattern.
from chempy import champ
from chempy.champ import Champ
ch=Champ()
model = cmd.get_model('all')
model_pat = ch.insert_model(model)
assn_pat = ch.insert_pattern_string("C1*CC*CC*N1")
abc = ch.match_1v1_n(assn_pat,model_pat,10000,2)
xyy = ch.pattern_get_string(model_pat)
print (abc)
Thanks in advance.
Cheers
Vijay
--
Assistant Professor
Department of Chemistry,
Vidya Bharati College, Amravati, 444 602
Maharashtra, India.
Phone number- +91-9403312628
https://sites.google.com/site/vijaymasand/
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net