BioPerl

 view release on metacpan or  search on metacpan

Bio/DB/BioFetch.pm  view on Meta::CPAN

#
# Copyright Lincoln Stein
#
# You may distribute this module under the same terms as perl itself
#
# POD documentation - main docs before the code
#

package Bio::DB::BioFetch;
use strict;
use HTTP::Request::Common 'POST';

=head1 NAME

Bio::DB::BioFetch - Database object interface to BioFetch retrieval

=head1 SYNOPSIS

 use Bio::DB::BioFetch;

 $bf = Bio::DB::BioFetch->new();

Bio/DB/BioFetch.pm  view on Meta::CPAN

=cut

*get_Stream_by_batch = \&Bio::DB::WebDBSeqI::get_Stream_by_id;

=head1 The remainder of these methods are for internal use

=head2 get_request

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

=cut


sub get_request {
    my ($self, @qualifiers) = @_;
    my ($uids, $format) = $self->_rearrange([qw(UIDS FORMAT)],
					    @qualifiers);

Bio/DB/CUTG.pm  view on Meta::CPAN

        my $key = shift;
        $key =~ s/^-//;
        $self->$key(shift);
    }
    $self->url($URL);

    ###1st of all search DB to check species exists and is unique
    my $nameparts = join "+", $self->sp =~ /(\S+)/g;
    my $search_url =
      $self->url . "/codon/cgi-bin/spsearch.cgi?species=" . $nameparts . "&c=s";
    my $rq = HTTP::Request->new( GET => $search_url );
    my $reply = $self->request($rq);
    if ( $reply->is_error ) {
        $self->throw(
            $reply->as_string() . "\nError getting for url $search_url!\n" );
    }
    my $content = $reply->content;
    return 0 unless $content;
    $self->debug(" reply from query is \n  $content");
    #####  if no matches, assign defaults - or can throw here?  ######
    if ( $content =~ /not found/i ) {

Bio/DB/CUTG.pm  view on Meta::CPAN

    $nameparts = $self->sp;

    my $CT_url =
        $self->url
      . "/codon/cgi-bin/showcodon.cgi?species="
      . $nameparts . "&aa="
      . $self->gc
      . "&style=GCG";
    $self->debug("URL : $CT_url\n");
    ## retrieve data in html##
    my $rq2 = HTTP::Request->new( GET => $CT_url );
    $reply = $self->request($rq2);
    if ( $reply->is_error ) {
        $self->throw(
            $reply->as_string() . "\nError getting for url $CT_url!\n" );
    }
    my $content2 = $reply->content;

    ## strip html tags, basic but works here
    $content2 =~ s/<[^>]+>//sg;
    $content2 =~ s/Format.*//sg;

Bio/DB/DBFetch.pm  view on Meta::CPAN

=cut

# Let the code begin...

package Bio::DB::DBFetch;
use strict;
use vars qw($MODVERSION $DEFAULTFORMAT $DEFAULTLOCATION
	         $DEFAULTSERVERTYPE);

$MODVERSION = '0.1';
use HTTP::Request::Common;

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

# the new way to make modules a little more lightweight

BEGIN { 	
    # global vars
    $DEFAULTSERVERTYPE = 'dbfetch';
    $DEFAULTLOCATION = 'ebi';
}


=head1 Routines from Bio::DB::WebDBSeqI

=head2 get_request

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

=cut

sub get_request {
	my ($self, @qualifiers) = @_;
	my ($uids, $format) = $self->_rearrange([qw(UIDS FORMAT)],
														 @qualifiers);

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

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

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

Bio/DB/GenericWebAgent.pm  view on Meta::CPAN

	if( defined $ua && $ua->isa("LWP::UserAgent") ) {
		$self->{'_ua'} = $ua;
	}
	return $self->{'_ua'};
}

=head2 get_Response

 Title   : get_Response
 Usage   : $agent->get_Response;
 Function: Get the HTTP::Response object by passing it an HTTP::Request (generated from
           Bio::ParameterBaseI implementation).
 Returns : HTTP::Response object or data if callback is used
 Args    : (optional)

           -cache_response - flag to cache HTTP::Response object;
                             Default is 1 (TRUE, caching ON)

           These are passed on to LWP::UserAgent::request() if stipulated

           -cb     - use a LWP::UserAgent-compliant callback

Bio/DB/HIV.pm  view on Meta::CPAN



package Bio::DB::HIV;
use strict;
use warnings;
use vars qw( $LANL_BASE $LANL_MAP_DB $LANL_MAKE_SEARCH_IF $LANL_SEARCH );

# Object preamble - inherits from Bio::DB::WebDBSeqI

use Bio::Root::Root;
use HTTP::Request::Common;
use Bio::DB::HIV::HIVAnnotProcessor;

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


BEGIN {
    # base change of 01/14/09
    $LANL_BASE = "http://www.hiv.lanl.gov/components/sequence/HIV/asearch";
    $LANL_MAP_DB = "map_db.comp";
    $LANL_MAKE_SEARCH_IF = "make_search_if.comp";

Bio/DB/HIV.pm  view on Meta::CPAN


  return $self;
}

=head1 WebDBSeqI compliance

=head2 get_request

 Title   : get_request
 Usage   : my $url = $self->get_request
 Function: returns a HTTP::Request object
 Returns :
 Args    : %qualifiers = a hash of qualifiers with keys in
            (-ids, -format, -mode, -query)
 Note    : Several layers of requests are performed to get to the sequence;
           see Bio::DB::Query::HIVQuery.

=cut

sub get_request {
    my $self = shift;

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

preceded with a _

=cut

# Let the code begin...

package Bio::DB::NCBIHelper;
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 = 3;

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 )
        = $self->_rearrange(

Bio/DB/Query/WebQuery.pm  view on Meta::CPAN

preceded with a _

=cut

# Let the code begin...

package Bio::DB::Query::WebQuery;
use strict;
use URI;
use LWP::UserAgent;
use HTTP::Request::Common;

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

=head2 new

 Title   : new
 Usage   : $db = Bio::DB::WebQuery->new(@args)
 Function: create new query object
 Returns : new query object
 Args    : -db       database (e.g. 'protein')

Bio/DB/Query/WebQuery.pm  view on Meta::CPAN

  my $self = shift;
  my $d = $self->{'_truncated'};
  $self->{'_truncated'} = shift if @_;
  $d;
}

=head2 _get_request

 Title   : _get_request
 Usage   : $http_request = $db->_get_request(@params)
 Function: create an HTTP::Request with indicated parameters
 Returns : HTTP::Request object
 Args    : CGI parameter list

=cut

sub _get_request {
  my $self   = shift;
  my ($method,$base,@params) = $self->_request_parameters;
  my $uri = URI->new($base);
  my $request;
  if ($method eq 'get') {

Bio/DB/SwissProt.pm  view on Meta::CPAN

The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _

=cut

# Let the code begin...

package Bio::DB::SwissProt;
use strict;

use HTTP::Request::Common;
our $MODVERSION = '0.8.1';

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

# global vars
our $DEFAULTSERVERTYPE = 'ebi';
our $DEFAULTFORMAT = 'swissprot';
# our $DEFAULTIDTRACKER = 'http://www.expasy.ch';

# you can add your own here theoretically.

Bio/DB/SwissProt.pm  view on Meta::CPAN

};

=head2 Implemented Routines from Bio::DB::WebDBSeqI interface

=cut

=head2 get_request

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

=cut

sub get_request {
    my ($self, @qualifiers) = @_;
    my ($uids, $format) = $self->_rearrange([qw(UIDS FORMAT)],
					    @qualifiers);

Bio/DB/SwissProt.pm  view on Meta::CPAN

		 ( 'format' => $f )
		 );

    my $url = $self->location_url;

    my $uid;
    my $jointype = $HOSTS{$self->servertype}->{'jointype'} || ' ';
    my $idvar = $HOSTS{$self->servertype}->{'idvar'} || 'id';

    if( ref($uids) =~ /ARRAY/i ) {
	# HTTP::Request automagically converts the ' ' to %20
	$uid = join($jointype, @$uids);
    } else {
	$uid = $uids;
    }
    $vars{$idvar} = $uid;

    return POST $url, \%vars;
}

=head2 postprocess_data

Bio/DB/WebDBSeqI.pm  view on Meta::CPAN

   my $seq = $db->get_Seq_by_id('ROA1_HUMAN')

=head1 DESCRIPTION

Provides core set of functionality for connecting to a web based
database for retrieving sequences.

Users wishing to add another Web Based Sequence Dabatase will need to
extend this class (see L<Bio::DB::SwissProt> or L<Bio::DB::NCBIHelper> for
examples) and implement the get_request method which returns a
HTTP::Request for the specified uids (accessions, ids, etc depending
on what query types the database accepts).

=head1 FEEDBACK

=head2 Mailing Lists

User feedback is an integral part of the
evolution of this and other Bioperl modules. Send
your comments and suggestions preferably to one
of the Bioperl mailing lists. Your participation

Bio/DB/WebDBSeqI.pm  view on Meta::CPAN


package Bio::DB::WebDBSeqI;
use strict;
use vars qw($MODVERSION %RETRIEVAL_TYPES $DEFAULT_RETRIEVAL_TYPE
	    $DEFAULTFORMAT $LAST_INVOCATION_TIME @ATTRIBUTES);

use Bio::SeqIO;
use Bio::Root::IO;
use LWP::UserAgent;
use POSIX 'setsid';
use HTTP::Request::Common;
use HTTP::Response;
use File::Spec;
use IO::Pipe;
use IO::String;
use Bio::Root::Root;

use base qw(Bio::DB::RandomAccessI);

BEGIN {
	$MODVERSION = '0.8';

Bio/DB/WebDBSeqI.pm  view on Meta::CPAN

   $self->throw("accession.version does not exist") unless @seqs;
   if( wantarray ) { return @seqs } else { return shift @seqs }
}

# implementing class must define these

=head2 get_request

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

=cut

sub get_request {
    my ($self) = @_;
    my $msg = "Implementing class must define method get_request in class WebDBSeqI";
    $self->throw($msg);
}

Bio/LiveSeq/IO/BioPerl.pm  view on Meta::CPAN


A filename (or an ID that will fetch entry through the web) has to be passed
to this package which will return references to all translation objects
created from the EMBL entry. References to Transcription, DNA and Exon
objects can all be retrieved departing from these.

Alternatively, a specific "gene" name can be specified, together with
the embl-acc ID. This will create a LiveSeq::Gene object with all
relevant gene features attached/created.

ATTENTION: if web fetching is requested, the package HTTP::Request needs
to be installed.


=head1 AUTHOR - Joseph A.L. Insana

Email:  Insana@ebi.ac.uk, jinsana@gmx.net

=head1 APPENDIX

The rest of the documentation details each of the object

Bio/LiveSeq/IO/BioPerl.pm  view on Meta::CPAN

# why array from each_tag_value($qual) ? When will there be more than one
#                                        element in such array?
# what is the annotation object? ($seqobj->annotation)
# unsatisfied by both BioPerl binomial and SRS "org" to retrieve Organism info

use strict;
use Carp qw(cluck croak carp);
use vars qw($DBEMBLLOADED);
use Bio::SeqIO; # for -file entry loading

# Note, the following requires HTTP::Request. If the modules are not installed
# uncomment the following and use only -filename and don't request swissprotinfo
eval { 
    require Bio::DB::EMBL; # for -id entry loading
    $DBEMBLLOADED = 1;
};


use base qw(Bio::LiveSeq::IO::Loader);

# This package can in the future host other databases loading subroutines.

Bio/LiveSeq/IO/BioPerl.pm  view on Meta::CPAN

    if (defined($filename)) {
      my $stream = Bio::SeqIO->new('-file' => $filename, '-format' => 'EMBL');
      $seqobj = $stream->next_seq();
    } else { # i.e. if -id
	
	if( $DBEMBLLOADED ) {
	    my $embl = Bio::DB::EMBL->new();
	    $seqobj = $embl->get_Seq_by_id($id); # EMBL ID or ACC
	} else { 
	    my $root = Bio::Root::Root->new();
	    $root->warn("Must have HTTP::Request::Common installed, cannot run load without the -filename option specified, see docs for Bio::LiveSeq::IO::BioPerl");
	    return;
	}
    }

    $hashref=&embl2hash($seqobj,\@embl_valid_feature_names,\@embl_valid_qual_names);
  }
  unless ($hashref) { return (0); }

  %loader = (db => $db, filename => $filename, id => $id, hash => $hashref);
  $obj = \%loader;

Bio/Perl.pm  view on Meta::CPAN


my $genbank_db = undef;
my $genpept_db = undef;
my $embl_db = undef;
my $swiss_db = undef;
my $refseq_db = undef;

sub get_sequence{
    my ($db_type,$identifier) = @_;
    if( ! $DBOKAY ) {
        confess ("Your system does not have one of LWP, HTTP::Request::Common, IO::String\n".
                 "installed so the DB retrieval method is not available.\n".
                 "Full error message is:\n $!\n");
        return;
    }
    $db_type = lc($db_type);

    my $db;

    if( $db_type =~ /genbank/ ) {
        if( !defined $genbank_db ) {

Bio/Tools/Analysis/DNA/ESEfinder.pm  view on Meta::CPAN



# Let the code begin...
#should have own 

package Bio::Tools::Analysis::DNA::ESEfinder;

use Data::Dumper;
use IO::String;
use Bio::SeqIO;
use HTTP::Request::Common qw (POST);
use HTML::HeadParser;
use Bio::SeqFeature::Generic;
use Bio::Seq::Meta::Array;
use Bio::WebAgent;
use strict;

#inherits directly from SimpleAnalysisBase
use base qw(Bio::Tools::Analysis::SimpleAnalysisBase);


Bio/Tools/Analysis/Protein/Domcut.pm  view on Meta::CPAN

methods. Internal methods are usually preceded with a _


=cut


use strict;
package Bio::Tools::Analysis::Protein::Domcut;
use IO::String;
use Bio::SeqIO;
use HTTP::Request::Common qw(GET);
use Bio::SeqFeature::Generic;
use Bio::Seq::Meta::Array;

use base qw(Bio::Tools::Analysis::SimpleAnalysisBase);

my $URL = 'http://www.Bork.EMBL-Heidelberg.DE/Docu/mikita/domplot.cgi?';
my $ANALYSIS_NAME = 'Domcut';
my $ANALYSIS_SPEC =
    {
     'name'        => 'Domcut',

Bio/Tools/Analysis/Protein/ELM.pm  view on Meta::CPAN

The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _

=cut

use strict;
package Bio::Tools::Analysis::Protein::ELM;
use vars qw(%cc);
use HTML::HeadParser;
use Bio::SeqFeature::Generic;
use HTTP::Request::Common qw(POST);
use IO::String;
use base qw(Bio::Tools::Analysis::SimpleAnalysisBase);

## valid cell compartments ##
%cc = (
      all            => 1,
      nucleus        => 'GO:0005634',
      extracellular  => 'GO:0005576',
      cytoplasm      => 'GO:0005737',
      peroxisome     => 'GO:0005777',

Bio/Tools/Analysis/Protein/ELM.pm  view on Meta::CPAN

	$self->warn(ref($self)." Request Error:\n".$r1->as_string);
	return;
    }

    my $text = $r1->content;
    my ($url) = $text =~ /URL=\S+(fun=\S+r=\d)/s;
    #$url =~ s/amp;//g ;
    my ($resp2);
    $url = $URL . "?" .$url;
    while (1) {
	my $req2 = HTTP::Request->new(GET=>$url);
	my $r2 = $self->request ($req2);
	if ( $r2->is_error ) {
	    $self->warn(ref($self)." Request Error:\n".$r2->as_string);
	    return;
	}
	$resp2 = $r2->content();

	if ($resp2 !~ /patient/s) {
	    $self->status('COMPLETED');
	    $resp2=~ s/<[^>]+>/ /sg;

Bio/Tools/Analysis/Protein/GOR4.pm  view on Meta::CPAN

methods. Internal methods are usually preceded with a _

=cut

use strict;

package Bio::Tools::Analysis::Protein::GOR4;

use IO::String;
use Bio::SeqIO;
use HTTP::Request::Common qw(POST);
use Bio::SeqFeature::Generic;
use Bio::Seq::Meta::Array;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

use base qw(Bio::Tools::Analysis::SimpleAnalysisBase);

use constant MIN_STRUC_LEN => 3;
my $URL = 'https://npsa-prabi.ibcp.fr/cgi-bin/secpred_sopma.pl';
my $ANALYSIS_NAME = 'GOR4';
my $ANALYSIS_SPEC = {name => 'Gor4', type => 'Protein'};

Bio/Tools/Analysis/Protein/GOR4.pm  view on Meta::CPAN

                         notice => $self->seq->seq,
                         ali_width => 70,
                        ];

    my $content = $self->request($request);
    my $text = $content->content;
    return unless $text;
    my ($next) = $text =~ /Prediction.*?=(.*?)>/;
    return unless $next;
    my $out = 'http://npsa-pbil.ibcp.fr/'.$next;
    my $req2 = HTTP::Request->new(GET=>$out);
    my $resp2 = $self->request($req2);
    $self->status('COMPLETED') if $resp2 ne '';
    $self->{'_result'} = $resp2->content;
}


1;

Bio/Tools/Analysis/Protein/HNN.pm  view on Meta::CPAN


=cut


use strict;

package Bio::Tools::Analysis::Protein::HNN;

use IO::String;
use Bio::SeqIO;
use HTTP::Request::Common qw (POST);
use Bio::SeqFeature::Generic;
use Bio::Seq::Meta::Array;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

use base qw(Bio::Tools::Analysis::SimpleAnalysisBase);

#extends array for 2struc.

my $URL = 'http://npsa-pbil.ibcp.fr/cgi-bin/secpred_hnn.pl';
my $ANALYSIS_NAME= 'HNN';

Bio/Tools/Analysis/Protein/HNN.pm  view on Meta::CPAN

			 title => "",
                         notice => $self->seq->seq,
                         ali_width => 70,
                        ];

    my $text = $self->request($request)->content;
    return unless $text;
    my ($next) = $text =~ /Prediction.*?=(.*?)>/;
    return unless $next;
    my $out = "http://npsa-pbil.ibcp.fr/".$next;
    my $req2 = HTTP::Request->new(GET=>$out);
    my $resp2 = $self->request ($req2);
	$self->status('COMPLETED') if $resp2 ne '';
    $self->{'_result'} = $resp2->content;
	return $self;
}


=head2 result

 NAme    : result

Bio/Tools/Analysis/Protein/NetPhos.pm  view on Meta::CPAN



# Let the code begin...


package Bio::Tools::Analysis::Protein::NetPhos;
use vars qw($FLOAT);
use strict;
use IO::String;
use Bio::SeqIO;
use HTTP::Request::Common qw (POST);
use Bio::SeqFeature::Generic;

use base qw(Bio::Tools::Analysis::SimpleAnalysisBase);

    $FLOAT = '[+-]?\d*\.\d*';
    my $URL = 'http://www.cbs.dtu.dk/cgi-bin/nph-webface';


    my $ANALYSIS_SPEC =
        {

Bio/Tools/Analysis/Protein/Scansite.pm  view on Meta::CPAN



# Let the code begin...


package Bio::Tools::Analysis::Protein::Scansite;
use vars qw($FLOAT @STRINGENCY);
use strict;
use IO::String;
use Bio::SeqIO;
use HTTP::Request::Common qw(POST);
use Bio::SeqFeature::Generic;

use base qw(Bio::Tools::Analysis::SimpleAnalysisBase);

$FLOAT = '[+-]?\d*\.\d*';
@STRINGENCY = qw(High Medium Low);
my $URL = 'http://scansite.mit.edu/cgi-bin/motifscan_seq';


    my $ANALYSIS_SPEC =

Bio/Tools/Analysis/Protein/Sopma.pm  view on Meta::CPAN

=head1 APPENDIX

=cut

use strict;

package Bio::Tools::Analysis::Protein::Sopma;

use IO::String;
use Bio::SeqIO;
use HTTP::Request::Common qw (POST);
use Bio::SeqFeature::Generic;
use Bio::Seq::Meta::Array;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

use base qw(Bio::Tools::Analysis::SimpleAnalysisBase);

#extends array for 2struc.
my $URL = 'https://npsa-prabi.ibcp.fr/cgi-bin/secpred_sopma.pl';
my $ANALYSIS_NAME= 'Sopma';
my $ANALYSIS_SPEC= {name => 'Sopma', type => 'Protein'};

Bio/Tools/Analysis/Protein/Sopma.pm  view on Meta::CPAN

                         width     => $self->window_width,
                        ];

    my $text = $self->request($request)->content;
    return $self unless $text;

    #### get text only version of results ## 
    my ($next) = $text =~ /Prediction.*?=(.*?)>/;
    return $self unless $next;
    my $out    = "http://npsa-pbil.ibcp.fr/". "$next";
    my $req2   = HTTP::Request->new(GET=>$out);
    my $resp2  = $self->request ($req2);
    $self->{'_result'} = $resp2->content;
    $self->status('COMPLETED') if $resp2 ne '';
    return $self;
}

sub _add_params_to_result{
	## called when making Seqfeature objects
	my ($self, $tag_hash) = @_;
	my $hash;

Bio/Tools/Run/RemoteBlast.pm  view on Meta::CPAN


package Bio::Tools::Run::RemoteBlast;

use strict;
use warnings;

use Bio::SeqIO;
use IO::String;
use Bio::SearchIO;
use LWP;
use HTTP::Request::Common;
use Bio::Root::Version;

use constant {
    NOT_FINISHED => 0,
    ERR_QBSTATUS => 1,
    ERR_NOCONTENT => 2, 
    ERR_HTTPFAIL => 4,
    ERR_QBNONSPEC => 8
};
   

Bio/Tools/Run/RemoteBlast.pm  view on Meta::CPAN

 Args    : Remote Blast ID (RID)

=cut

sub retrieve_blast {
    my($self, $rid) = @_;
    my $url_base = $self->get_url_base;
    my %hdr = %RETRIEVALHEADER;
    $hdr{'RID'} = $rid;
    
    my $req = HTTP::Request->new(
            GET => $url_base."?CMD=Get&FORMAT_OBJECT=SearchInfo&RID=$rid",
            );
    #$self->debug("SearchInfo request is " . $req->as_string());
    my $response = $self->ua->request($req);
    if( $response->is_success ) {
        my $status;
        if($response->content =~ /Status=(WAITING|ERROR|FAILED|UNKNOWN|READY)/i ) {
            $status = $1;
            if( $status eq 'ERROR' ) {
                $self->warn("Server Error");

Build.PL  view on Meta::CPAN

        [ 0, 'Remote analysis POST submissions/Bio::SearchIO::blastxml' ],

    'HTML::HeadParser' => [
        3,
        'Parsing <HEAD> section of HTML docs/Bio::Tools::Analysis::DNA::ESEfinder'
    ],

    'HTML::TableExtract' =>
        [ 0, 'Parsing HTML tables/Bio::DB::SeqVersion::gi' ],

    'HTTP::Request::Common' => [
        0,
        'GenBank+GenPept sequence retrieval, remote http Blast jobs'
            . '/Bio::DB::*,Bio::Tools::Run::RemoteBlast,'
            . 'Bio::Tools::Analysis::Protein*,Bio::Tools::Analysis::DNA*'
    ],

    'Inline::C' => [ 0.67, 'Speeding up code like Fasta Bio::DB::Fasta' ],

    'IO::Scalar' => [
        0, 'Deal with non-seekable filehandles/Bio::Tools::GuessSeqFormat'

DEPENDENCIES  view on Meta::CPAN

|---------------------------+--------------------------------------+-----------|
| HTML-TableExtract         | * HTML::TableExtract - NA            |   None    |
|==============================================================================|
| Used by:                                                                     |
|------------------------------------------------------------------------------|
| * Bio::DB::SeqVersion::gi - HTML::TableExtract                               |
 ==============================================================================
 ==============================================================================
| Distribution              | Module used - Description            | Min. ver. |
|---------------------------+--------------------------------------+-----------|
| HTTP-Message              | * HTTP::Request::Common - NA         |   None    |
|                           | * HTTP::Response - NA                |           |
|==============================================================================|
| Used by:                                                                     |
|------------------------------------------------------------------------------|
| * Bio::DB::DBFetch - HTTP::Request::Common                                   |
| * Bio::DB::HIV - HTTP::Request::Common                                       |
| * Bio::DB::NCBIHelper - HTTP::Request::Common                                |
| * Bio::DB::SwissProt - HTTP::Request::Common                                 |
| * Bio::DB::WebDBSeqI - HTTP::Request::Common                                 |
| * Bio::DB::Query::WebQuery - HTTP::Request::Common                           |
| * Bio::Tools::Run::RemoteBlast - HTTP::Request::Common                       |
| * Bio::DB::WebDBSeqI - HTTP::Response                                        |
 ==============================================================================
 ==============================================================================
| Distribution              | Module used - Description            | Min. ver. |
|---------------------------+--------------------------------------+-----------|
| IO-Compress               | * Compress::Zlib - NA                |   None    |
|                           | * IO::Uncompress::Gunzip - NA        |           |
|==============================================================================|
| Used by:                                                                     |
|------------------------------------------------------------------------------|

META.json  view on Meta::CPAN

            "Clone" : "0",
            "Convert::Binary::C" : "0",
            "DB_File" : "0",
            "Error" : "0",
            "GD" : "0",
            "Graph" : "0.5",
            "GraphViz" : "0",
            "HTML::Entities" : "0",
            "HTML::HeadParser" : "3",
            "HTML::TableExtract" : "0",
            "HTTP::Request::Common" : "0",
            "IO::Scalar" : "0",
            "Inline::C" : "0.67",
            "LWP::UserAgent" : "0",
            "List::MoreUtils" : "0",
            "PostScript::TextBlock" : "0",
            "SVG" : "2.26",
            "SVG::Graph" : "0.01",
            "Set::Scalar" : "0",
            "Sort::Naturally" : "0",
            "Spreadsheet::ParseExcel" : "0",

META.yml  view on Meta::CPAN

  Clone: '0'
  Convert::Binary::C: '0'
  DB_File: '0'
  Error: '0'
  GD: '0'
  Graph: '0.5'
  GraphViz: '0'
  HTML::Entities: '0'
  HTML::HeadParser: '3'
  HTML::TableExtract: '0'
  HTTP::Request::Common: '0'
  IO::Scalar: '0'
  Inline::C: '0.67'
  LWP::UserAgent: '0'
  List::MoreUtils: '0'
  PostScript::TextBlock: '0'
  SVG: '2.26'
  SVG::Graph: '0.01'
  Set::Scalar: '0'
  Sort::Naturally: '0'
  Spreadsheet::ParseExcel: '0'

scripts/Bio-DB-GFF/bp_genbank2gff3.pl  view on Meta::CPAN

$source_type ||= "region"; # should really parse from FT.source contents below

#my $FTSOmap = $tm->FT_SO_map();
my $FTSOmap;
my $FTSOsynonyms;

if (defined($SO_FILE) && $SO_FILE eq 'live') {
    print "\nDownloading the latest SO file from ".SO_URL."\n\n";
    use LWP::UserAgent;
    my $ua = LWP::UserAgent->new(timeout => 30);
    my $request = HTTP::Request->new(GET => SO_URL);
    my $response = $ua->request($request);


    if ($response->status_line =~ /200/) {
        use File::Temp qw/ tempfile /;
        my ($fh, $fn) = tempfile();
        print $fh $response->content;
        $SO_FILE = $fn;
    } else {
        print "Couldn't download SO file online...skipping validation.\n" 

scripts/DB/bp_biofetch_genbank_proxy.pl  view on Meta::CPAN

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

t/LocalDB/Registry.t  view on Meta::CPAN

					 -format     => 'fasta',
					 -index      => 'bdb',
					 -write_flag => 1 );
		ok defined($bdb);
		$entries = $bdb->build_index(test_input_file('cysprot.fa'));
		is $entries, 7;
	}
	
	SKIP: {
		test_skip(-tests => 9,
                  -requires_modules => [qw(LWP::UserAgent HTTP::Request::Common)],
                  -requires_networking => 1);
		
		my $registry = Bio::DB::Registry->new();
		ok defined($registry);
		my @available_services = $registry->services;
		
		ok grep /testflat/,@available_services;
		my $db = $registry->get_database('testflat');
		ok defined($db);
		my $seq = $db->get_Seq_by_id("ALEU_HORVU");



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