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

Smithies, Russell Russell.Smithies at agresearch.co.nz
Mon Jun 15 01:33:16 UTC 2015


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',   <<<<============
);


--Russell


-----Original Message-----
From: Peng Yu [mailto:pengyu.ut at gmail.com] 
Sent: Monday, 15 June 2015 1:25 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 Tue, Jun 9, 2015 at 3:09 PM, Smithies, Russell <Russell.Smithies at agresearch.co.nz> wrote:
> It's all a matter of knowing the database and how to format the query.
>
> --Russell
>
> ---------------------------------------
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> 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])",
>         -email   => 'x at y.com',
> );
>
> # 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";

Why can't I get the correct PMID?

~$ ./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])",
  -term    => "${geo}[ACCN] AND (gse[ETYP])",
  -email   => 'x at y.com',
);

# 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



More information about the Bioperl-l mailing list