Permalink
Browse files

Set the EUtils URL in NCBIHelper, inherit in entrez.pm and GenBank.pm…

…, t/RemoteDB/Taxonomy.t and t/RemoteDB/GenBank.t tests pass
  • Loading branch information...
bosborne committed Sep 17, 2013
1 parent 84a3d15 commit 0946759cba480a81c2943ec200cb317cc0a2945d
Showing with 24 additions and 21 deletions.
  1. +17 −15 Bio/DB/NCBIHelper.pm
  2. +5 −4 Bio/DB/Query/GenBank.pm
  3. +2 −2 Bio/DB/Taxonomy/entrez.pm
View
@@ -99,25 +99,27 @@ use base qw(Bio::DB::WebDBSeqI Bio::Root::Root);
BEGIN {
$MAX_ENTRIES = 19000;
- $HOSTBASE = 'http://eutils.ncbi.nlm.nih.gov';
+ $HOSTBASE = 'http://eutils.ncbi.nlm.nih.gov';
%CGILOCATION = (
- 'batch' => ['post' => '/entrez/eutils/epost.fcgi'],
- 'query' => ['get' => '/entrez/eutils/efetch.fcgi'],
- 'single' => ['get' => '/entrez/eutils/efetch.fcgi'],
- 'version'=> ['get' => '/entrez/eutils/efetch.fcgi'],
- 'gi' => ['get' => '/entrez/eutils/efetch.fcgi'],
- 'webenv' => ['get' => '/entrez/eutils/efetch.fcgi']
- );
-
- %FORMATMAP = ( 'gb' => 'genbank',
- 'gp' => 'genbank',
- 'fasta' => 'fasta',
- 'asn.1' => 'entrezgene',
- 'gbwithparts' => 'genbank',
- );
+ 'batch' => [ 'post' => '/entrez/eutils/epost.fcgi' ],
+ 'query' => [ 'get' => '/entrez/eutils/efetch.fcgi' ],
+ 'single' => [ 'get' => '/entrez/eutils/efetch.fcgi' ],
+ 'version' => [ 'get' => '/entrez/eutils/efetch.fcgi' ],
+ 'gi' => [ 'get' => '/entrez/eutils/efetch.fcgi' ],
+ 'webenv' => [ 'get' => '/entrez/eutils/efetch.fcgi' ]
+ );
+
+ %FORMATMAP = (
+ 'gb' => 'genbank',
+ 'gp' => 'genbank',
+ 'fasta' => 'fasta',
+ 'asn.1' => 'entrezgene',
+ 'gbwithparts' => 'genbank',
+ );
$DEFAULTFORMAT = 'gb';
}
+
# the new way to make modules a little more lightweight
sub new {
View
@@ -98,11 +98,12 @@ preceded with a _
package Bio::DB::Query::GenBank;
use strict;
use URI::Escape 'uri_unescape';
+use Bio::DB::NCBIHelper;
-use constant EPOST => 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/epost.fcgi';
-use constant ESEARCH => 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi';
-use constant DEFAULT_DB => 'protein';
-use constant MAXENTRY => 100;
+use constant EPOST => $Bio::DB::NCBIHelper::HOSTBASE . '/entrez/eutils/epost.fcgi';
+use constant ESEARCH => $Bio::DB::NCBIHelper::HOSTBASE . '/entrez/eutils/esearch.fcgi';
+use constant DEFAULT_DB => 'protein';
+use constant MAXENTRY => 100;
use vars qw(@ATTRIBUTES);
@@ -105,8 +105,8 @@ use vars qw($EntrezLocation $UrlParamSeparatorValue %EntrezParams
$EntrezGet $EntrezSummary $EntrezFetch %SequenceParams
$XMLTWIG $DATA_CACHE $RELATIONS);
use strict;
-
use Bio::Taxon;
+use Bio::DB::NCBIHelper;
eval {
require XML::Twig;
@@ -118,7 +118,7 @@ if( $@ ) {
use base qw(Bio::WebAgent Bio::DB::Taxonomy);
-$EntrezLocation = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/';
+$EntrezLocation = $Bio::DB::NCBIHelper::HOSTBASE . '/entrez/eutils/';
$EntrezGet = 'esearch.fcgi';
$EntrezFetch = 'efetch.fcgi';
$EntrezSummary = 'esummary.fcgi';

0 comments on commit 0946759

Please sign in to comment.