1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: cross_match.t 11788 2007-12-03 23:37:59Z jason $
10 test_begin(-tests => 15);
12 use_ok('Bio::SearchIO');
15 my ($searchio, $result,$iter,$hit,$hsp);
17 # The cross_match SearchIO parser is not event-based; it directly adds
18 # information to the relevant Bio::Search objects as the report is parsed.
19 # The parser currently misses much information present in the report. Also,
20 # methods expected to work somehow don't (hsp->length('hsp'), for instance).
21 # Unsure if this parses non-alignment-based cross-match reports accurately
22 # (see bioperl-live/t/data/consed_project/edit_dir/test_project.screen.out for
25 # Note lots of ResultI/HitI/HSPI methods not tested yet!
27 $searchio = Bio::SearchIO->new('-format' => 'cross_match',
28 '-file' => test_input_file('testdata.crossmatch'));
30 $result = $searchio->next_result;
32 is($result->algorithm, 'cross_match');
33 is($result->algorithm_version, '0.990329');
35 my @valid = ( [ 'msx1_ens2', 0]);
37 while( $hit = $result->next_hit ) {
40 is($hit->name, shift @$d);
41 is($hit->length, shift @$d);
45 while( my $hsp = $hit->next_hsp ) {
46 is($hsp->query->start, 19);
47 is($hsp->query->end, 603);
48 is($hsp->hit->start, 2824);
49 is($hsp->hit->end, 3409);
50 #is($hsp->length('hsp'), 820); # shouldn't this work?
51 is($hsp->start('hit'), $hsp->hit->start);
52 is($hsp->end('query'), $hsp->query->end);
53 is($hsp->strand('sbjct'), $hsp->subject->strand);# alias for hit
59 last if( $count++ > @valid );