Bio-DB-SwissProt

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Test::EOL" : "0",
            "Test::Mojibake" : "0",
            "Test::More" : "0.88",
            "Test::Pod" : "1.41",
            "Test::Pod::Coverage" : "1.08"
         }
      },
      "runtime" : {
         "requires" : {
            "Bio::DB::WebDBSeqI" : "0",
            "HTTP::Request::Common" : "0",
            "base" : "0",
            "strict" : "0"
         }
      },
      "test" : {
         "requires" : {
            "File::Spec" : "0",
            "IO::Handle" : "0",
            "IPC::Open3" : "0",
            "Test::More" : "0",

META.yml  view on Meta::CPAN

  ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Bio-DB-SwissProt
requires:
  Bio::DB::WebDBSeqI: '0'
  HTTP::Request::Common: '0'
  base: '0'
  strict: '0'
resources:
  bugtracker: https://github.com/bioperl/bio-db-swissprot/issues
  homepage: https://metacpan.org/release/Bio-DB-SwissProt
  repository: git://github.com/bioperl/bio-db-swissprot.git
version: 1.7.4
x_Dist_Zilla:
  perl:
    version: '5.028001'

Makefile.PL  view on Meta::CPAN

  "AUTHOR" => "Jason Stajich <jason\@bioperl.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "Bio-DB-SwissProt",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.006",
  "NAME" => "Bio::DB::SwissProt",
  "PREREQ_PM" => {
    "Bio::DB::WebDBSeqI" => 0,
    "HTTP::Request::Common" => 0,
    "base" => 0,
    "strict" => 0
  },
  "TEST_REQUIRES" => {
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,
    "Test::More" => 0,
    "Test::Needs" => 0,
    "Test::RequiresInternet" => 0,

Makefile.PL  view on Meta::CPAN

  "VERSION" => "1.7.4",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Bio::DB::WebDBSeqI" => 0,
  "File::Spec" => 0,
  "HTTP::Request::Common" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "Test::More" => 0,
  "Test::Needs" => 0,
  "Test::RequiresInternet" => 0,
  "base" => 0,
  "strict" => 0,
  "utf8" => 0,
  "warnings" => 0
);

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

methods. Internal methods are usually preceded with a _

=cut

# Let the code begin...

package Bio::DB::SwissProt;
$Bio::DB::SwissProt::VERSION = '1.7.4';
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.

lib/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);

lib/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

t/SwissProt.t  view on Meta::CPAN

#!/usr/bin/env perl
use utf8;

use strict;
use warnings;

use Test::More;
use Test::Needs qw(LWP::UserAgent HTTP::Request::Common Data::Stag);
use Test::RequiresInternet;

use Bio::DB::SwissProt;

ok my $gb = Bio::DB::SwissProt->new(-retrievaltype => 'pipeline',
                                    -delay         => 0);

my %expected_lengths = (
                        'NDP_MOUSE'   => 131,
                        'NDP_HUMAN'   => 133,



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