maint: remove Travis stuff which has been replaced with Github actions (#325)
[bioperl-live.git] / t / SearchIO / cross_match.t
blob10ebf0f93b306c977bf59cc9a0a12ba69f861272
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: SearchIO_cross_match.t 11788 2007-12-03 23:37:59Z jason $
4 use strict;
6 BEGIN {
7     use Bio::Root::Test;
8     
9     test_begin(-tests => 15);
10         
11         use_ok('Bio::SearchIO');
14 my ($searchio, $result,$iter,$hit,$hsp);
16 # The cross_match SearchIO parser is not event-based; it directly adds
17 # information to the relevant Bio::Search objects as the report is parsed.
18 # The parser currently misses much information present in the report. Also,
19 # methods expected to work somehow don't (hsp->length('hsp'), for instance).
20 # Unsure if this parses non-alignment-based cross-match reports accurately
21 # (see bioperl-live/t/data/consed_project/edit_dir/test_project.screen.out for
22 # an example).
24 # Note lots of ResultI/HitI/HSPI methods not tested yet!
26 $searchio = Bio::SearchIO->new('-format' => 'cross_match',
27                                   '-file'   => test_input_file('testdata.crossmatch'));
29 $result = $searchio->next_result;
31 is($result->algorithm, 'cross_match');
32 is($result->algorithm_version, '0.990329');
34 my @valid = ( [ 'msx1_ens2', 0]);
35 my $count = 0;
36 while( $hit = $result->next_hit ) {
37     my $d = shift @valid;
39     is($hit->name, shift @$d);
40     is($hit->length, shift @$d);
42     if( $count == 0 ) {
43         my $hsps_left = 1;
44         while( my $hsp = $hit->next_hsp ) {
45             is($hsp->query->start, 19);
46             is($hsp->query->end, 603);
47             is($hsp->hit->start, 2824);
48             is($hsp->hit->end, 3409);
49             #is($hsp->length('hsp'), 820);  # shouldn't this work?
50             is($hsp->start('hit'), $hsp->hit->start);
51             is($hsp->end('query'), $hsp->query->end);
52             is($hsp->strand('sbjct'), $hsp->subject->strand);# alias for hit
53             is($hsp->gaps, 0);
54             $hsps_left--;
55         }
56         is($hsps_left, 0);
57     }
58     last if( $count++ > @valid );
61 is(@valid, 0);