2 ## Bioperl Test Harness Script for Modules
8 test_begin(-tests => 23);
9 use_ok('Bio::Tools::Run::Alignment::Sim4');
10 use_ok('Bio::SimpleAlign');
11 use_ok('Bio::AlignIO');
17 my $cdna = test_input_file("sim4_cdna.fa");
18 my $genomic = test_input_file("sim4_genomic.fa");
19 my @params = (W=>15,K=>17,D=>10,N=>10,cdna_seq=>$cdna,genomic_seq=>$genomic);
20 my $factory = Bio::Tools::Run::Alignment::Sim4->new(@params);
23 test_skip(-requires_executable => $factory,
25 isa_ok $factory,'Bio::Tools::Run::Alignment::Sim4';
27 $factory->quiet($bequiet); # Suppress clustal messages to terminal
29 #test by having inputs in constructor
30 my @exon_set = $factory->align;
32 my @exons = $exon_set[0]->sub_SeqFeature;
33 is $exons[0]->start, 26;
34 is $exons[0]->end, 268;
35 is $exons[0]->strand, 1;
38 my $sio = Bio::SeqIO->new(-file=>$cdna,-format=>"fasta");
39 my $sio2 = Bio::SeqIO->new(-file=>$genomic,-format=>"fasta");
43 while(my $seq = $sio->next_seq){
47 while(my $seq = $sio2->next_seq){
48 push @genomic_seq,$seq;
51 @exon_set = $factory->align($cdna_seq[0],$genomic_seq[0]);
53 @exons = $exon_set[0]->sub_SeqFeature;
54 is $exons[0]->start, 26;
55 is $exons[0]->end, 268;
56 is $exons[0]->strand, 1;
58 #test with cdna database as file
60 my $db = test_input_file("sim4_database.fa");
61 @params = (W=>15,K=>17,D=>10,N=>10,cdna_seq=>$db,genomic_seq=>$genomic);
62 $factory = Bio::Tools::Run::Alignment::Sim4->new(@params);
64 @exon_set = $factory->align();
65 @exons = $exon_set[0]->sub_SeqFeature;
66 is $exons[0]->start, 26;
67 is $exons[0]->end, 268;
68 is $exons[0]->strand, 1;
70 @exons = $exon_set[1]->sub_SeqFeature;
71 is $exons[0]->start, 26;
72 is $exons[0]->end, 268;
73 is $exons[0]->strand, 1;
76 #test with cdna database as object
78 $sio = Bio::SeqIO->new(-file=>$db,-format=>"fasta");
80 while(my $seq = $sio->next_seq){
84 $factory->align(\@cdna_seq,$genomic);
86 @exon_set = $factory->align();
87 @exons = $exon_set[0]->sub_SeqFeature;
88 is $exons[0]->start, 26;
89 is $exons[0]->end, 268;
90 is $exons[0]->strand, 1;
92 @exons = $exon_set[1]->sub_SeqFeature;
93 is $exons[0]->start, 26;
94 is $exons[0]->end, 268;
95 is $exons[0]->strand, 1;