1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: Match.t,v 1.15 2007/06/27 10:16:38 sendu Exp $
10 test_begin(-tests => 38,
11 -requires_module => 'URI::Escape');
13 use_ok('Bio::Tools::Match');
16 ok my $parser = Bio::Tools::Match->new(-file => test_input_file('match.output'));
19 my @expected = ([qw(4338 4349 1.000 0.945 V$MYOD_01)],
20 [qw(7390 7401 1.000 0.932 V$MYOD_01)],
21 [qw(8503 8514 1.000 0.941 V$MYOD_01)],
22 [qw(8767 8778 1.000 0.937 V$MYOD_01)],
23 [qw(33 47 0.693 0.779 V$E47_01)]);
24 while (my $feat = $parser->next_result) {
26 my @exp = @{shift(@expected)};
28 isa_ok $feat, 'Bio::SeqFeature::Annotated';
29 is $feat->source->value, 'transfac_match', 'correct source';
30 is $feat->start, shift(@exp), 'feature start correct';
31 is $feat->end, shift(@exp), 'feature end correct';
33 my $core_score = $feat->score;
34 my $matrix_score = ($feat->annotation->get_Annotations('matrix_score'))[0]->value;
35 my $matrix_id = ($feat->annotation->get_Annotations('matrix_id'))[0]->value;
37 is $core_score, shift(@exp), 'feature core score correct';
38 is $matrix_score, shift(@exp), 'feature matrix score correct';
39 is $matrix_id, shift(@exp), 'feature matrix id correct';
44 is $count, 5, "correct number of results managed to get tested";