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

Smithies, Russell Russell.Smithies at agresearch.co.nz
Tue Jun 16 19:34:03 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);

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";
    print "   GDS IDs: ",join(',',$ds->get_ids),"\n";
}

@ids     = qw(23028701 24327544);
$factory->set_parameters(-db   => 'gds',
                         -dbfrom => 'pubmed',
                         -id => \@ids);

while (my $ds = $factory->next_LinkSet) {
    print " Link name: ",$ds->get_link_name,"\n";
    print "   GDS IDs: ",join(',',$ds->get_submitted_ids),"\n";
    print "Pubmed IDs: ",join(',',$ds->get_ids),"\n";
}

------------------------------------------
--Russell

-----Original Message-----
From: Peng Yu [mailto:pengyu.ut at gmail.com] 
Sent: Wednesday, 17 June 2015 4:04 a.m.
To: Smithies, Russell
Cc: Fields, Christopher J; bioperl-l at lists.open-bio.org
Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?

Given Series GSE39684 and GSE39685, finding the correlated PMIDs can be done using the following URL.
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=gds&db=pubmed&id=200039684&id=200039685

Given PMIDs 23028701 and 24327544, finding the correlated GEO accession can be done using the following URL
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&db=gds&id=23028701&id=24327544

Do you mind showing me the correct bioperl commands? (Especially, when there are multiple ids specified, the output should contain both the original input and output numbers, as some input may not have corresponding output, it is important to know what input the output corresponds to.)

On Sun, Jun 14, 2015 at 9:34 PM, Smithies, Russell <Russell.Smithies at agresearch.co.nz> wrote:
> OK, I think I see what the problem is ;-)
>
> This is the correct Pubmed link with a Pubmed UID: 
> http://www.ncbi.nlm.nih.gov/pubmed/?term=23028701[uid]
> This is a link to the paper but with a GDS UID: 
> http://www.ncbi.nlm.nih.gov/gds/?term=200039684[uid]
>
> Not exactly sure how you'd convert between the two (elink maybe?) , but looks like it's giving the same answer.
>
> --Russell
>
> -----Original Message-----
> From: Peng Yu [mailto:pengyu.ut at gmail.com]
> Sent: Monday, 15 June 2015 1:58 p.m.
> To: Smithies, Russell
> Cc: Fields, Christopher J; bioperl-l at lists.open-bio.org
> Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?
>
> On Sun, Jun 14, 2015 at 8:33 PM, Smithies, Russell <Russell.Smithies at agresearch.co.nz> wrote:
>> You need to specify you want to use history - it doesn't do it by default.
>>
>> my $factory = Bio::DB::EUtilities->new(
>>         -eutil   => 'esearch',
>>         -db      => 'gds',
>>         -term    => "${geo}[ACCN] AND (gse[ETYP] OR gds[ETYP])",
>>         -email   => 'x at y.com',
>>         -usehistory => 'y',   <<<<============
>> );
>
> I still can't get the correct result (it should be 23028701). Could you try the code and see if it works on your machine?
>
> $ ./main.pl
> Query translation: GSE39684[ACCN] AND gse[ETYP] Count = 1
> 200039684
> $ cat main.pl
> #!/usr/bin/env perl
>
> use strict;
> use warnings;
> use autodie;
>
> use FindBin;
> use lib "$FindBin::Bin/.";
> use Bio::DB::EUtilities;
>
> # want to get PMID 23028701
> my $geo        = "GSE39684";
> my $factory = Bio::DB::EUtilities->new(
>   -eutil   => 'esearch',
>   -db      => 'gds',
>   #-term    => "${geo}[ACCN] AND (gse[ETYP] OR gds[ETYP])", # whether
> I use this line or the following line, the result is the same.
>   -term    => "${geo}[ACCN] AND (gse[ETYP])",
>   -email   => 'x at y.com',
>   -usehistory => 'y',
> );
>
> # query terms are mapped; what's the actual query?
> print "Query translation: ",$factory->get_query_translation,"\n";
> # query hits
> print "Count = ",$factory->get_count,"\n"; # UIDs my @ids = 
> $factory->get_ids; print "@ids\n";
>
>
> --
> Regards,
> Peng



--
Regards,
Peng



More information about the Bioperl-l mailing list