An example to query PMID given GEO accession number?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

An example to query PMID given GEO accession number?

Peng Yu
Hi,

I am looking for an example to to query GEO to get the PMID associated
with a GEO accession number.

For example, GSE39684 has the associated PMID 23028701. Can this be
done with bioperl? Does anybody have an example script for doing so?
Thanks.

--
Regards,
Peng
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Fields, Christopher J
Should be feasible via elink, possibly starting with using a search term against GEO, then using the link between GEO and pubmed (via GEO’s UID) to get related PMIDs.

chris

> On Jun 9, 2015, at 9:47 AM, Peng Yu <[hidden email]> wrote:
>
> Hi,
>
> I am looking for an example to to query GEO to get the PMID associated
> with a GEO accession number.
>
> For example, GSE39684 has the associated PMID 23028701. Can this be
> done with bioperl? Does anybody have an example script for doing so?
> Thanks.
>
> --
> Regards,
> Peng
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l


_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Smithies, Russell
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   => '[hidden email]',
);

# 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";

-------------------------------------------------

-----Original Message-----
From: bioperl-l-bounces+russell.smithies=[hidden email] [mailto:bioperl-l-bounces+russell.smithies=[hidden email]] On Behalf Of Fields, Christopher J
Sent: Wednesday, 10 June 2015 3:52 a.m.
To: Peng Yu
Cc: [hidden email]
Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?

Should be feasible via elink, possibly starting with using a search term against GEO, then using the link between GEO and pubmed (via GEO’s UID) to get related PMIDs.

chris

> On Jun 9, 2015, at 9:47 AM, Peng Yu <[hidden email]> wrote:
>
> Hi,
>
> I am looking for an example to to query GEO to get the PMID associated
> with a GEO accession number.
>
> For example, GSE39684 has the associated PMID 23028701. Can this be
> done with bioperl? Does anybody have an example script for doing so?
> Thanks.
>
> --
> Regards,
> Peng
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l


_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Smithies, Russell
And to get back the Pubmed data you need to use the history.

--------------------------------

my $hist  = $factory->next_History || die 'No history data returned';
$factory->set_parameters(-eutil   => 'efetch',
                         -rettype => 'xml',
                         -history => $hist);
$factory->get_Response(-file => "$geo.xml");


----------------------------------

--Russell


-----Original Message-----
From: bioperl-l-bounces+russell.smithies=[hidden email] [mailto:bioperl-l-bounces+russell.smithies=[hidden email]] On Behalf Of Smithies, Russell
Sent: Wednesday, 10 June 2015 8:09 a.m.
To: Fields, Christopher J; Peng Yu
Cc: [hidden email]
Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?

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   => '[hidden email]',
);

# 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";

-------------------------------------------------

-----Original Message-----
From: bioperl-l-bounces+russell.smithies=[hidden email] [mailto:bioperl-l-bounces+russell.smithies=[hidden email]] On Behalf Of Fields, Christopher J
Sent: Wednesday, 10 June 2015 3:52 a.m.
To: Peng Yu
Cc: [hidden email]
Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?

Should be feasible via elink, possibly starting with using a search term against GEO, then using the link between GEO and pubmed (via GEO’s UID) to get related PMIDs.

chris

> On Jun 9, 2015, at 9:47 AM, Peng Yu <[hidden email]> wrote:
>
> Hi,
>
> I am looking for an example to to query GEO to get the PMID associated
> with a GEO accession number.
>
> For example, GSE39684 has the associated PMID 23028701. Can this be
> done with bioperl? Does anybody have an example script for doing so?
> Thanks.
>
> --
> Regards,
> Peng
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l


_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Fields, Christopher J
Yep (and thanks for the more explicit answer :).  

Sometimes it takes playing around with parameters to get what you need, but in general anything that is doable via the Entrez interface is possible via eutils.

chris

> On Jun 9, 2015, at 3:20 PM, Smithies, Russell <[hidden email]> wrote:
>
> And to get back the Pubmed data you need to use the history.
>
> --------------------------------
>
> my $hist  = $factory->next_History || die 'No history data returned';
> $factory->set_parameters(-eutil   => 'efetch',
>                         -rettype => 'xml',
>                         -history => $hist);
> $factory->get_Response(-file => "$geo.xml");
>
>
> ----------------------------------
>
> --Russell
>
>
> -----Original Message-----
> From: bioperl-l-bounces+russell.smithies=[hidden email] [mailto:bioperl-l-bounces+russell.smithies=[hidden email]] On Behalf Of Smithies, Russell
> Sent: Wednesday, 10 June 2015 8:09 a.m.
> To: Fields, Christopher J; Peng Yu
> Cc: [hidden email]
> Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?
>
> 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   => '[hidden email]',
> );
>
> # 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";
>
> -------------------------------------------------
>
> -----Original Message-----
> From: bioperl-l-bounces+russell.smithies=[hidden email] [mailto:bioperl-l-bounces+russell.smithies=[hidden email]] On Behalf Of Fields, Christopher J
> Sent: Wednesday, 10 June 2015 3:52 a.m.
> To: Peng Yu
> Cc: [hidden email]
> Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?
>
> Should be feasible via elink, possibly starting with using a search term against GEO, then using the link between GEO and pubmed (via GEO’s UID) to get related PMIDs.
>
> chris
>
>> On Jun 9, 2015, at 9:47 AM, Peng Yu <[hidden email]> wrote:
>>
>> Hi,
>>
>> I am looking for an example to to query GEO to get the PMID associated
>> with a GEO accession number.
>>
>> For example, GSE39684 has the associated PMID 23028701. Can this be
>> done with bioperl? Does anybody have an example script for doing so?
>> Thanks.
>>
>> --
>> Regards,
>> Peng
>> _______________________________________________
>> Bioperl-l mailing list
>> [hidden email]
>> http://mailman.open-bio.org/mailman/listinfo/bioperl-l
>
>
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l
>
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l


_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Peng Yu
In reply to this post by Smithies, Russell
On Tue, Jun 9, 2015 at 3:09 PM, Smithies, Russell
<[hidden email]> 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   => '[hidden email]',
> );
>
> # 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   => '[hidden email]',
);

# 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
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Smithies, Russell
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   => '[hidden email]',
        -usehistory => 'y',   <<<<============
);


--Russell


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

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

# 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

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Smithies, Russell
In reply to this post by Peng Yu
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:[hidden email]]
Sent: Monday, 15 June 2015 1:25 p.m.
To: Smithies, Russell
Cc: Fields, Christopher J; [hidden email]
Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?

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

# 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

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Peng Yu
In reply to this post by Smithies, Russell
On Sun, Jun 14, 2015 at 8:33 PM, Smithies, Russell
<[hidden email]> 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   => '[hidden email]',
>         -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   => '[hidden email]',
  -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
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Smithies, Russell
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:[hidden email]]
Sent: Monday, 15 June 2015 1:58 p.m.
To: Smithies, Russell
Cc: Fields, Christopher J; [hidden email]
Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?

On Sun, Jun 14, 2015 at 8:33 PM, Smithies, Russell <[hidden email]> 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   => '[hidden email]',
>         -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   => '[hidden email]',
  -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

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Peng Yu
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
<[hidden email]> 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:[hidden email]]
> Sent: Monday, 15 June 2015 1:58 p.m.
> To: Smithies, Russell
> Cc: Fields, Christopher J; [hidden email]
> Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?
>
> On Sun, Jun 14, 2015 at 8:33 PM, Smithies, Russell <[hidden email]> 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   => '[hidden email]',
>>         -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   => '[hidden email]',
>   -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
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Smithies, Russell
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  => '[hidden email]',
                                       -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:[hidden email]]
Sent: Wednesday, 17 June 2015 4:04 a.m.
To: Smithies, Russell
Cc: Fields, Christopher J; [hidden email]
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 <[hidden email]> 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:[hidden email]]
> Sent: Monday, 15 June 2015 1:58 p.m.
> To: Smithies, Russell
> Cc: Fields, Christopher J; [hidden email]
> Subject: Re: [Bioperl-l] An example to query PMID given GEO accession number?
>
> On Sun, Jun 14, 2015 at 8:33 PM, Smithies, Russell <[hidden email]> 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   => '[hidden email]',
>>         -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   => '[hidden email]',
>   -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

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Peng Yu
> 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  => '[hidden email]',
>                                        -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
_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|

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

Smithies, Russell
Not sure as it's not something I've done.
Submit them one at a time maybe?

--Russell

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

> 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  => '[hidden email]',
>                                        -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

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l