Why Bio::DB::EUtilities->new( -eutil => $eutil, -email => 'mymail@foo.bar') with no extra argument only works for egquery?

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

Why Bio::DB::EUtilities->new( -eutil => $eutil, -email => 'mymail@foo.bar') with no extra argument only works for egquery?

Peng Yu
The following code works for egquery but not efetch. I want to find
out what databases are available for an eutil. Do anybody know what is
the correct way? Thanks.

$ cat main.pl
#!/usr/bin/env perl

use strict;
use warnings;

use Bio::DB::EUtilities;

my $eutil=$ARGV[0];
my $factory = Bio::DB::EUtilities->new(
#  -eutil => 'egquery',
  -eutil => $eutil,
  -email => '[hidden email]',
);

print join("\n", $factory->get_databases), "\n";
$ ./main.pl egquery
pubmed
pmc
mesh
books
pubmedhealth
omim
ncbisearch
nuccore
nucgss
nucest
protein
genome
structure
taxonomy
snp
dbvar
epigenomics
gene
sra
biosystems
unigene
cdd
clone
popset
geoprofiles
gds
homologene
pccompound
pcsubstance
pcassay
nlmcatalog
probe
gap
proteinclusters
bioproject
biosample
$ ./main.pl efetch

------------- EXCEPTION -------------
MSG: No parser defined for efetch; use get_Response() directly
STACK Bio::DB::EUtilities::get_Parser
/Users/xxx/perl5/lib/perl5/Bio/DB/EUtilities.pm:57
STACK Bio::DB::EUtilities::get_databases
/Users/xxx/perl5/lib/perl5/Bio/DB/EUtilities.pm:157
STACK toplevel ./main.pl:15
-------------------------------------


--
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: Why Bio::DB::EUtilities->new( -eutil => $eutil, -email => 'mymail@foo.bar') with no extra argument only works for egquery?

Fields, Christopher J
Actually, if you read the error message it does work but you will need to grab the raw output using the get_Response() method.  However, if you are using it this way you will run into problems, primarily b/c each eutil has different required/optional parameters.

If you installed Bio-EUtilities from CPAN there is a script called ‘bp_einfo’ that you can use (it’s a simple wrapper around einfo), which will list the databases and other tidbits of information as needed:

bp_einfo -e [hidden email]
pubmed
protein
nuccore
nucleotide
nucgss
nucest
structure
genome
assembly
bioproject
biosample
blastdbinfo
books
cdd
clinvar
clone
gap
gapplus
grasp
dbvar
epigenomics
gene
gds
geoprofiles
homologene
medgen
journals
mesh
ncbisearch
nlmcatalog
omim
orgtrack
pmc
popset
probe
proteinclusters
pcassay
biosystems
pccompound
pcsubstance
pubmedhealth
seqannot
snp
sra
taxonomy
toolkit
toolkitall
toolkitbook
unigene
gencoll



chris

> On Jun 3, 2015, at 12:00 PM, Peng Yu <[hidden email]> wrote:
>
> The following code works for egquery but not efetch. I want to find
> out what databases are available for an eutil. Do anybody know what is
> the correct way? Thanks.
>
> $ cat main.pl
> #!/usr/bin/env perl
>
> use strict;
> use warnings;
>
> use Bio::DB::EUtilities;
>
> my $eutil=$ARGV[0];
> my $factory = Bio::DB::EUtilities->new(
> #  -eutil => 'egquery',
>  -eutil => $eutil,
>  -email => '[hidden email]',
> );
>
> print join("\n", $factory->get_databases), "\n";
> $ ./main.pl egquery
> pubmed
> pmc
> mesh
> books
> pubmedhealth
> omim
> ncbisearch
> nuccore
> nucgss
> nucest
> protein
> genome
> structure
> taxonomy
> snp
> dbvar
> epigenomics
> gene
> sra
> biosystems
> unigene
> cdd
> clone
> popset
> geoprofiles
> gds
> homologene
> pccompound
> pcsubstance
> pcassay
> nlmcatalog
> probe
> gap
> proteinclusters
> bioproject
> biosample
> $ ./main.pl efetch
>
> ------------- EXCEPTION -------------
> MSG: No parser defined for efetch; use get_Response() directly
> STACK Bio::DB::EUtilities::get_Parser
> /Users/xxx/perl5/lib/perl5/Bio/DB/EUtilities.pm:57
> STACK Bio::DB::EUtilities::get_databases
> /Users/xxx/perl5/lib/perl5/Bio/DB/EUtilities.pm:157
> STACK toplevel ./main.pl:15
> -------------------------------------
>
>
> --
> 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