1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: SearchIO_exonerate.t 11525 2007-06-27 10:16:38Z sendu $
9 test_begin( -tests => 52 );
11 use_ok('Bio::SearchIO');
14 my ( $searchio, $result, $hit, $hsp );
16 $searchio = Bio::SearchIO->new(
17 -file => test_input_file('testdat.exonerate'),
18 -format => 'exonerate'
22 qw(ln27 416 Contig124 939
34 qw(ln74 644 Contig275 1296
50 while ( my $r = $searchio->next_result ) {
52 is( $r->query_name, shift @$d );
55 skip( 'no query length available in default output', 1 );
56 is( $r->query_length, $val );
60 is( $h->name, shift @$d );
63 skip( 'no hit length available in default output', 1 );
64 is( $h->length, $val );
66 while ( my $hsp = $h->next_hsp ) {
67 is( $hsp->query->start, shift @$d );
68 is( $hsp->query->end, shift @$d );
69 is( $hsp->query->strand, shift @$d );
71 is( $hsp->hit->start, shift @$d );
72 is( $hsp->hit->end, shift @$d );
73 is( $hsp->hit->strand, shift @$d );
81 $searchio = Bio::SearchIO->new(
82 -format => 'exonerate',
83 -file => test_input_file('exonerate.output.works'),
87 $searchio = Bio::SearchIO->new(
88 -format => 'exonerate',
89 -file => test_input_file('exonerate.output.dontwork'),
93 $searchio = Bio::SearchIO->new(
94 -format => 'exonerate',
95 -file => test_input_file('exonerate.whitespace_before_query.works'),
101 while( my $r = $searchio->next_result ) {
103 while(my $hit = $r->next_hit){
104 while(my $hsp = $hit->next_hsp){
108 ok($r->query_name, "query_name");
109 is($hsp_ct, shift @cts);
113 $searchio = Bio::SearchIO->new(
114 -format => 'exonerate',
115 -file => test_input_file('exonerate.output.negativescore.works'),
117 my $r = $searchio->next_result;
119 is( $hit->score, "-3" );