[Bioperl-guts-l] [14985] bioperl-live/trunk/t/hmmer.t: [bug 2632]
Christopher John Fields
cjfields at dev.open-bio.org
Tue Nov 11 14:21:45 EST 2008
Revision: 14985
Author: cjfields
Date: 2008-11-11 14:21:45 -0500 (Tue, 11 Nov 2008)
Log Message:
-----------
[bug 2632]
* added tests for plain ol' hmmer parsing
Modified Paths:
--------------
bioperl-live/trunk/t/hmmer.t
Modified: bioperl-live/trunk/t/hmmer.t
===================================================================
--- bioperl-live/trunk/t/hmmer.t 2008-11-11 18:39:20 UTC (rev 14984)
+++ bioperl-live/trunk/t/hmmer.t 2008-11-11 19:21:45 UTC (rev 14985)
@@ -7,7 +7,7 @@
use lib 't/lib';
use BioperlTest;
- test_begin(-tests => 144);
+ test_begin(-tests => 147);
use_ok('Bio::SearchIO');
use_ok('Bio::Tools::HMMER::Domain');
@@ -266,5 +266,25 @@
ok($res2);
is($res2->number, 604);
-# now let's test the new Bio::SearchIO::hmmer (I believe this is in SearchIO.t)
+# bug revealed by bug 2632 - CS lines were already ignored, but we couldn't
+# parse alignments when HSPs weren't in simple order!!
+$searchio = Bio::SearchIO->new(-format => 'hmmer_pull', -file => test_input_file('hmmpfam_cs.out'), -verbose => 1);
+my $result = $searchio->next_result;
+my $hit = $result->next_hit;
+my $hsp = $hit->next_hsp;
+is $hsp->seq_str, "IPPLLAVGAVHHHLINKGLRQEASILV";
+# and another bug revealed: we don't always know the hit length, and
+# shouldn't complain about that with a warning
+is $hsp->hit->seqlength, 412;
+
+my $count = 0;
+while (my $hit = $result->next_hit) {
+ $count++;
+ next if $count < 6;
+ last if $count > 6;
+ my $hsp = $hit->next_hsp;
+ ok ! $hsp->hit->seqlength;
+ #*** not sure how to test for the lack of a warning though...
+}
+
More information about the Bioperl-guts-l
mailing list