6 test_begin(-tests => 3);
8 use_ok('Bio::Tools::PrositeScan');
9 use_ok('Bio::SeqFeature::FeaturePair');
12 # Note: data generated by running
14 # ./ps_scan.pl --pfscan ./pfscan -d prosite.dat -o fasta \
15 # t/data/test.fasta > t/data/ps_scan/out.PrositeScan
17 # followed by a manual removal of some of the output to simplify the test.
19 subtest "Predictions" => sub {
20 my $factory = Bio::Tools::PrositeScan->new(
21 '-file' => test_input_file('ps_scan/out.PrositeScan'),
25 my $expected_matches = [
26 { seq_id => 'roa1_drome', coords => [253, 256], psac => 'PS00001', subseq => 'NNSF' },
27 { seq_id => 'roa1_drome', coords => [270, 273], psac => 'PS00001', subseq => 'NNSW' },
28 { seq_id => 'roa2_drome', coords => [344, 349], psac => 'PS00008', subseq => 'GNNQGF' },
29 { seq_id => 'roa2_drome', coords => [217, 355], psac => 'PS50321', subseq => re(qr/NR.{135}NN/) },
32 my $actual_matches = [];
33 while( my $match = $factory->next_prediction ) {
34 push @$actual_matches, {
35 seq_id => $match->seq_id,
36 coords => [ $match->start, $match->end ],
37 psac => $match->hseq_id,
38 subseq => $match->feature1->seq->seq,
42 cmp_deeply( $actual_matches, $expected_matches, 'Comparing parsed prediction input' );