[BioPython] Bio.EUtils, MultiDict: getting all the authors?

richard k belew rik at cogsci.ucsd.edu
Tue Aug 12 21:24:44 UTC 2008


i am sure this has to have been addressed in a universe long ago and far
away, but...

i'm  trying to use Bio.EUtils to access NCBI/Entrez, but seem unable to
use its MultDict utilities as they are intended.

i include a sample run below.
i can contact NCBI and get the data just fine.  and the AuthorList = 
<OrderedMultiDict> is accessible.  the summary() whines about
finding "multiple Items named 'Author'!"

is there some (recursive?) idiom that is typically used?  i can
explicitly make the hack for extracting from the AuthorList, but
want to do something similar for any other OrderedMultiDicts, and
would like it all to stay as close to the DTDs as possible!

thanks for your help.

	rik

> Python 2.4.4 (#1, Oct 18 2006, 10:34:39) 
> [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from Bio import EUtils
>>>> from Bio.EUtils import DBIdsClient
>>>> PMID = "17447753"
>>>> idList = EUtils.DBIds("pubmed", PMID)
>>>> result = DBIdsClient.from_dbids(idList)
>>>> summary = result[0].summary()
> Found multiple Items named 'Author'!
> Found multiple Items named 'Author'!
> Found multiple Items named 'Author'!
>>>> data = summary.dataitems
>>>> data
> <OrderedMultiDict [('PubDate', Date(2007, 5, 1)), ('EPubDate', Date(2007, 4, 21)), ('Source', u'J Chem Inf Model'), ('AuthorList', <OrderedMultiDict [('Author', u'Chang MW'), ('Author', u'Lindstrom W'), ('Author', u'Olson AJ'), ('Author', u'Belew RK')]>), ('LastAuthor', u'Belew RK'), ('Title', u'Analysis of HIV wild-type and mutant structures via in silico docking against diverse ligand libraries.'), ('Volume', u'47'), ('Issue', u'3'), ('Pages', u'1258-62'), ('LangList', <OrderedMultiDict [('Lang', u'English')]>), ('NlmUniqueID', u'101230060'), ('ISSN', u'1549-9596'), ('ESSN', u'1549-960X'), ('PubTypeList', <OrderedMultiDict [('PubType', u'Journal Article')]>), ('RecordStatus', u'PubMed - indexed for MEDLINE'), ('PubStatus', u'ppublish+epublish'), ('ArticleIds', <OrderedMultiDict [('doi', u'10.1021/ci700044s'), ('pubmed', u'17447753')]>), ('DOI', u'10.1021/ci700044s'), ('History', <OrderedMultiDict [('aheadofprint', Date(2007, 4, 21)), ('pubmed', Date(2007, 4, 24)), ('medli
ne', Date(2007, 9, 6))]>), ('References', <OrderedMultiDict []>), ('HasAbstract', 1), ('PmcRefCount', 0), ('FullJournalName', u'Journal of chemical information and modeling'), ('ELocationID', u''), ('SO', u'2007 May-Jun;47(3):1258-62')]>
>>>> for k in keys: print k,data[k]
> ... 
> DOI 10.1021/ci700044s
> Title Analysis of HIV wild-type and mutant structures via in silico docking against diverse ligand libraries.
> Source J Chem Inf Model
> PmcRefCount 0
> Issue 3
> SO 2007 May-Jun;47(3):1258-62
> ISSN 1549-9596
> Volume 47
> FullJournalName Journal of chemical information and modeling
> RecordStatus PubMed - indexed for MEDLINE
> ESSN 1549-960X
> ELocationID 
> Pages 1258-62
> PubStatus ppublish+epublish
> AuthorList {'Author': u'Belew RK'}
> EPubDate 2007/04/21
> PubDate 2007/05/01
> NlmUniqueID 101230060
> LastAuthor Belew RK
> ArticleIds {'doi': u'10.1021/ci700044s', 'pubmed': u'17447753'}
> HasAbstract 1
> History {'medline': Date(2007, 9, 6), 'pubmed': Date(2007, 4, 24), 'aheadofprint': Date(2007, 4, 21)}
> LangList {'Lang': u'English'}
> References {}
> PubTypeList {'PubType': u'Journal Article'}
>>>> alist = data.get('AuthorList')
>>>> alist
> <OrderedMultiDict [('Author', u'Chang MW'), ('Author', u'Lindstrom W'), ('Author', u'Olson AJ'), ('Author', u'Belew RK')]>
>>>> for k,v in data.allitems(): print k,v
> ... 
> PubDate 2007/05/01
> EPubDate 2007/04/21
> Source J Chem Inf Model
> AuthorList {'Author': u'Belew RK'}
> LastAuthor Belew RK
> Title Analysis of HIV wild-type and mutant structures via in silico docking against diverse ligand libraries.
> Volume 47
> Issue 3
> Pages 1258-62
> LangList {'Lang': u'English'}
> NlmUniqueID 101230060
> ISSN 1549-9596
> ESSN 1549-960X
> PubTypeList {'PubType': u'Journal Article'}
> RecordStatus PubMed - indexed for MEDLINE
> PubStatus ppublish+epublish
> ArticleIds {'doi': u'10.1021/ci700044s', 'pubmed': u'17447753'}
> DOI 10.1021/ci700044s
> History {'medline': Date(2007, 9, 6), 'pubmed': Date(2007, 4, 24), 'aheadofprint': Date(2007, 4, 21)}
> References {}
> HasAbstract 1
> PmcRefCount 0
> FullJournalName Journal of chemical information and modeling
> ELocationID 
> SO 2007 May-Jun;47(3):1258-62




More information about the Biopython mailing list