2 ## Bioperl Test Harness Script for Modules
7 test_begin(-tests => 11);
8 use_ok(' Bio::Tools::Run::Alignment::Probcons');
9 use_ok(' Bio::AlignIO');
10 use_ok(' Bio::SeqIO');
13 END { unlink qw(cysprot.dnd cysprot1a.dnd) }
16 my $factory = Bio::Tools::Run::Alignment::Probcons->new(@params);
17 my $inputfilename = test_input_file('cysprot.fa');
21 test_skip(-requires_executable => $factory,
23 my $version = $factory->version;
24 cmp_ok ($version, '>=', 1.09, "Code tested only on probcons versions > 1.09" );
25 $aln = $factory->align($inputfilename);
27 is( $aln->num_sequences, 7);
29 my $str = Bio::SeqIO->new('-file' => $inputfilename,
30 '-format' => 'Fasta');
33 while ( my $seq = $str->next_seq() ) {
34 push (@seq_array, $seq) ;
37 my $seq_array_ref = \@seq_array;
39 $aln = $factory->align($seq_array_ref);
40 is $aln->num_sequences, 7;
41 my $s1_avg_perid = $aln->average_percentage_identity;
42 is(int($s1_avg_perid), 43);
43 my $s1_ovl_perid = $aln->overall_percentage_identity;
44 is(int($s1_ovl_perid), 15);
46 my ($paramsfilename) = test_output_file();
47 my ($annotfilename) = test_output_file();
48 my ($dummyfilename) = test_output_file();
49 my $factory2 = Bio::Tools::Run::Alignment::Probcons->new
51 'iterative-refinement' => '1000',
55 'train' => $paramsfilename,
57 $factory2->outfile_name($dummyfilename);
59 my $aln2 = $factory2->align($seq_array_ref);
63 $factory2 = Bio::Tools::Run::Alignment::Probcons->new
65 'iterative-refinement' => '1000',
67 'annot' => $annotfilename,
68 'paramfile' => $paramsfilename,
70 $factory->outfile_name($dummyfilename);
71 $aln2 = $factory2->align($seq_array_ref);
72 my $s2_avg_perid = $aln2->average_percentage_identity;
73 my $s2_ovl_perid = $aln2->overall_percentage_identity;
74 cmp_ok(int($s2_avg_perid), '>=', 42);
75 cmp_ok(int($s2_ovl_perid), '>=', 15);
79 if (-e 'iterative-refinement') {
80 unlink('iterative-refinement');