2 ## Bioperl Test Harness Script for Modules
5 # Before `make install' is performed this script should be runnable with
6 # `make test'. After `make install' it should work as `perl test.t'
12 # to handle systems with no installed Test module
13 # we include the t dir (where a copy of Test.pm is located)
15 eval { require Test; };
30 use Bio::Align::Utilities qw(aa_to_dna_aln bootstrap_replicates);
35 my $in = new Bio::AlignIO(-format => 'clustalw',
36 -file => Bio::Root::IO->catfile
37 ('t','data','pep-266.aln'));
38 my $aln = $in->next_aln();
42 my $seqin = new Bio::SeqIO(-format => 'fasta',
43 -file => Bio::Root::IO->catfile
44 ('t','data','cds-266.fas'));
45 # get the cds sequences
47 while( my $seq = $seqin->next_seq ) {
48 $cds_seq{$seq->display_id} = $seq;
51 my $cds_aln = &aa_to_dna_aln($aln,\%cds_seq);
53 my @aa_seqs = $aln->each_seq;
55 for my $cdsseq ( $cds_aln->each_seq ) {
56 my $peptrans = $cdsseq->translate();
57 my $aaseq = shift @aa_seqs;
58 ok($peptrans->seq(),$aaseq->seq());
61 my $bootstraps = &bootstrap_replicates($aln,10);
63 ok(scalar @$bootstraps, 10);