1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 185);
12 use_ok('Bio::Tools::Signalp::ExtendedSignalp');
15 ###############################################
16 ### TESTS ON SUMMARY OUTPUT FORMAT (NN+HMM) ###
17 ###############################################
21 'id' => 'BC1G_00003.1',
22 'pred' => 'Signal peptide',
23 'nnpred' => 'signal-peptide',
29 'id' => 'BC1G_00008.1',
30 'pred' => 'Non-secretory protein',
31 'nnpred' => 'signal-peptide',
38 # Test on filtered results
39 my $facts = [qw(maxS D)];
40 my $in = test_input_file("signalp.summary");
41 my $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
49 while(my $feat = $signalp->next_feature()){
51 is($feat->seq_id(), $res->{$i}->{id});
52 is($feat->end(), $res->{$i}->{end});
53 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
54 is(($feat->get_tag_values('anchorProb'))[0], $res->{$i}->{anchor});
55 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
56 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
60 # Tests without filters.
61 # It should by default only parses results with Ymax and meanS to mimic default behavior
62 # from Bio::Tools::Signalp
65 'id' => 'BC1G_00003.1',
66 'pred' => 'Signal peptide',
72 'id' => 'BC1G_00008.1',
73 'pred' => 'Non-secretory protein',
81 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
87 while(my $feat = $signalp->next_feature()){
88 is($feat->seq_id(), $res->{$i}->{id});
89 is($feat->end(), $res->{$i}->{end});
90 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
91 is(($feat->get_tag_values('anchorProb'))[0], $res->{$i}->{anchor});
92 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
96 #############################################
97 ### TESTS ON SHORT OUTPUT FORMAT (NN+HMM) ###
98 #############################################
102 'id' => 'BC1G_00003.1',
103 'pred' => 'Signal peptide',
104 'nnpred' => 'signal-peptide',
108 'id' => 'BC1G_00008.1',
109 'nnpred' => 'signal-peptide',
110 'pred' => 'Non-secretory protein',
114 'id' => 'BC1G_00009.1',
115 'nnpred' => 'signal-peptide',
116 'pred' => 'Non-secretory protein',
120 'id' => 'BC1G_00010.1',
121 'nnpred' => 'signal-peptide',
122 'pred' => 'Non-secretory protein',
128 # Test on filtered results
130 $in = test_input_file("signalp.short");
131 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
139 while(my $feat = $signalp->next_feature()){
140 is($feat->seq_id(), $res->{$i}->{id});
141 is($feat->end(), $res->{$i}->{end});
142 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
143 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
147 # Tests without filters.
148 # It should by default only parses results with Ymax and meanS to mimic default behavior
149 # from GPI::Bio::Tools::Signalp
152 'id' => 'BC1G_00003.1',
153 'pred' => 'Signal peptide',
155 'nnpred' => 'signal-peptide',
159 'id' => 'BC1G_00008.1',
160 'pred' => 'Non-secretory protein',
162 'nnpred' => 'signal-peptide',
168 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
174 while(my $feat = $signalp->next_feature()){
175 is($feat->seq_id(), $res->{$i}->{id});
176 is($feat->end(), $res->{$i}->{end});
177 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
178 is(($feat->get_tag_values('anchorProb'))[0], $res->{$i}->{anchor});
179 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
180 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
185 ###########################################
186 ### TESTS ON SUMMARY OUTPUT FORMAT (NN) ###
187 ###########################################
191 'id' => 'BC1G_00003.1',
192 'nnpred' => 'signal-peptide',
196 'id' => 'BC1G_00008.1',
197 'nnpred' => 'signal-peptide',
202 # Test on filtered results BROKEN
204 $in = test_input_file("signalp.nn.summary");
205 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
213 while(my $feat = $signalp->next_feature()){
215 is($feat->seq_id(), $res->{$i}->{id});
216 is($feat->end(), $res->{$i}->{end});
217 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
220 # Tests without filters.
221 # It should by default only parses results with Ymax and meanS to mimic default behavior
222 # from GPI::Bio::Tools::Signalp
225 'id' => 'BC1G_00003.1',
226 'nnpred' => 'signal-peptide',
230 'id' => 'BC1G_00008.1',
231 'nnpred' => 'signal-peptide',
235 'id' => 'BC1G_00009.1',
236 'nnpred' => 'signal-peptide',
240 'id' => 'BC1G_00010.1',
241 'nnpred' => 'signal-peptide',
246 #No filters required BROKEN
247 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
253 while(my $feat = $signalp->next_feature()){
255 is($feat->seq_id(), $res->{$i}->{id});
256 is($feat->end(), $res->{$i}->{end});
257 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
262 ############################################
263 ### TESTS ON SUMMARY OUTPUT FORMAT (HMM) ###
264 ############################################
268 'id' => 'BC1G_00002.1',
272 'pred' => 'Non-secretory protein',
276 'id' => 'BC1G_00003.1',
280 'pred' => 'Signal peptide',
284 'id' => 'BC1G_00004.1',
288 'pred' => 'Non-secretory protein',
292 'id' => 'BC1G_00005.1',
296 'pred' => 'Non-secretory protein',
300 'id' => 'BC1G_00006.1',
304 'pred' => 'Non-secretory protein',
308 'id' => 'BC1G_00007.1',
312 'pred' => 'Non-secretory protein',
316 'id' => 'BC1G_00008.1',
320 'pred' => 'Non-secretory protein',
324 'id' => 'BC1G_00009.1',
328 'pred' => 'Non-secretory protein',
333 # It is impossible to filter with hmm output...
334 $in = test_input_file("signalp.hmm.summary");
335 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
342 while(my $feat = $signalp->next_feature()){
343 is($feat->seq_id(), $res->{$i}->{id});
344 is($feat->end(), $res->{$i}->{end});
345 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
346 is(($feat->get_tag_values('anchorProb'))[0], $res->{$i}->{anchor});
347 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});
348 is(($feat->get_tag_values('cleavageSiteProb'))[0], $res->{$i}->{cleav});
352 #########################################
353 ### TESTS ON SHORT OUTPUT FORMAT (NN) ###
354 #########################################
358 'id' => 'BC1G_00003.1',
359 'nnpred' => 'signal-peptide',
366 'id' => 'BC1G_00008.1',
370 'nnpred' => 'signal-peptide',
375 # Test on filtered results
377 $in = test_input_file("signalp.nn.short");
378 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
386 while(my $feat = $signalp->next_feature()){
387 is($feat->seq_id(), $res->{$i}->{id});
388 is($feat->end(), $res->{$i}->{end});
389 is(($feat->get_tag_values('maxCprob'))[0], $res->{$i}->{cprob});
390 is(($feat->get_tag_values('Dprob'))[0], $res->{$i}->{dprob});
391 is(($feat->get_tag_values('maxYprob'))[0], $res->{$i}->{yprob});
392 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
395 # Tests without filters.
396 # It should by default only parses results with Ymax and meanS to mimic default behavior
397 # from GPI::Bio::Tools::Signalp
400 'id' => 'BC1G_00003.1',
401 'nnpred' => 'signal-peptide',
408 'id' => 'BC1G_00008.1',
412 'nnpred' => 'signal-peptide',
418 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
424 while(my $feat = $signalp->next_feature()){
425 is($feat->seq_id(), $res->{$i}->{id});
426 is($feat->end(), $res->{$i}->{end});
427 is(($feat->get_tag_values('maxCprob'))[0], $res->{$i}->{cprob});
428 is(($feat->get_tag_values('Dprob'))[0], $res->{$i}->{dprob});
429 is(($feat->get_tag_values('maxYprob'))[0], $res->{$i}->{yprob});
430 is(($feat->get_tag_values('nnPrediction'))[0], $res->{$i}->{nnpred});
434 ##########################################
435 ### TESTS ON SHORT OUTPUT FORMAT (HMM) ###
436 ##########################################
440 'id' => 'BC1G_00002.1',
443 'pred' => 'Non-secretory protein',
447 'id' => 'BC1G_00003.1',
450 'pred' => 'Signal peptide',
454 'id' => 'BC1G_00004.1',
457 'pred' => 'Non-secretory protein',
461 'id' => 'BC1G_00005.1',
464 'pred' => 'Non-secretory protein',
468 'id' => 'BC1G_00006.1',
471 'pred' => 'Non-secretory protein',
475 'id' => 'BC1G_00007.1',
478 'pred' => 'Non-secretory protein',
482 'id' => 'BC1G_00008.1',
485 'pred' => 'Non-secretory protein',
489 'id' => 'BC1G_00009.1',
492 'pred' => 'Non-secretory protein',
497 # No filters available with hmm on short output
498 $in = test_input_file("signalp.hmm.short");
499 $signalp = Bio::Tools::Signalp::ExtendedSignalp->new(
506 while(my $feat = $signalp->next_feature()){
507 is($feat->seq_id(), $res->{$i}->{id});
508 is($feat->end(), $res->{$i}->{end});
509 is(($feat->get_tag_values('peptideProb'))[0], $res->{$i}->{prob});
510 is(($feat->get_tag_values('cleavageSiteProb'))[0], $res->{$i}->{cleav});
511 is(($feat->get_tag_values('signalpPrediction'))[0], $res->{$i}->{pred});