1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: gerp.t,v 1.15 2007/06/27 10:16:38 sendu Exp $
10 test_begin(-tests => 33);
12 use_ok('Bio::Tools::Phylo::Gerp');
15 ok my $parser = Bio::Tools::Phylo::Gerp->new(-file => test_input_file('ENr111.mfa.example.elems'));
18 my @expected = ([qw(334180 334352 449 1.03744e-165)],
19 [qw(337735 337915 458.2 5.02405e-164)],
20 [qw(262604 262861 473.1 3.64789e-117)],
21 [qw(285427 285608 386.1 8.42494e-113)],
22 [qw(309563 309744 383.6 2.88895e-111)]);
23 while (my $feat = $parser->next_result) {
25 my @exp = @{shift(@expected)};
27 isa_ok $feat, 'Bio::SeqFeature::Annotated';
28 is $feat->source->value, 'GERP', 'correct source';
29 is $feat->start, shift(@exp), 'feature start correct';
30 is $feat->end, shift(@exp), 'feature end correct';
31 is $feat->score, shift(@exp), 'feature score correct';
32 my ($p_value) = $feat->get_Annotations('pvalue');
33 is ref $p_value ? $p_value->value : $p_value, shift(@exp), 'feature pvalue correct';
36 is $count, 5, "correct number of results parsed out";