Re: An example to query PMID given GEO accession number?

"Smithies, Russell" <[email protected]>
Newsgroups gmane.comp.lang.perl.bio.general
Message-ID <9B1F872E353E2440A97EEDB9F072B406BE626CD0@invexcpv01.agresearch.co.nz>
I assume you read the documentation and understand what the query is doing?
Is your Geo UID a member of a dataset or series? - that's what the query is restricting to when it filters the entry-type. I assume that your editing of the query and removing "OR gds[ETYP]" means that's it's part of a dataset.
Also what do you mean by the "correct" PMID? These are often updated/deprecated so you can get different results on successive days.

--Russell


-----Original Message-----
From: Peng Yu [mailto:[email protected]] 
Sent: Monday, 15 June 2015 1:25 p.m.
To: Smithies, Russell
Cc: Fields, Christopher J; [email protected]
Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?

On Tue, Jun 9, 2015 at 3:09 PM, Smithies, Russell <[email protected]> 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   => '[email protected]',
> );
>
> # 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   => '[email protected]',
);

# 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.