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 eval { require Test::More; };
19 use_ok('Bio::Align::Utilities',qw(aa_to_dna_aln bootstrap_replicates) );
20 use_ok('Bio::AlignIO');
21 use_ok('Bio::Root::IO');
27 my $in = new Bio::AlignIO(-format => 'clustalw',
28 -file => Bio::Root::IO->catfile
29 ('t','data','pep-266.aln'));
30 my $aln = $in->next_aln();
31 isa_ok($aln, 'Bio::Align::AlignI');
34 my $seqin = new Bio::SeqIO(-format => 'fasta',
35 -file => Bio::Root::IO->catfile
36 ('t','data','cds-266.fas'));
37 # get the cds sequences
39 while( my $seq = $seqin->next_seq ) {
40 $cds_seq{$seq->display_id} = $seq;
43 my $cds_aln = &aa_to_dna_aln($aln,\%cds_seq);
45 my @aa_seqs = $aln->each_seq;
47 for my $cdsseq ( $cds_aln->each_seq ) {
48 my $peptrans = $cdsseq->translate();
49 my $aaseq = shift @aa_seqs;
50 is($peptrans->seq(),$aaseq->seq());
53 my $bootstraps = &bootstrap_replicates($aln,10);
55 is(scalar @$bootstraps, 10);