2 ## Bioperl Test Harness Script for Modules
8 test_begin(-tests => 18);
9 use_ok('Bio::Tools::Run::Alignment::DBA');
10 use_ok('Bio::SimpleAlign');
11 use_ok('Bio::AlignIO');
16 my @params = ('matchA' => 0.75, 'matchB' => '0.55','dymem'=>'linear');
17 my $factory = Bio::Tools::Run::Alignment::DBA->new(@params);
20 test_skip(-requires_executable => $factory,
23 isa_ok $factory,'Bio::Tools::Run::Alignment::DBA';
25 $factory->quiet($bequiet); # Suppress clustal messages to terminal
27 #test with one file with 2 sequences
28 my $inputfilename_1a = test_input_file("dba1a.fa");
29 my $inputfilename_1b = test_input_file("dba1b.fa");
30 my $inputfilename2 = test_input_file("dba2.fa");
32 my @hsps = $factory->align($inputfilename2);
33 isa_ok($hsps[0],"Bio::Search::HSP::GenericHSP");
34 is($hsps[0]->query->start,4);
35 is($hsps[0]->query->end,209);
38 #test with 2 files of 1 sequence each
39 my @files = ($inputfilename_1a,$inputfilename_1b);
40 @hsps = $factory->align(\@files);
41 is($hsps[0]->query->start,3);
42 is($hsps[0]->query->end,88);
44 is($hsps[1]->hit->start,90);
45 is($hsps[1]->hit->end,195);
48 #test with an array of 2 PrimarySeqI objects
50 my $str = Bio::SeqIO->new(-file=> test_input_file("dba2.fa"), '-format' => 'Fasta');
53 while ( my $seq = $str->next_seq() ) {
54 push (@seq_array, $seq) ;
56 @hsps = $factory->align(\@seq_array);
57 is($hsps[0]->query->start,4);
58 is($hsps[0]->query->end,209);