1 # This is -*-Perl-*- code
2 ## Bioperl Test Harness Script for Modules
4 # $Id: Scansite.t,v 1.1 2003/11/18
5 # Before `make install' is performed this script should be runnable with
6 # `make test'. After `make install' it should work as `perl test.t'
9 use vars qw($NUMTESTS $DEBUG $ERROR);
10 $DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
12 # to handle systems with no installed Test module
13 # we include the t dir (where a copy of Test.pm is located)
15 eval { require Test; };
23 plan tests => $NUMTESTS;
27 require LWP::UserAgent;
30 warn("IO::String or LWP::UserAgent not installed. This means that the module is not usable. Skipping tests");
37 foreach ( $Test::ntest..$NUMTESTS) {
38 skip('unable to run all of the Scansite tests',1);
41 foreach ( $Test::ntest..$NUMTESTS) {
42 skip('set env BIOPERLDEBUG to run tests over web',1);
47 exit 0 if $ERROR == 1;
51 require Bio::Tools::Analysis::Protein::Scansite;
54 require Bio::WebAgent;
59 $verbose = 1 if $DEBUG;
61 ok my $tool = Bio::WebAgent->new(-verbose =>$verbose);
64 my $seqio=new Bio::SeqIO( -verbose => $verbose,
66 -file => Bio::Root::IO->catfile('t','data', 'swiss.dat'));
68 my $seq = $seqio->next_seq();
69 ok $tool = Bio::Tools::Analysis::Protein::Scansite->new(
70 -seq=>$seq->primary_seq);
71 ok $tool->stringency('Low');
72 ok $tool->stringency(), 'Low';
73 ok $tool->protein_id(), $tool->seq->display_id();
76 exit if $tool->status eq 'TERMINATED_BY_ERROR';
77 ok my $raw = $tool->result('');
78 print $raw if $verbose;
79 ok my $parsed = $tool->result('parsed');
80 ok $parsed->[0]{'site'}, 'T101';
81 ok my @res = $tool->result('Bio::SeqFeatureI');
82 ok $res[0]->start, 101;