Bio-DB-NCBIHelper

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Bio::DB::WebDBSeqI" : "0",
            "Bio::Root::IO" : "0",
            "Bio::Root::Root" : "0",
            "Bio::SeqIO" : "0",
            "Bio::SeqIO::entrezgene" : "0",
            "Bio::Taxon" : "0",
            "Bio::WebAgent" : "0",
            "CGI" : "0",
            "Cache::FileCache" : "0",
            "Getopt::Long" : "0",
            "HTTP::Request::Common" : "0",
            "LWP::Protocol::https" : "0",
            "LWP::UserAgent" : "0",
            "URI" : "0",
            "URI::Escape" : "0",
            "XML::Twig" : "0",
            "base" : "0",
            "constant" : "0",
            "strict" : "0",
            "vars" : "0",
            "warnings" : "0"

META.yml  view on Meta::CPAN

  Bio::DB::WebDBSeqI: '0'
  Bio::Root::IO: '0'
  Bio::Root::Root: '0'
  Bio::SeqIO: '0'
  Bio::SeqIO::entrezgene: '0'
  Bio::Taxon: '0'
  Bio::WebAgent: '0'
  CGI: '0'
  Cache::FileCache: '0'
  Getopt::Long: '0'
  HTTP::Request::Common: '0'
  LWP::Protocol::https: '0'
  LWP::UserAgent: '0'
  URI: '0'
  URI::Escape: '0'
  XML::Twig: '0'
  base: '0'
  constant: '0'
  strict: '0'
  vars: '0'
  warnings: '0'

Makefile.PL  view on Meta::CPAN

    "Bio::DB::WebDBSeqI" => 0,
    "Bio::Root::IO" => 0,
    "Bio::Root::Root" => 0,
    "Bio::SeqIO" => 0,
    "Bio::SeqIO::entrezgene" => 0,
    "Bio::Taxon" => 0,
    "Bio::WebAgent" => 0,
    "CGI" => 0,
    "Cache::FileCache" => 0,
    "Getopt::Long" => 0,
    "HTTP::Request::Common" => 0,
    "LWP::Protocol::https" => 0,
    "LWP::UserAgent" => 0,
    "URI" => 0,
    "URI::Escape" => 0,
    "XML::Twig" => 0,
    "base" => 0,
    "constant" => 0,
    "strict" => 0,
    "vars" => 0,
    "warnings" => 0

Makefile.PL  view on Meta::CPAN

  "Bio::Root::IO" => 0,
  "Bio::Root::Root" => 0,
  "Bio::SeqIO" => 0,
  "Bio::SeqIO::entrezgene" => 0,
  "Bio::Taxon" => 0,
  "Bio::WebAgent" => 0,
  "CGI" => 0,
  "Cache::FileCache" => 0,
  "File::Spec" => 0,
  "Getopt::Long" => 0,
  "HTTP::Request::Common" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "LWP::Protocol::https" => 0,
  "LWP::UserAgent" => 0,
  "Test::Exception" => 0,
  "Test::More" => 0,
  "Test::Most" => 0,
  "Test::RequiresInternet" => 0,
  "URI" => 0,
  "URI::Escape" => 0,

bin/bp_biofetch_genbank_proxy  view on Meta::CPAN

#!/usr/bin/perl

# dbfetch style caching proxy for GenBank
use strict;
use warnings;
use CGI qw(:standard);
use HTTP::Request::Common;
use LWP::UserAgent;
use Cache::FileCache;

use vars qw(%GOT $BUFFER %MAPPING $CACHE);

use constant CACHE_LOCATION => '/usr/tmp/dbfetch_cache';
use constant MAX_SIZE   => 100_000_000;  # 100 megs, roughly
use constant CACHE_DEPTH => 4;
use constant EXPIRATION => "1 week";
use constant PURGE      => "1 hour";

lib/Bio/DB/EntrezGene.pm  view on Meta::CPAN

 Returns : A Bio::Seq object
 Args    : Gene id
 Throws  : "id does not exist" exception

=head1 Routines implemented by Bio::DB::NCBIHelper

=head2 get_request

 Title   : get_request
 Usage   : my $url = $self->get_request
 Function: HTTP::Request
 Returns : 
 Args    : %qualifiers = a hash of qualifiers (ids, format, etc)

=head2 get_Stream_by_id

  Title   : get_Stream_by_id
  Usage   : $stream = $db->get_Stream_by_id( [$gid1, $gid2] );
  Function: Gets a series of Seq objects using Gene ids
  Returns : A Bio::SeqIO stream object
  Args    : A reference to an array of Gene ids

lib/Bio/DB/GenBank.pm  view on Meta::CPAN

  Args    : $ref : either an array reference, a filename, or a filehandle
            from which to get the list of unique ids/accession numbers.

NOTE: This method is redundant and deprecated.  Use get_Stream_by_id()
instead.

=head2 get_request

 Title   : get_request
 Usage   : my $url = $self->get_request
 Function: HTTP::Request
 Returns :
 Args    : %qualifiers = a hash of qualifiers (ids, format, etc)

=cut

=head2 default_format

 Title   : default_format
 Usage   : my $format = $self->default_format
 Function: Returns default sequence format for this module

lib/Bio/DB/GenPept.pm  view on Meta::CPAN

  Function: Gets a Seq objects by accession number
  Returns : Bio::Seq object
  Args    : accession number to retrieve by

=head1 Routines implemented by Bio::DB::NCBIHelper

=head2 get_request

 Title   : get_request
 Usage   : my $url = $self->get_request
 Function: HTTP::Request
 Returns :
 Args    : %qualifiers = a hash of qualifiers (ids, format, etc)

=head2 get_Stream_by_id

  Title   : get_Stream_by_id
  Usage   : $stream = $db->get_Stream_by_id( [$uid1, $uid2] );
  Function: Gets a series of Seq objects by unique identifiers
  Returns : a Bio::SeqIO stream object
  Args    : $ref : a reference to an array of unique identifiers for

lib/Bio/DB/NCBIHelper.pm  view on Meta::CPAN


=cut

# Let the code begin...

package Bio::DB::NCBIHelper;
$Bio::DB::NCBIHelper::VERSION = '1.7.8';
use strict;

use Bio::DB::Query::GenBank;
use HTTP::Request::Common;
use URI;
use Bio::Root::IO;
# use Bio::DB::RefSeq;
use URI::Escape qw(uri_unescape);

use base qw(Bio::DB::WebDBSeqI Bio::Root::Root);

our $HOSTBASE = 'https://eutils.ncbi.nlm.nih.gov';
our $MAX_ENTRIES = 19000;
our $REQUEST_DELAY = 4;

lib/Bio/DB/NCBIHelper.pm  view on Meta::CPAN

=cut

sub default_format {
    return $DEFAULTFORMAT;
}

=head2 get_request

 Title   : get_request
 Usage   : my $url = $self->get_request
 Function: HTTP::Request
 Returns :
 Args    : %qualifiers = a hash of qualifiers (ids, format, etc)

=cut

sub get_request {
    my ( $self, @qualifiers ) = @_;
    my ( $mode, $uids, $format, $query, $seq_start, $seq_stop, $strand,
        $complexity, $email)
        = $self->_rearrange(



( run in 0.508 second using v1.01-cache-2.11-cpan-de7293f3b23 )