File: SimilarityPair.t

package info (click to toggle)
bioperl 1.0-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 10,784 kB
  • ctags: 4,962
  • sloc: perl: 70,732; xml: 3,279; lisp: 107; makefile: 53
file content (44 lines) | stat: -rw-r--r-- 1,312 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
##
# CVS Version
# $Id: SimilarityPair.t,v 1.4.2.1 2002/03/10 17:26:53 jason Exp $


# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.t'

use strict;

BEGIN {     
    # to handle systems with no installed Test module
    # we include the t dir (where a copy of Test.pm is located)
    # as a fallback
    eval { require Test; };
    if( $@ ) {
	use lib 't';
    }
    use Test;

    plan tests => 5;
}
use Bio::Seq;
use Bio::SeqFeature::SimilarityPair;
use Bio::SearchIO;
use Bio::SeqIO;
use Bio::Root::IO;

# test SimilarityPair

my $seq = (new Bio::SeqIO('-format' => 'fasta',
			  '-file' => Bio::Root::IO->catfile("t","data","AAC12660.fa")))->next_seq();
ok defined( $seq) && $seq->isa('Bio::SeqI');
my $blast = new Bio::SearchIO('-file'=>Bio::Root::IO->catfile("t","data","blast.report"), '-format' => 'blast');
ok defined ($blast) && $blast->isa('Bio::SearchIO');
my $r = $blast->next_result;
my $hit = $r->next_hit;
ok defined ($hit) && $hit->isa('Bio::Search::Hit::HitI'), 1, ' hit is ' . ref($hit);
my $sim_pair = $hit->next_hsp;
ok defined($sim_pair) && $sim_pair->isa('Bio::SeqFeatureI');
$seq->add_SeqFeature($sim_pair);
ok $seq->all_SeqFeatures() == 1;