Re: An example to query PMID given GEO accession number?
Peng Yu <[email protected]> Tue, 16 Jun 2015 20:18:16 -0500
| Newsgroups | gmane.comp.lang.perl.bio.general |
|---|---|
| Message-ID | <CABrM6wnH3CuykyS+cCHzDe8zLp6uOgSGMX48kX=2APnuqN_EqQ@mail.gmail.com> |
> Have you been reading the documentation? Then elink example provided on the bioperl wiki should do most of what you want. > http://www.bioperl.org/wiki/HOWTO:EUtilities_Cookbook#elink > > Also docs at NCBI so you can create your own URLs then 'manually' pull in results then parse the XML > http://www.ncbi.nlm.nih.gov/books/NBK25500/ > > ------------------------------------------ > use Bio::DB::EUtilities; > > my @ids = qw(200039684 200039685); When there are GDS IDs (e.g., 200069227) without Pubmed IDs, the lengths of $ds->get_submitted_ids and $ds->get_ids will be different. In this the pair information will be lost. How to keep the pair information? (I am not sure if this is addressed in the cookbook.) > my $factory = Bio::DB::EUtilities->new(-eutil => 'elink', > -email => '[email protected]', > -db => 'pubmed', > -dbfrom => 'gds', > -id => \@ids); > > # iterate through the LinkSet objects > while (my $ds = $factory->next_LinkSet) { > print " Link name: ",$ds->get_link_name,"\n"; > print "Pubmed IDs: ",join(',',$ds->get_submitted_ids),"\n"; The above should be GDS IDs. > print " GDS IDs: ",join(',',$ds->get_ids),"\n"; The above should be Pubmed IDs. > } -- Regards, Peng