File: Exonerate.t

package info (click to toggle)
bioperl 1.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 20,336 kB
  • ctags: 8,476
  • sloc: perl: 119,890; xml: 6,001; lisp: 121; makefile: 57
file content (84 lines) | stat: -rw-r--r-- 1,827 bytes parent folder | download | duplicates (2)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
## $Id: Exonerate.t,v 1.5 2003/03/29 20:25:02 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'

my $error;

use strict;
use lib '.';

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 vars qw($NTESTS);
    $NTESTS = 45;
    $error = 0;

    use Test;
    plan tests => $NTESTS; 
}

if( $error == 1 ) {
    exit(0);
}

use Bio::SearchIO;
use Bio::Root::IO;
use Bio::SearchIO::Writer::HitTableWriter;
use Bio::SearchIO::Writer::HTMLResultWriter;

ok(1);
my ($searchio, $result,$hit,$hsp);

$searchio = new Bio::SearchIO(-file => 
			      Bio::Root::IO->catfile(qw(t data 
							testdat.exonerate)),
			      -format => 'exonerate');
my @data = ( [qw(ln27 416 Contig124 939
		 293 416 -1 
		 1   124 1 
		 
		 107 292 -1 
		 178 363 1 
		 
		 66 106 -1
		 899 939 1
		 )],
	     [qw(ln74 644 Contig275 1296 
		 601 644 -1
		 901 944 1
		 
		 436 600 -1
		 998 1162    1

		 386 435 -1
		 1247 1296 1
		 
		 )] );

while( my $r = $searchio->next_result ) {
    my $d = shift @data;
    ok($r->query_name, shift @$d);
    skip( 'no query length available in default output',
	  $r->query_length, shift @$d);
    my $h = $r->next_hit;
    ok($h->name, shift @$d);
    skip( 'no hit length available in default output',$h->length, shift @$d);
    while( my $hsp = $h->next_hsp ) {
	ok($hsp->query->start, shift @$d);
	ok($hsp->query->end, shift @$d);
	ok($hsp->query->strand, shift @$d);
	
	ok($hsp->hit->start, shift @$d);
	ok($hsp->hit->end, shift @$d);
	ok($hsp->hit->strand, shift @$d);
    }
}