source: orange-bioinformatics/doc/modules/obiMeSH-dataset-generator.py @ 967:11274b7ca4d0

Revision 967:11274b7ca4d0, 652 bytes checked in by crt <crtomir.gorup@…>, 5 years ago (diff)

updated manuals

Line 
1import obiMeSH
2
3names = ['1,3-diallylurea','1,7-octadiene','1,8-nonadiene'
4'2,6-Dmhe','2-Dimethylamnoethyl cloride','2-cyanoethyl acrylate','5-fluorouracil']
5
6print "cid  name    smiles  mesh"
7print "string   string  string  string"
8print ""
9
10d = obiMeSH.obiMeSH()
11chem = obiMeSH.pubChemAPI()
12
13for i in names:
14    cids = chem.getCIDs(i.strip())
15    #print i, cids
16    if len(cids) > 0:
17        names.remove(i)
18        cid = cids[0] # we hope that first CID is the right one
19        # MeSH terms
20        terms = chem.getMeSHterms([int(cid)])[cid]
21        smiles = chem.getSMILE(int(cid),"cid")
22        print cid, "\t", i, "\t", smiles, "\t", terms
23       
24#print "Manualy annotate following chemicals -> ", names
Note: See TracBrowser for help on using the repository browser.