1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: SearchIO_cross_match.t 11788 2007-12-03 23:37:59Z jason $
9 test_begin(-tests => 15);
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
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]);
36 while( $hit = $result->next_hit ) {
39 is($hit->name, shift @$d);
40 is($hit->length, shift @$d);
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
58 last if( $count++ > @valid );