[Bioperl-l] An example to query PMID given GEO accession number?

Peng Yu pengyu.ut at gmail.com
Wed Jun 17 01:18:16 UTC 2015


> 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  => 'mymail at foo.bar',
>                                        -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


More information about the Bioperl-l mailing list