1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 185);
11 use_ok('Bio::Tools::Signalp::ExtendedSignalp');
14 ###############################################
15 ### TESTS ON SUMMARY OUTPUT FORMAT (NN+HMM) ###
16 ###############################################
20 'id' => 'BC1G_00003.1',
21 'pred' => 'Signal peptide',
22 'nnpred' => 'signal-peptide',
28 'id' => 'BC1G_00008.1',
29 'pred' => 'Non-secretory protein',
30 'nnpred' => 'signal-peptide',
37 # Test on filtered results
38 my $facts = [qw(maxS D)];
39 my $in = test_input_file("signalp.summary");
40 my $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
48 while(my $feat = $signalp->next_feature()){
50 is($feat->seq_id(), $res->{$i}->{id});
51 is($feat->end(), $res->{$i}->{end});
52 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
53 is(($feat->get_tag_values('anchorProb'))[0], $res->{$i}->{anchor});
54 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
55 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
59 # Tests without filters.
60 # It should by default only parses results with Ymax and meanS to mimic default behavior
61 # from Bio::Tools::Signalp
64 'id' => 'BC1G_00003.1',
65 'pred' => 'Signal peptide',
71 'id' => 'BC1G_00008.1',
72 'pred' => 'Non-secretory protein',
80 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
86 while(my $feat = $signalp->next_feature()){
87 is($feat->seq_id(), $res->{$i}->{id});
88 is($feat->end(), $res->{$i}->{end});
89 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
90 is(($feat->get_tag_values('anchorProb'))[0], $res->{$i}->{anchor});
91 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
95 #############################################
96 ### TESTS ON SHORT OUTPUT FORMAT (NN+HMM) ###
97 #############################################
101 'id' => 'BC1G_00003.1',
102 'pred' => 'Signal peptide',
103 'nnpred' => 'signal-peptide',
107 'id' => 'BC1G_00008.1',
108 'nnpred' => 'signal-peptide',
109 'pred' => 'Non-secretory protein',
113 'id' => 'BC1G_00009.1',
114 'nnpred' => 'signal-peptide',
115 'pred' => 'Non-secretory protein',
119 'id' => 'BC1G_00010.1',
120 'nnpred' => 'signal-peptide',
121 'pred' => 'Non-secretory protein',
127 # Test on filtered results
129 $in = test_input_file("signalp.short");
130 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
138 while(my $feat = $signalp->next_feature()){
139 is($feat->seq_id(), $res->{$i}->{id});
140 is($feat->end(), $res->{$i}->{end});
141 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
142 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
146 # Tests without filters.
147 # It should by default only parses results with Ymax and meanS to mimic default behavior
148 # from GPI::Bio::Tools::Signalp
151 'id' => 'BC1G_00003.1',
152 'pred' => 'Signal peptide',
154 'nnpred' => 'signal-peptide',
158 'id' => 'BC1G_00008.1',
159 'pred' => 'Non-secretory protein',
161 'nnpred' => 'signal-peptide',
167 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
173 while(my $feat = $signalp->next_feature()){
174 is($feat->seq_id(), $res->{$i}->{id});
175 is($feat->end(), $res->{$i}->{end});
176 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
177 is(($feat->get_tag_values('anchorProb'))[0], $res->{$i}->{anchor});
178 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
179 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
184 ###########################################
185 ### TESTS ON SUMMARY OUTPUT FORMAT (NN) ###
186 ###########################################
190 'id' => 'BC1G_00003.1',
191 'nnpred' => 'signal-peptide',
195 'id' => 'BC1G_00008.1',
196 'nnpred' => 'signal-peptide',
201 # Test on filtered results BROKEN
203 $in = test_input_file("signalp.nn.summary");
204 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
212 while(my $feat = $signalp->next_feature()){
214 is($feat->seq_id(), $res->{$i}->{id});
215 is($feat->end(), $res->{$i}->{end});
216 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
219 # Tests without filters.
220 # It should by default only parses results with Ymax and meanS to mimic default behavior
221 # from GPI::Bio::Tools::Signalp
224 'id' => 'BC1G_00003.1',
225 'nnpred' => 'signal-peptide',
229 'id' => 'BC1G_00008.1',
230 'nnpred' => 'signal-peptide',
234 'id' => 'BC1G_00009.1',
235 'nnpred' => 'signal-peptide',
239 'id' => 'BC1G_00010.1',
240 'nnpred' => 'signal-peptide',
245 #No filters required BROKEN
246 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
252 while(my $feat = $signalp->next_feature()){
254 is($feat->seq_id(), $res->{$i}->{id});
255 is($feat->end(), $res->{$i}->{end});
256 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
261 ############################################
262 ### TESTS ON SUMMARY OUTPUT FORMAT (HMM) ###
263 ############################################
267 'id' => 'BC1G_00002.1',
271 'pred' => 'Non-secretory protein',
275 'id' => 'BC1G_00003.1',
279 'pred' => 'Signal peptide',
283 'id' => 'BC1G_00004.1',
287 'pred' => 'Non-secretory protein',
291 'id' => 'BC1G_00005.1',
295 'pred' => 'Non-secretory protein',
299 'id' => 'BC1G_00006.1',
303 'pred' => 'Non-secretory protein',
307 'id' => 'BC1G_00007.1',
311 'pred' => 'Non-secretory protein',
315 'id' => 'BC1G_00008.1',
319 'pred' => 'Non-secretory protein',
323 'id' => 'BC1G_00009.1',
327 'pred' => 'Non-secretory protein',
332 # It is impossible to filter with hmm output...
333 $in = test_input_file("signalp.hmm.summary");
334 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
341 while(my $feat = $signalp->next_feature()){
342 is($feat->seq_id(), $res->{$i}->{id});
343 is($feat->end(), $res->{$i}->{end});
344 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
345 is(($feat->get_tag_values('anchorProb'))[0], $res->{$i}->{anchor});
346 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
347 is(($feat->get_tag_values('cleavageSiteProb'))[0], $res->{$i}->{cleav});
351 #########################################
352 ### TESTS ON SHORT OUTPUT FORMAT (NN) ###
353 #########################################
357 'id' => 'BC1G_00003.1',
358 'nnpred' => 'signal-peptide',
365 'id' => 'BC1G_00008.1',
369 'nnpred' => 'signal-peptide',
374 # Test on filtered results
376 $in = test_input_file("signalp.nn.short");
377 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
385 while(my $feat = $signalp->next_feature()){
386 is($feat->seq_id(), $res->{$i}->{id});
387 is($feat->end(), $res->{$i}->{end});
388 is(($feat->get_tag_values('maxCprob'))[0], $res->{$i}->{cprob});
389 is(($feat->get_tag_values('Dprob'))[0], $res->{$i}->{dprob});
390 is(($feat->get_tag_values('maxYprob'))[0], $res->{$i}->{yprob});
391 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
394 # Tests without filters.
395 # It should by default only parses results with Ymax and meanS to mimic default behavior
396 # from GPI::Bio::Tools::Signalp
399 'id' => 'BC1G_00003.1',
400 'nnpred' => 'signal-peptide',
407 'id' => 'BC1G_00008.1',
411 'nnpred' => 'signal-peptide',
417 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
423 while(my $feat = $signalp->next_feature()){
424 is($feat->seq_id(), $res->{$i}->{id});
425 is($feat->end(), $res->{$i}->{end});
426 is(($feat->get_tag_values('maxCprob'))[0], $res->{$i}->{cprob});
427 is(($feat->get_tag_values('Dprob'))[0], $res->{$i}->{dprob});
428 is(($feat->get_tag_values('maxYprob'))[0], $res->{$i}->{yprob});
429 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
433 ##########################################
434 ### TESTS ON SHORT OUTPUT FORMAT (HMM) ###
435 ##########################################
439 'id' => 'BC1G_00002.1',
442 'pred' => 'Non-secretory protein',
446 'id' => 'BC1G_00003.1',
449 'pred' => 'Signal peptide',
453 'id' => 'BC1G_00004.1',
456 'pred' => 'Non-secretory protein',
460 'id' => 'BC1G_00005.1',
463 'pred' => 'Non-secretory protein',
467 'id' => 'BC1G_00006.1',
470 'pred' => 'Non-secretory protein',
474 'id' => 'BC1G_00007.1',
477 'pred' => 'Non-secretory protein',
481 'id' => 'BC1G_00008.1',
484 'pred' => 'Non-secretory protein',
488 'id' => 'BC1G_00009.1',
491 'pred' => 'Non-secretory protein',
496 # No filters available with hmm on short output
497 $in = test_input_file("signalp.hmm.short");
498 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
505 while(my $feat = $signalp->next_feature()){
506 is($feat->seq_id(), $res->{$i}->{id});
507 is($feat->end(), $res->{$i}->{end});
508 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
509 is(($feat->get_tag_values('cleavageSiteProb'))[0], $res->{$i}->{cleav});
510 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});