Trees | Indices | Help |
|
---|
|
Tools for doing PubMed searches and processing the results NOTE: much of the example code in the documentation here uses XML files from the test_data directory in order to avoid having to call out to PubMed itself. Actual calls to the functions would not include the _conn_ argument.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Imports: RDConfig, QueryParams, Records, urllib, urllib2, ElementTree
|
returns a tuple of pubmed ids (strings) for the query provided To do a search, we need a query object: >>> query = QueryParams.details() set up the search parameters: >>> query['term'] = 'penzotti je AND grootenhuis pd' >>> query['field'] = 'auth' now get the search ids: >>> counts = GetNumHits(query) >>> counts 2 alternately, we can search using field specifiers: >>> query = QueryParams.details() >>> query['term'] = 'penzotti je[au] AND hydrogen bonding[mh]' >>> counts = GetNumHits(query) >>> counts 3 |
returns a tuple of pubmed ids (strings) for the query provided To do a search, we need a query object: >>> query = QueryParams.details() set up the search parameters: >>> query['term'] = 'penzotti je AND grootenhuis pd' >>> query['field'] = 'auth' now get the search ids: >>> ids = GetSearchIds(query) >>> len(ids) 2 >>> ids[0] '11960484' >>> ids[1] '10893315' |
gets a set of document summary records for the ids provided >>> ids = ['11960484'] >>> summs = GetSummaries(ids,conn=open(os.path.join(testDataDir,'summary.xml'),'r')) >>> len(summs) 1 >>> rec = summs[0] >>> isinstance(rec,Records.SummaryRecord) 1 >>> rec.PubMedId '11960484' >>> rec.Authors 'Penzotti JE, Lamb ML, Evensen E, Grootenhuis PD' >>> rec.Title 'A computational ensemble pharmacophore model for identifying substrates of P-glycoprotein.' >>> rec.Source 'J Med Chem' >>> rec.Volume '45' >>> rec.Pages '1737-40' >>> rec.HasAbstract '1' |
gets a set of document summary records for the ids provided >>> ids = ['11960484'] >>> recs = GetRecords(ids,conn=open(os.path.join(testDataDir,'records.xml'),'r')) >>> len(recs) 1 >>> rec = recs[0] >>> rec.PubMedId '11960484' >>> rec.Authors u'Penzotti JE, Lamb ML, Evensen E, Grootenhuis PD' >>> rec.Title u'A computational ensemble pharmacophore model for identifying substrates of P-glycoprotein.' >>> rec.Source u'J Med Chem' >>> rec.Volume '45' >>> rec.Pages '1737-40' >>> rec.PubYear '2002' >>> rec.Abstract[:10] u'P-glycopro' We've also got access to keywords: >>> str(rec.keywords[0]) 'Combinatorial Chemistry Techniques' >>> str(rec.keywords[3]) 'Indinavir / chemistry' and chemicals: >>> rec.chemicals[0] 'P-Glycoprotein' >>> rec.chemicals[2] 'Nicardipine <55985-32-5>' |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Apr 23 18:49:15 2016 | http://epydoc.sourceforge.net |