t/*: remove "use lib '.'" and t/lib/Error.pm
[bioperl-live.git] / t / SearchIO / infernal.t
blobbdc1ffe24fbaacf627aa8d520309c77f99684560
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: SearchIO_infernal.t 14672 2008-04-22 21:42:50Z cjfields $
4 use strict;
5 use warnings;
7 BEGIN {
8     use Bio::Root::Test;
10     test_begin(-tests => 496);
12     use_ok('Bio::SearchIO');
15 my ($in, $result, $iter, $hit, $hsp, $algorithm, $meta);
17 ### Infernal v. 1.1 ###
19     # one query vs one database sequence report
20     $in = Bio::SearchIO->new(
21         -format  => 'infernal',
22         -file    => test_input_file('cmsearch_output.txt')
23     );
24     $result = $in->next_result;
25     isa_ok($result, 'Bio::Search::Result::ResultI');
26     is( ref($result), 'Bio::Search::Result::INFERNALResult', 'Check for the correct Result reference type');
27     is( $result->algorithm,         'CMSEARCH',    'Check algorithm' );
28     is( $result->algorithm_version, '1.1.1',       'Check cmsearch algorithm version' );
29     is( $result->cm_name,           'RF00174.cm',  'Check cm_name');
30     is( $result->database_name,     'NC_000913.fna','Check database_name' );
31     is( $result->database_entries,  1,              'Check database_entries' );
32     is( $result->database_letters,  9283304,        'Check database_letters' );
33     is( $result->query_name,        'Cobalamin',    'Check query_name' );
34     is( $result->query_length,      191,            'Check query_length' );
35     is( $result->query_accession,   'RF00174',      'Check query_accession' );
36     is( $result->query_description, '',             'Check query_description' );
37     is( $result->num_hits(),        2,              'Check num_hits' );
39     # 1st hit
41     $hit = $result->next_hit;
42     is( ref($hit), 'Bio::Search::Hit::ModelHit', 'Check for the correct hit reference type' );
43     is( $hit->algorithm, 'CMSEARCH', "Hit algorithm");
44     is( $hit->name,              'gi|556503834|ref|NC_000913.3|', 'Check hit name' );
45     is( $hit->description,       'Escherichia coli str. K-12 substr. MG1655, complete genome', 'Check hit description' );
46     is( $hit->length,             0,       'Check hit length' );
47     is( $hit->score,              98.2,    'Check hit score' );
48     is( $hit->bits,               98.2,    'Check hit bits' );
49     is( $hit->num_hsps,           1,       'Check number of HSPs' );
50     float_is( $hit->significance, 8.7e-16, 'Check hit significance' );
51     is($hit->rank,                1,       'Check hit rank' );
53     $hsp = $hit->next_hsp;
54     is( ref($hsp), 'Bio::Search::HSP::ModelHSP', 'Check for correct hsp reference type' );
55     isa_ok( $hsp, 'Bio::Search::HSP::HSPI' );
56     isa_ok( $hsp->get_aln, 'Bio::Align::AlignI' );
57     isa_ok( $hsp->hit,     'Bio::SeqFeature::Similarity', "Check for hsp hit isa seqfeature similarity" );
59     is( $hsp->hit->seq_id(),   'gi|556503834|ref|NC_000913.3|', 'Check for HSP hit seq_id' );
60     is( $hsp->query->seq_id(), 'Cobalamin', 'Check for HSP query seq_id' );
61     is( $hsp->start('query'),     1,       'Check hsp query start' );
62     is( $hsp->end('query'),       191,     'Check hsp query end' );
63     is( $hsp->start('hit'),       4163384, 'Check hsp hit start' );
64     is( $hsp->end('hit'),         4163574, 'Check hsp hit end' );
65     is( $hsp->score,              98.2,    'Check hsp score' );
66     is( $hsp->bits,               98.2,    'Check hsp bits' );
67     float_is( $hsp->significance, 8.7e-16, 'Check hsp evalue' );
69     is( $hsp->length('query'), 191, 'Check for hsp query length' );
70     is( $hsp->length('hit'),   191, 'Check for hsp hit length' );
71     is( $hsp->length,          207, 'Check for hsp total length' );
72     is( $hsp->gaps('query'),   16,   'Check for hsp query gaps' );
73     is( $hsp->gaps('hit'),     16,   'Check for hsp hit gaps' );
74     is( $hsp->gaps,            32,   'Check for hsp total gaps' );
75     is( $hsp->strand('hit'),      1,       'Check hsp hit strand' );
76     
77     # 2nd hit 
78      
79     $hit = $result->next_hit;
80     is( $hit->name,              'gi|556503834|ref|NC_000913.3|',                 'Check hit name' );
81     is( $hit->description,       'Escherichia coli str. K-12 substr. MG1655, complete genome','Check hit description' );
82     is( $hit->score,              8.4,  'Check hit score' );
83     is( $hit->raw_score,          8.4, "Check hit raw_score");
84     is( $hit->bits,               8.4,    'Check hit bits' );
85     float_is( $hit->significance, 0.63, 'Check hit significance' );
86     is( $hit->length,             0,  'Check hit length' );
87     is($hit->rank, 2, "Hit rank");
89     $hsp = $hit->next_hsp;
90     is( $hsp->hit->seq_id(),   'gi|556503834|ref|NC_000913.3|', 'Check for hit seq_id' );
91     is( $hsp->query->seq_id(), 'Cobalamin', 'Check for query seq_id' );
92     is( $hsp->start('query'),     1,       'Check hsp query start' );
93     is( $hsp->end('query'),       191,     'Check hsp query end' );
94     is( $hsp->start('hit'),       4593356, 'Check hsp hit start' );
95     is( $hsp->end('hit'),         4593565, 'Check hsp hit end' );
96     is( $hsp->score,              8.4,     'Check hsp score' );
97     is( $hsp->bits,               8.4,     'Check hsp bits' );
98     float_is( $hsp->significance, 0.63,    'Check hsp evalue' );
100     is( $hsp->gaps('query'),   67,   'Check for hsp query gaps' );
101     is( $hsp->gaps('hit'),     48,   'Check for hsp hit gaps' );
102     is( $hsp->gaps,            115,   'Check for hsp total gaps' );
103     is( $hsp->strand('hit'),      1,       'Check hsp hit strand' );
105     is( $hsp->noncanonical_string,
106         '               v                                    v             v   v        v       v  v       vvvvvv     vvv    vvv                                   vvv      vvvvvvvvv                                              v  v                    v               ',
107         'Check for NC string');
108     is( $hsp->meta,
109         ':::::::::::::::[[[[[[,<<<____________>>>,,,,,(((,,,<<<<<_______>>>>>,,<<<____>>>,<<<---<<<<.------<<<<<<-----<<<-<<<<<<_____............................._>>>>>>--->>>>>>>>>----------....................................>>>>----.>>>,,,,)))]]]]]]:::::::::::::::',
110         'Check for CS string');
111     is( $hsp->query_string,
112         'uuaaauugaaacgaugauGGUuccccuuuaaagugaaggguuAAaaGGGAAcccGGUGaaAaUCCgggGCuGcCCCCgCaACuGUAAgcGg.agagcaccccccAauAaGCCACUggcccgcaa.............................gggccGGGAAGGCggggggaaggaaugac....................................cCgcgAGc.CaGGAGACCuGCCaucaguuuuugaaucucc',
113         'Check for query string');
114     is( $hsp->homology_string,
115         '  A AUU+A+++    :UGG  :C +U ++  G     G: +AA : GGAA:  G         C  :+  GCCCCCGC +C GU+A ::     GCA ++ ++ A   GCCA   G+C G                                                                                                  :: +AG+ C GGA AC : CCA:  + + + + AU    ',
116         'Check for homology string');
117     is( $hsp->hit_string,
118         'GGAGAUUAAUCUUUACGUGGG-UCGUUGAUCGG---CUGACGAACCAGGAAGAUGU-------ACGCCAGUGCCCCCGCUGCGGUGACGCAa-CCGCAGAUGAUUAGU-GCCA---GACGG---aaugagugggugguaucaacaauaaaacc-----------------------------aguaaugaucggcgcaaaagaggcgcagaugaagcuGGCAAAGUuCUGGAUACUGCCCACCGACGCAGUCAUGCGA',
119         'Check for hit string');
120     is( $hsp->posterior_string,
121         '*********************.88877554444...5777779*********9996.......7999********************88873.333333333333333.4544...33333...44566655444444444444444444444.............................566666666666666666666666677777777776788899966*******************************',
122         'Check for posterior probability string');
124     isa_ok($hsp->feature1, 'Bio::SeqFeature::Similarity');
125     isa_ok($hsp->feature2, 'Bio::SeqFeature::Similarity');
126     ($meta) = $hsp->feature1->get_tag_values('meta');
127     is($meta, ':::::::::::::::[[[[[[,<<<____________>>>,,,,,(((,,,<<<<<_______>>>>>,,<<<____>>>,<<<---<<<<.------<<<<<<-----<<<-<<<<<<_____............................._>>>>>>--->>>>>>>>>----------....................................>>>>----.>>>,,,,)))]]]]]]:::::::::::::::', "Check hsp feature1 get_tag_values");
128     ($meta) = $hsp->feature2->get_tag_values('meta');
129     is($meta, ':::::::::::::::[[[[[[,<<<____________>>>,,,,,(((,,,<<<<<_______>>>>>,,<<<____>>>,<<<---<<<<.------<<<<<<-----<<<-<<<<<<_____............................._>>>>>>--->>>>>>>>>----------....................................>>>>----.>>>,,,,)))]]]]]]:::::::::::::::', "Check hsp feature2 get_tag_values");
131     $result = $in->next_result;
132     is( $result, undef, 'Check for undefined result' );
135     # multi query vs multi sequence database report
136     $in = Bio::SearchIO->new(
137         -format  => 'infernal',
138         -file    => test_input_file('cmsearch.multi.out')
139     );
140       # 1st query
141     $result = $in->next_result;
142     is( $result->num_hits,   12, 'Check result num_hits - multi report');
143     is( $result->query_name, 'tRNA5', 'Check result query_name - multi report');
144     $hit = $result->next_hit;
145     is( $hit->length,        72, 'Check hit length - multi report' );
147       # 2nd query
148     $result = $in->next_result;
149     is( $result->num_hits,   1, 'Check result#2 num_hits - multi report');
150     is( $result->query_name, 'Cobalamin', 'Check result#2 query_name - multi report');
151     $hit = $result->next_hit;
152     is( $hit->length,        0, 'Check result#2 hit length - multi report' );
153     $hsp = $hit->next_hsp;
154     is( $hsp->strand('hit'), -1, 'Check result#2 hsp hit strand - multi report');
157     # report with no hits
158     $in = Bio::SearchIO->new(
159         -format  => 'infernal',
160         -file    => test_input_file('cmsearch.nohit.out')
161     );
162     $result = $in->next_result;
163     is( $result->cm_name, 'Cobalamin.c.cm', 'Check cm_name' );
164     $hit = $result->next_hit;
165     is( $hit, undef, 'Check for undefined hit' );
170 ### Infernal v. 1.0 ####
172 my $searchio = Bio::SearchIO->new( -format => 'infernal',
173                                 -file   => test_input_file('test2.infernal'),
174                                 -model => 'tRNAtest',
175                                 -query_acc => 'RF01234',
176                                 -query_desc => 'tRNA',
177                                );
179 $result = $searchio->next_result;
180 isa_ok($result, 'Bio::Search::Result::ResultI');
181 is($result->algorithm, 'CMSEARCH', "Result");
182 is($result->algorithm_reference, undef, "Result reference");
183 is($result->algorithm_version, '1.0', "Result version");
184 is($result->available_parameters, 0, "Result parameters");
185 is($result->available_statistics, 0, "Result statistics");
186 is($result->database_entries, '', "Result entries");
187 is($result->database_letters, 600000, "Result letters");
188 is($result->database_name, 'tosearch.300Kb.db',
189    "Result database_name");
190 is($result->num_hits, 1, "Result num_hits");
191 is($result->program_reference, undef, "Result program_reference");
192 is($result->query_accession, 'RF01234', "Result query_accession");
193 is($result->query_description, 'tRNA', "Result query_description");
194 is($result->query_length, 72, "Result query_length");
195 is($result->query_name, 'trna.5-1', "Result query_name");
197 $hit = $result->next_hit;
199 isa_ok($hit, 'Bio::Search::Hit::HitI');
200 is($hit->ncbi_gi, '', "Hit GI");
201 is($hit->accession, 'example', "Hit accession");
202 is($hit->algorithm, 'CMSEARCH', "Hit algorithm");
203 is($hit->bits, '78.06', "Hit bits");
204 is($hit->description, '', "Hit description"); # no hit descs yet
205 is($hit->locus, '', "Hit locus");
206 is($hit->n, 3, "Hit n");
207 is($hit->name, 'example', "Hit name");
208 is($hit->num_hsps, 3, "Hit num_hsps");
210 # These Bio::Search::Hit::HitI methods are currently unimplemented in
211 # Bio::Search::Hit::ModelHit; they may be integrated over time but will require
212 # some reconfiguring for Model-based searches
214 # these need to be replaced by dies_ok() or warnings_like()
215 warning_like { $hit->length_aln() }
216     qr'length_aln not implemented for Model-based searches',
217     "Hit length_aln() not implemented";
218 warning_like {$hit->num_unaligned_hit}
219     qr'num_unaligned_hit/num_unaligned_sbjct not implemented for Model-based searches',
220     "Hit num_unaligned_hit() not implemented";
221 warning_like {$hit->num_unaligned_query}
222     qr'num_unaligned_query not implemented for Model-based searches',
223     "Hit num_unaligned_query() not implemented";
224 warning_like {$hit->num_unaligned_sbjct}
225     qr'num_unaligned_hit/num_unaligned_sbjct not implemented for Model-based searches',
226     "Hit num_unaligned_sbjct() not implemented";
227 warning_like {$hit->start}
228     qr'start not implemented for Model-based searches',
229     'Hit start not implemented';
230 warning_like {$hit->end}
231     qr'end not implemented for Model-based searches',
232     'Hit end not implemented';
233 warning_like {$hit->strand}
234     qr'strand not implemented for Model-based searches',
235     'Hit strand not implemented';
236 warning_like {$hit->logical_length}
237     qr'logical_length not implemented for Model-based searches',
238     'Hit logical_length not implemented';
239 warning_like {$hit->frac_aligned_hit}
240     qr'frac_aligned_hit not implemented for Model-based searches',
241     'Hit frac_aligned_hit not implemented';
242 warning_like {$hit->frac_aligned_query}
243     qr'frac_aligned_query not implemented for Model-based searches',
244     'Hit frac_aligned_query not implemented';
245 warning_like {$hit->frac_conserved}
246     qr'frac_conserved not implemented for Model-based searches',
247     'Hit frac_conserved not implemented';
248 warning_like {$hit->frac_identical}
249     qr'frac_identical not implemented for Model-based searches',
250     'Hit frac_identical not implemented';
251 warning_like {$hit->matches}
252     qr'matches not implemented for Model-based searches',
253     'Hit matches not implemented';
254 warning_like {$hit->gaps}
255     qr'gaps not implemented for Model-based searches',
256     'Hit gaps not implemented';
257 warning_like {$hit->frame}
258     qr'frame not implemented for Model-based searches',
259     'Hit frame not implemented';
260 warning_like {$hit->range}
261     qr'range not implemented for Model-based searches',
262     'Hit range not implemented';
263 warning_like {$hit->seq_inds}
264     qr'seq_inds not implemented for Model-based searches',
265     'Hit seq_inds not implemented';
267 is($hit->length, 0, "Hit length");
268 is($hit->overlap, 0, "Hit overlap");
269 is($hit->query_length, 72, "Hit query_length");
270 is($hit->rank, 1, "Hit rank");
271 is($hit->raw_score, '78.06', "Hit raw_score");
272 is($hit->score, '78.06', "Hit score");
273 float_is($hit->p, '2.906e-26', "Hit p");
274 float_is($hit->significance, '3.133e-21');
276 $hsp = $hit->next_hsp;
277 isa_ok($hsp, 'Bio::Search::HSP::HSPI');
278 is($hsp->algorithm, 'CMSEARCH', "HSP algorithm");
279 float_is($hsp->evalue, '3.133e-21');
280 isa_ok($hsp->feature1, 'Bio::SeqFeature::Similarity');
281 isa_ok($hsp->feature2, 'Bio::SeqFeature::Similarity');
282 ($meta) = $hsp->feature1->get_tag_values('meta');
283 is($meta, '(((((((,,<<<<___.____>>>>,<<<<<_______>>>>>,,,,,<<<<<_______>>>>>))))))):');
284 ($meta) = $hsp->feature2->get_tag_values('meta');
285 is($meta, '(((((((,,<<<<___.____>>>>,<<<<<_______>>>>>,,,,,<<<<<_______>>>>>))))))):');
287 is($hsp->frame('query'), 0, "HSP frame");
288 is($hsp->gaps, 1, "HSP gaps");
289 is($hit->length, 0, "Hit length");
290 isa_ok($hsp->get_aln, 'Bio::Align::AlignI');
291 isa_ok($hsp->hit, 'Bio::SeqFeature::Similarity', "HSP hit");
292 is($hsp->hit_string,
293    'GCGGAUUUAGCUCAGUuGGGAGAGCGCCAGACUGAAGAUCUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA',
294    "HSP hit_string");
295 is($hsp->homology_string,
296    'GC::A::UAGC:CAGU GG AG:GCGCCAG:CUG+++A:CUGGAGGUCC:G:GUUCGAU C:C:G::U::GCA',
297    "HSP homology_string");
298 is($hsp->hsp_group, undef, "HSP hsp_group");
299 is($hsp->hsp_length, 73, "HSP hsp_length");
300 is($hsp->length, 73, "HSP length");
301 is($hsp->links, undef, "HSP links");
302 is($hsp->n, 1, "HSP n");
303 float_is($hsp->pvalue, 2.906e-26, "HSP pvalue");
304 isa_ok($hsp->query, 'Bio::SeqFeature::Similarity', "HSP query");
305 is($hsp->query_string,
306    'gCcgacAUaGcgcAgU.GGuAgcgCgccagccUgucAagcuggAGgUCCgggGUUCGAUuCcccGUgucgGca',
307    "HSP query_string");
308 is($hsp->range, 72, "HSP range");
309 is($hsp->rank, 1, "HSP rank");
310 float_is($hsp->significance, 3.133e-21);
311 is($hsp->end, 72, "HSP end");
312 float_is($hsp->expect, '3.133e-21', "HSP expect");
314 # These Bio::Search::HSP::HSPI methods are currently unimplemented in
315 # Bio::Search::HSP::ModelHSP; they may be integrated over time but will require
316 # some reconfiguring for Model-based searches
318 warning_like {$hsp->seq_inds}
319     qr'seq_inds not implemented for Model-based searches',
320     'HSP seq_inds not implemented';
321 warning_like {$hsp->matches}
322     qr'matches not implemented for Model-based searches',
323     'HSP matches not implemented';
324 warning_like {$hsp->frac_conserved}
325     qr'frac_conserved not implemented for Model-based searches',
326     'HSP frac_conserved not implemented';
327 warning_like {$hsp->frac_identical}
328     qr'frac_identical not implemented for Model-based searches',
329     'HSP frac_identical not implemented';
330 warning_like {$hsp->num_conserved}
331     qr'num_conserved not implemented for Model-based searches',
332     'HSP num_conserved not implemented';
333 warning_like {$hsp->num_identical}
334     qr'num_identical not implemented for Model-based searches',
335     'HSP num_identical not implemented';
336 warning_like {$hsp->percent_identity}
337     qr'percent_identity not implemented for Model-based searches',
338     'HSP percent_identity not implemented';
339 warning_like {$hsp->cigar_string}
340     qr'cigar_string not implemented for Model-based searches',
341     'HSP cigar_string not implemented';
342 warning_like {$hsp->generate_cigar_string}
343     qr'generate_cigar_string not implemented for Model-based searches',
344     'HSP cigar_string not implemented';
346 isa_ok($hsp->seq, 'Bio::LocatableSeq');
347 is($hsp->seq_str,
348    'gCcgacAUaGcgcAgU.GGuAgcgCgccagccUgucAagcuggAGgUCCgggGUUCGAUuCcccGUgucgGca',
349    "HSP seq_str");
350 is($hsp->start, 1, "HSP start");
351 is($hsp->custom_score, undef, "HSP custom_score");
352 is($hsp->meta,
353    '(((((((,,<<<<___.____>>>>,<<<<<_______>>>>>,,,,,<<<<<_______>>>>>))))))):',
354    "HSP meta");
355 is($hsp->strand('hit'), 1, "HSP strand");
357 $hsp = $hit->next_hsp;
358 isa_ok($hsp, 'Bio::Search::HSP::HSPI');
359 is($hsp->algorithm, 'CMSEARCH', "HSP algorithm");
360 float_is($hsp->evalue, 0.6752);
361 isa_ok($hsp->feature1, 'Bio::SeqFeature::Similarity');
362 isa_ok($hsp->feature2, 'Bio::SeqFeature::Similarity');
363 is($hsp->frame('query'), 0, "HSP frame");
364 is($hsp->gaps, 4, "HSP gaps");
365 # infernal can return alignment data
366 isa_ok($hsp->get_aln, 'Bio::Align::AlignI');
367 isa_ok($hsp->hit, 'Bio::SeqFeature::Similarity', "HSP hit");
368 is($hsp->hit_string,
369    'UCUGCUAUGGCGUAAUGGCCACGCGC----CCAUCAACAAAGAUAUC*[19]*UAACAGGA',
370    "HSP hit_string");
371 is($hsp->homology_string,
372    ' C:G :AU+GCG:A+UGG  :CGCGC    C  UCAA +++GA +UC      U: C:G A',
373    "HSP homology_string");
374 is($hsp->hsp_group, undef, "HSP hsp_group");
375 is($hsp->hsp_length, 73, "HSP hsp_length");
376 is($hsp->length, 73, "HSP length");
377 is($hsp->links, undef, "HSP links");
378 is($hsp->n, 1, "HSP n");
379 float_is($hsp->pvalue, 6.263e-06, "HSP pvalue");
380 isa_ok($hsp->query, 'Bio::SeqFeature::Similarity', "HSP query");
381 is($hsp->query_string,
382    'gCcgacAUaGcgcAgUGGuAgcgCgccagccUgucAagcuggAGgUC*[17]*UgucgGca',
383    "HSP query_string");
384 is($hsp->range, 72, "HSP range");
385 is($hsp->rank, 2, "HSP rank");
386 float_is($hsp->significance, 0.6752);
387 is($hsp->end, 72, "HSP end");
388 float_is($hsp->expect, 0.6752, "HSP expect");
389 isa_ok($hsp->seq, 'Bio::LocatableSeq');
390 # this should probably default to the hit string
391 is($hsp->seq_str,
392    'gCcgacAUaGcgcAgUGGuAgcgCgccagccUgucAagcuggAGgUC*[17]*UgucgGca',
393    "HSP seq_str");
394 is($hsp->start, 1, "HSP start");
395 is($hsp->custom_score, undef, "HSP custom_score");
396 is($hsp->meta,
397    '(((((((,,<<<<_______>>>>,<<<<<_______>>>>>,,,,,~~~~~~))))))):',
398    "HSP meta");
399 is($hsp->strand('hit'), 1, "HSP strand");
401 ### Infernal pre-v. 1.0 ####
403 $searchio = Bio::SearchIO->new( -format => 'infernal',
404                                 -file   => test_input_file('test.infernal'),
405                                 # version is reset to the correct one by parser
406                                 -version => 0.7,
407                                 -model => 'Purine',
408                                 -query_acc => 'RF00167',
409                                 -query_desc => 'Purine riboswitch',
410                                 -database => 'b_sub.fas',
411                                 -hsp_minscore => 40,
412                                 -convert_meta => 0,
413                                );
415 $result = $searchio->next_result;
416 isa_ok($result, 'Bio::Search::Result::ResultI');
417 $algorithm = $result->algorithm;
418 is($result->algorithm, 'CMSEARCH', "Result $algorithm");
419 is($result->algorithm_reference, undef, "Result $algorithm reference");
420 is($result->algorithm_version, 0.7, "Result $algorithm version");
421 is($result->available_parameters, 0, "Result parameters");
422 is($result->available_statistics, 0, "Result statistics");
423 is($result->database_entries, '', "Result entries");
424 is($result->database_letters, '', "Result letters");
425 is($result->database_name, 'b_sub.fas', "Result database_name");
426 is($result->num_hits, 2, "Result num_hits");
427 is($result->program_reference, undef, "Result program_reference");
428 is($result->query_accession, 'RF00167', "Result query_accession");
429 is($result->query_description, 'Purine riboswitch', "Result query_description");
430 is($result->query_length, 102, "Result query_length");
431 is($result->query_name, 'Purine', "Result query_name");
433 $hit = $result->next_hit;
435 isa_ok($hit, 'Bio::Search::Hit::HitI');
436 is($hit->ncbi_gi, '2239287', "Hit GI");
437 is($hit->accession, 'U51115.1', "Hit accession");
438 is($hit->algorithm, 'CMSEARCH', "Hit algorithm");
439 is($hit->bits, 81.29, "Hit bits");
440 is($hit->description, '', "Hit description"); # no hit descs yet
441 is($hit->locus, 'BSU51115', "Hit locus");
442 is($hit->n, 2, "Hit n");
443 is($hit->name, 'gi|2239287|gb|U51115.1|BSU51115', "Hit name");
444 is($hit->num_hsps, 2, "Hit num_hsps");
446 # p() works but there are no evalues yet for Infernal output, so catch and check...
447 warning_like {$hit->p}
448     qr'P-value not defined. Using significance\(\) instead',
449     "No p values";
451 is($hit->length, 0, "Hit length");
452 is($hit->overlap, 0, "Hit overlap");
453 is($hit->query_length, 102, "Hit query_length");
454 is($hit->rank, 1, "Hit rank");
455 is($hit->raw_score, 81.29, "Hit raw_score");
456 is($hit->score, 81.29, "Hit score");
457 float_is($hit->significance, undef);
459 $hsp = $hit->next_hsp;
460 isa_ok($hsp, 'Bio::Search::HSP::HSPI');
461 is($hsp->algorithm, 'CMSEARCH', "HSP algorithm");
462 float_is($hsp->evalue, undef);
463 isa_ok($hsp->feature1, 'Bio::SeqFeature::Similarity');
464 isa_ok($hsp->feature2, 'Bio::SeqFeature::Similarity');
465 ($meta) = $hsp->feature1->get_tag_values('meta');
466 is($meta, ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,)))).))))::::::::::::::');
467 ($meta) = $hsp->feature2->get_tag_values('meta');
468 is($meta, ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,)))).))))::::::::::::::');
470 is($hsp->frame('query'), 0, "HSP frame");
471 is($hsp->gaps, 1, "HSP gaps");
472 is($hit->length, 0, "Hit length");
473 isa_ok($hsp->get_aln, 'Bio::Align::AlignI');
474 isa_ok($hsp->hit, 'Bio::SeqFeature::Similarity', "HSP hit");
475 is($hsp->hit_string,
476    'CAUGAAAUCAAAACACGACCUCAUAUAAUCUUGGGAAUAUGGCCCAUAAGUUUCUACCCGGCAACCGUAAAUUGCCGGACUAUGcAGGGAAGUGAUCGAUAAA',
477    "HSP hit_string");
478 is($hsp->homology_string,
479    ' A+ A+A+ AAAA A   :CUC:UAUAAU: :GGGAAUAUGGCCC: :AGUUUCUACC:GGCAACCGUAAAUUGCC:GACUA:G AG: AA + ++  +++++',
480    "HSP homology_string");
481 is($hsp->hsp_group, undef, "HSP hsp_group");
482 is($hsp->hsp_length, 103, "HSP hsp_length");
483 is($hsp->length, 103, "HSP length");
484 is($hsp->links, undef, "HSP links");
485 is($hsp->n, 1, "HSP n");
486 float_is($hsp->pvalue, undef, "HSP pvalue");
487 isa_ok($hsp->query, 'Bio::SeqFeature::Similarity', "HSP query");
488 is($hsp->query_string,
489    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcG.aGuaAauauuaaauauuu',
490    "HSP query_string");
491 is($hsp->range, 102, "HSP range");
492 is($hsp->rank, 1, "HSP rank");
493 float_is($hsp->significance, undef);
494 is($hsp->end, 102, "HSP end");
495 float_is($hsp->expect, undef, "HSP expect");
497 isa_ok($hsp->seq, 'Bio::LocatableSeq');
498 is($hsp->seq_str,
499    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcG.aGuaAauauuaaauauuu',
500    "HSP seq_str");
501 is($hsp->start, 1, "HSP start");
502 is($hsp->custom_score, undef, "HSP custom_score");
503 is($hsp->meta,
504    ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,)))).))))::::::::::::::',
505    "HSP meta");
506 is($hsp->strand('hit'), 1, "HSP strand");
508 $hsp = $hit->next_hsp;
509 isa_ok($hsp, 'Bio::Search::HSP::HSPI');
510 is($hsp->algorithm, 'CMSEARCH', "HSP algorithm");
511 float_is($hsp->evalue, undef);
512 isa_ok($hsp->feature1, 'Bio::SeqFeature::Similarity');
513 isa_ok($hsp->feature2, 'Bio::SeqFeature::Similarity');
514 is($hsp->frame('query'), 0, "HSP frame");
515 is($hsp->gaps, 0, "HSP gaps");
516 # infernal can return alignment data
517 isa_ok($hsp->get_aln, 'Bio::Align::AlignI');
518 isa_ok($hsp->hit, 'Bio::SeqFeature::Similarity', "HSP hit");
519 is($hsp->hit_string,
520    'AGAAAUCAAAUAAGAUGAAUUCGUAUAAUCGCGGGAAUAUGGCUCGCAAGUCUCUACCAAGCUACCGUAAAUGGCUUGACUACGUAAACAUUUCUUUCGUUU',
521    "HSP hit_string");
522 is($hsp->homology_string,
523    'A AAAU AAA+AA A+   : CGUAUAAU::CG:GAAUAUGGC:CG::AGU UCUACCA:GC ACCGUAAAU GC:UGACUACG :   AU+U +++  UUU',
524    "HSP homology_string");
525 is($hsp->hsp_group, undef, "HSP hsp_group");
526 is($hsp->hsp_length, 103, "HSP hsp_length");
527 is($hsp->length, 103, "HSP length");
528 is($hsp->links, undef, "HSP links");
529 is($hsp->n, 1, "HSP n");
530 float_is($hsp->pvalue, undef, "HSP pvalue");
531 isa_ok($hsp->query, 'Bio::SeqFeature::Similarity', "HSP query");
532 is($hsp->query_string,
533    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcGaGuaAauauuaaauauuu',
534    "HSP query_string");
535 is($hsp->range, 102, "HSP range");
536 is($hsp->rank, 2, "HSP rank");
537 float_is($hsp->significance, undef);
538 is($hsp->end, 102, "HSP end");
539 float_is($hsp->expect, undef, "HSP expect");
540 #is($hsp->matches, 2, "HSP matches");
541 isa_ok($hsp->seq, 'Bio::LocatableSeq');
542 # this should probably default to the hit string
543 is($hsp->seq_str,
544    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcGaGuaAauauuaaauauuu',
545    "HSP seq_str");
546 is($hsp->start, 1, "HSP start");
547 is($hsp->custom_score, undef, "HSP custom_score");
548 is($hsp->meta,
549    ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,))))))))::::::::::::::',
550    "HSP meta");
551 is($hsp->strand('hit'), 1, "HSP strand");
553 # one more hit...
555 $hit = $result->next_hit;
556 isa_ok($hit, 'Bio::Search::Hit::HitI');
557 is($hit->accession, 'X83878.1', "Hit accession");
558 is($hit->ncbi_gi, '633168', "Hit GI");
559 is($hit->algorithm, 'CMSEARCH', "Hit algorithm");
560 is($hit->bits, 79.36, "Hit bits");
561 is($hit->description, '', "Hit description"); # no hit descs yet
562 is($hit->length, 0, "Hit length");
563 is($hit->locus, '', "Hit locus");
564 is($hit->n, 1, "Hit n");
565 is($hit->name, 'gi|633168|emb|X83878.1|', "Hit name");
566 is($hit->num_hsps, 1, "Hit num_hsps");
567 is($hit->overlap, 0, "Hit overlap");
568 is($hit->query_length, 102, "Hit query_length");
569 is($hit->rank, 2, "Hit rank");
570 is($hit->raw_score, 79.36, "Hit raw_score");
571 is($hit->score, 79.36, "Hit score");
572 float_is($hit->significance, undef);
574 # one more HSP...
576 $hsp = $hit->next_hsp;
577 isa_ok($hsp, 'Bio::Search::HSP::HSPI');
578 is($hsp->algorithm, 'CMSEARCH', "HSP algorithm");
579 float_is($hsp->evalue, undef);
580 isa_ok($hsp->feature1, 'Bio::SeqFeature::Similarity');
581 isa_ok($hsp->feature2, 'Bio::SeqFeature::Similarity');
582 is($hsp->frame('query'), 0, "HSP frame");
583 is($hsp->gaps, 2, "HSP gaps");
584 isa_ok($hsp->get_aln, 'Bio::Align::AlignI');
585 isa_ok($hsp->hit, 'Bio::SeqFeature::Similarity', "HSP hit");
586 is($hsp->hit_string,
587    'UUACAAUAUAAUAGGAACACUCAUAUAAUCGCGUGGAUAUGGCACGCAAGUUUCUACCGGGCA-CCGUAAA-UGUCCGACUAUGGGUGAGCAAUGGAACCGC',
588    "HSP hit_string");
589 is($hsp->homology_string,
590    '+ A A++A AA A  AA:AC+C:UAUAAU::CG:G AUAUGGC:CG::AGUUUCUACC:G CA CCGUAAA UG C:GACUA:G+GU:A  A+U  A+    ',
591    "HSP homology_string");
592 is($hsp->hsp_group, undef, "HSP hsp_group");
593 is($hsp->hsp_length, 103, "HSP hsp_length");
594 is($hsp->length, 103, "HSP length");
595 is($hsp->links, undef, "HSP links");
596 is($hsp->n, 1, "HSP n");
597 isa_ok($hsp->query, 'Bio::SeqFeature::Similarity', "HSP query");
598 is($hsp->query_string,
599    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcGaGuaAauauuaaauauuu',
600    "HSP query_string");
601 is($hsp->range, 102, "HSP range");
602 is($hsp->rank, 1, "HSP rank");
603 float_is($hsp->significance, undef);
604 is($hsp->end, 102, "HSP end");
605 float_is($hsp->expect, undef, "HSP expect");
606 isa_ok($hsp->seq, 'Bio::LocatableSeq');
607 is($hsp->seq_str,
608    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcGaGuaAauauuaaauauuu',
609    "HSP seq_str");
610 is($hsp->start, 1, "HSP start");
611 is($hsp->custom_score, undef, "HSP custom_score");
612 is($hsp->meta,
613    ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,))))))))::::::::::::::',
614    "HSP meta");
615 is($hsp->strand('hit'), 1, "HSP strand");
617 my $symbols = {
618             '5-prime'        => '(',
619             '3-prime'        => ')',
620             'single-strand'  => ':',
621             'unknown'        => '?',
622             'gap'            => '-'
623              # may add more for quartets, triplets
624               };
626 $searchio = Bio::SearchIO->new( -format => 'infernal',
627                                 -file   => test_input_file('test.infernal'),
628                                 # version is reset to the correct one by parser
629                                 -version => 0.7,
630                                 -model => 'Purine',
631                                 -query_acc => 'RF00167',
632                                 -query_desc => 'Purine riboswitch',
633                                 -database => 'b_sub.fas',
634                                 -hsp_minscore => 40,
635                                 -convert_meta => 1,
636                                 -symbols => $symbols,
637                                );
639 $result = $searchio->next_result;
640 $hit = $result->next_hit;
641 $hsp = $hit->next_hsp;
642 is($hsp->meta,
643    ':::::::::::::::::((((((((:::(((((((:::::::)))))))::::::::(((((((:::::::)))))))::))))-))))::::::::::::::',
644    "HSP meta gap bug");
645 $hsp = $hit->next_hsp;
646 is($hsp->meta,
647    ':::::::::::::::::((((((((:::(((((((:::::::)))))))::::::::(((((((:::::::)))))))::))))))))::::::::::::::',
648    "HSP meta");
649 $hit = $result->next_hit;
650 $hsp = $hit->next_hsp;
651 is($hsp->meta,
652    ':::::::::::::::::((((((((:::(((((((:::::::)))))))::::::::(((((((:::::::)))))))::))))))))::::::::::::::',
653    "HSP meta");
654 ($meta) = $hsp->feature1->get_tag_values('meta');
655 is($meta, ':::::::::::::::::((((((((:::(((((((:::::::)))))))::::::::(((((((:::::::)))))))::))))))))::::::::::::::');
656 ($meta) = $hsp->feature2->get_tag_values('meta');
657 is($meta, ':::::::::::::::::((((((((:::(((((((:::::::)))))))::::::::(((((((:::::::)))))))::))))))))::::::::::::::');
659 ## Infernal 0.81 parsing ##
661 $searchio = Bio::SearchIO->new( -format => 'infernal',
662                                 -file   => test_input_file('purine_v081.infernal'),
663                                 # version is reset to the correct one by parser
664                                 -query_acc => 'RF00167',
665                                 -query_desc => 'Purine riboswitch',
666                                 -database => 'b_sub.fas',
667                                 -convert_meta => 0,
668                                );
670 $result = $searchio->next_result;
672 isa_ok($result, 'Bio::Search::Result::ResultI');
673 $algorithm = $result->algorithm;
674 is($result->algorithm, 'CMSEARCH', "Result $algorithm");
675 is($result->algorithm_reference, undef, "Result $algorithm reference");
676 is($result->algorithm_version, 0.81, "Result $algorithm version");
677 is($result->available_parameters, 0, "Result parameters");
678 is($result->available_statistics, 0, "Result statistics");
679 is($result->database_entries, '', "Result entries");
680 is($result->database_letters, '', "Result letters");
681 is($result->database_name, 'b_sub.fas', "Result database_name");
682 is($result->num_hits, 3, "Result num_hits");
683 is($result->program_reference, undef, "Result program_reference");
684 is($result->query_accession, 'RF00167', "Result query_accession");
685 is($result->query_description, 'Purine riboswitch', "Result query_description");
686 is($result->query_length, 102, "Result query_length");
687 is($result->query_name, 'Purine', "Result query_name");
689 $hit = $result->next_hit;
690 isa_ok($hit, 'Bio::Search::Hit::HitI');
691 is($hit->ncbi_gi, '633168', "Hit GI");
692 is($hit->accession, 'X83878.1', "Hit accession");
693 is($hit->algorithm, 'CMSEARCH', "Hit algorithm");
694 is($hit->bits, 79.36, "Hit bits");
695 is($hit->description, '', "Hit description"); # no hit descs yet
696 is($hit->locus, '', "Hit locus");
697 is($hit->n, 2, "Hit n");
698 is($hit->name, 'gi|633168|emb|X83878.1|', "Hit name");
699 is($hit->num_hsps, 2, "Hit num_hsps");
701 # p() works but there are no evalues yet for Infernal output, so catch and check...
702 warnings_like {$hit->p} qr'P-value not defined. Using significance\(\) instead',
703      "No p values";
705 is($hit->length, 0, "Hit length");
706 is($hit->overlap, 0, "Hit overlap");
707 is($hit->query_length, 102, "Hit query_length");
708 is($hit->rank, 1, "Hit rank");
709 is($hit->raw_score, 79.36, "Hit raw_score");
710 is($hit->score, 79.36, "Hit score");
711 float_is($hit->significance, 1.945e-07);
713 $hsp = $hit->next_hsp;
714 isa_ok($hsp, 'Bio::Search::HSP::HSPI');
715 is($hsp->algorithm, 'CMSEARCH', "HSP algorithm");
716 float_is($hsp->evalue, 1.945e-07);
717 isa_ok($hsp->feature1, 'Bio::SeqFeature::Similarity');
718 isa_ok($hsp->feature2, 'Bio::SeqFeature::Similarity');
719 ($meta) = $hsp->feature1->get_tag_values('meta');
720 is($meta, ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,))))))))::::::::::::::');
721 ($meta) = $hsp->feature2->get_tag_values('meta');
722 is($meta, ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,))))))))::::::::::::::');
724 is($hsp->frame('query'), 0, "HSP frame");
725 is($hsp->gaps, 2, "HSP gaps");
726 is($hit->length, 0, "Hit length");
727 isa_ok($hsp->get_aln, 'Bio::Align::AlignI');
728 isa_ok($hsp->hit, 'Bio::SeqFeature::Similarity', "HSP hit");
729 is($hsp->hit_string,
730    'UUACAAUAUAAUAGGAACACUCAUAUAAUCGCGUGGAUAUGGCACGCAAGUUUCUACCGGGCA-CCGUAAA-UGUCCGACUAUGGGUGAGCAAUGGAACCGC',
731    "HSP hit_string");
732 is($hsp->homology_string,
733    '+ A A++A AA A  AA:AC+C:UAUAAU::CG:G AUAUGGC:CG::AGUUUCUACC:G CA CCGUAAA UG C:GACUA:G+GU:A  A+U  A+    ',
734    "HSP homology_string");
735 is($hsp->hsp_group, undef, "HSP hsp_group");
736 is($hsp->hsp_length,102, "HSP hsp_length");
737 is($hsp->length, 102, "HSP length");
738 is($hsp->links, undef, "HSP links");
739 is($hsp->n, 1, "HSP n");
740 float_is($hsp->pvalue, 1.945e-07, "HSP pvalue");
741 isa_ok($hsp->query, 'Bio::SeqFeature::Similarity', "HSP query");
742 is($hsp->query_string,
743    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcGaGuaAauauuaaauauuu',
744    "HSP query_string");
745 is($hsp->range, 102, "HSP range");
746 is($hsp->rank, 1, "HSP rank");
747 float_is($hsp->significance, 1.945e-07);
748 is($hsp->end, 102, "HSP end");
749 float_is($hsp->expect, 1.945e-07, "HSP expect");
751 isa_ok($hsp->seq, 'Bio::LocatableSeq');
752 is($hsp->seq_str,
753    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcGaGuaAauauuaaauauuu',
754    "HSP seq_str");
755 is($hsp->start, 1, "HSP start");
756 is($hsp->custom_score, undef, "HSP custom_score");
757 is($hsp->meta,
758    ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,))))))))::::::::::::::',
759    "HSP meta");
760 is($hsp->strand('hit'), 1, "HSP strand");
762 $hsp = $hit->next_hsp;
763 isa_ok($hsp, 'Bio::Search::HSP::HSPI');
764 is($hsp->algorithm, 'CMSEARCH', "HSP algorithm");
765 float_is($hsp->evalue, 6.802);
766 isa_ok($hsp->feature1, 'Bio::SeqFeature::Similarity');
767 isa_ok($hsp->feature2, 'Bio::SeqFeature::Similarity');
768 is($hsp->frame('query'), 0, "HSP frame");
769 is($hsp->gaps, 4, "HSP gaps");
770 # infernal can return alignment data
771 isa_ok($hsp->get_aln, 'Bio::Align::AlignI');
772 isa_ok($hsp->hit, 'Bio::SeqFeature::Similarity', "HSP hit");
773 is($hsp->hit_string,
774    'CGUGCGGUUCCAUUGCUCACCCAUA-GUCGGACAU-UUACGG-UGCCCGGUAGAAACUUGCGUGCCAUAUCCACGCGAUUaUAUGAGUGUUCCUAUUAUAUUG',
775    "HSP hit_string");
776 is($hsp->homology_string,
777    '  +    +   A    +:AC C:UA  +::: ::   UA GG :: :::GU    AC: G::::CC UA  ::::C :   UA:G GU: +  U+++AUAUU ',
778    "HSP homology_string");
779 is($hsp->hsp_group, undef, "HSP hsp_group");
780 is($hsp->hsp_length, 102, "HSP hsp_length");
781 is($hsp->length, 102, "HSP length");
782 is($hsp->links, undef, "HSP links");
783 is($hsp->n, 1, "HSP n");
784 float_is($hsp->pvalue, 0.9989, "HSP pvalue");
785 isa_ok($hsp->query, 'Bio::SeqFeature::Similarity', "HSP query");
786 is($hsp->query_string,
787    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGAC.UAcGaGuaAauauuaaauauuu',
788    "HSP query_string");
789 is($hsp->range, 102, "HSP range");
790 is($hsp->rank, 2, "HSP rank");
791 float_is($hsp->significance, 6.802);
792 is($hsp->end, 102, "HSP end");
793 float_is($hsp->expect, 6.802, "HSP expect");
794 #is($hsp->matches, 2, "HSP matches");
795 isa_ok($hsp->seq, 'Bio::LocatableSeq');
796 # this should probably default to the hit string
797 is($hsp->seq_str,
798    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGAC.UAcGaGuaAauauuaaauauuu',
799    "HSP seq_str");
800 is($hsp->start, 1, "HSP start");
801 is($hsp->custom_score, undef, "HSP custom_score");
802 is($hsp->meta,
803    ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,.))))))))::::::::::::::',
804    "HSP meta");
805 is($hsp->strand('hit'), -1, "HSP strand");
807 # one more hit...
809 $hit = $result->next_hit;
810 isa_ok($hit, 'Bio::Search::Hit::HitI');
811 is($hit->accession, 'U51115.1', "Hit accession");
812 is($hit->ncbi_gi, '2239287', "Hit GI");
813 is($hit->algorithm, 'CMSEARCH', "Hit algorithm");
814 is($hit->bits, 81.29, "Hit bits");
815 is($hit->description, '', "Hit description"); # no hit descs yet
816 is($hit->length, 0, "Hit length");
817 is($hit->locus, 'BSU51115', "Hit locus");
818 is($hit->n, 11, "Hit n");
819 is($hit->name, 'gi|2239287|gb|U51115.1|BSU51115', "Hit name");
820 is($hit->num_hsps, 11, "Hit num_hsps");
821 is($hit->overlap, 0, "Hit overlap");
822 is($hit->query_length, 102, "Hit query_length");
823 is($hit->rank, 2, "Hit rank");
824 is($hit->raw_score, 81.29, "Hit raw_score");
825 is($hit->score, 81.29, "Hit score");
826 float_is($hit->significance, 1.259e-07);
828 # one more HSP...
830 $hsp = $hit->next_hsp;
831 isa_ok($hsp, 'Bio::Search::HSP::HSPI');
832 is($hsp->algorithm, 'CMSEARCH', "HSP algorithm");
833 float_is($hsp->evalue, 1.259e-07);
834 isa_ok($hsp->feature1, 'Bio::SeqFeature::Similarity');
835 isa_ok($hsp->feature2, 'Bio::SeqFeature::Similarity');
836 is($hsp->frame('query'), 0, "HSP frame");
837 is($hsp->gaps, 0, "HSP gaps");
838 isa_ok($hsp->get_aln, 'Bio::Align::AlignI');
839 isa_ok($hsp->hit, 'Bio::SeqFeature::Similarity', "HSP hit");
840 is($hsp->hit_string,
841    'AGAAAUCAAAUAAGAUGAAUUCGUAUAAUCGCGGGAAUAUGGCUCGCAAGUCUCUACCAAGCUACCGUAAAUGGCUUGACUACGUAAACAUUUCUUUCGUUU',
842    "HSP hit_string");
843 is($hsp->homology_string,
844    'A AAAU AAA+AA A+   : CGUAUAAU::CG:GAAUAUGGC:CG::AGU UCUACCA:GC ACCGUAAAU GC:UGACUACG :   AU+U +++  UUU',
845    "HSP homology_string");
846 is($hsp->hsp_group, undef, "HSP hsp_group");
847 is($hsp->hsp_length, 102, "HSP hsp_length");
848 is($hsp->length, 102, "HSP length");
849 is($hsp->links, undef, "HSP links");
850 is($hsp->n, 1, "HSP n");
851 isa_ok($hsp->query, 'Bio::SeqFeature::Similarity', "HSP query");
852 is($hsp->query_string,
853    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcGaGuaAauauuaaauauuu',
854    "HSP query_string");
855 is($hsp->range, 102, "HSP range");
856 is($hsp->rank, 1, "HSP rank");
857 float_is($hsp->significance, 1.259e-07);
858 is($hsp->end, 102, "HSP end");
859 float_is($hsp->expect, 1.259e-07, "HSP expect");
860 isa_ok($hsp->seq, 'Bio::LocatableSeq');
861 is($hsp->seq_str,
862    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcGaGuaAauauuaaauauuu',
863    "HSP seq_str");
864 is($hsp->start, 1, "HSP start");
865 is($hsp->custom_score, undef, "HSP custom_score");
866 is($hsp->meta,
867    ':::::::::::::::::((((((((,,,<<<<<<<_______>>>>>>>,,,,,,,,<<<<<<<_______>>>>>>>,,))))))))::::::::::::::',
868    "HSP meta");
869 is($hsp->strand('hit'), 1, "HSP strand");