1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 14);
12 use_ok('Bio::Align::Utilities', qw(:all));
13 use_ok('Bio::SimpleAlign');
14 use_ok('Bio::PrimarySeq');
15 use_ok('Bio::LocatableSeq');
16 use_ok('Bio::AlignIO');
19 my $DEBUG = test_debug();
21 my $aa_align = Bio::SimpleAlign->new();
22 $aa_align->add_seq(Bio::LocatableSeq->new(-id => "n1", -seq => "MLIDVG-MLVLR"));
23 $aa_align->add_seq(Bio::LocatableSeq->new(-id => "n2", -seq => "MLIDVRTPLALR"));
24 $aa_align->add_seq(Bio::LocatableSeq->new(-id => "n3", -seq => "MLI-VR-SLALR"));
27 $dnaseqs{'n1'} = Bio::PrimarySeq->new(-id => "n1dna", -seq => 'atgctgatagacgtaggcatgctagtactgaga');
28 $dnaseqs{'n2'} = Bio::PrimarySeq->new(-id => "n2dna", -seq => 'atgctgatcgacgtacgcaccccgctagcactcaga');
29 $dnaseqs{'n3'} = Bio::PrimarySeq->new(-id => "n3dna", -seq => 'atgttgattgtacgctcgcttgcacttaga');
32 ok( $dna_aln = &aa_to_dna_aln($aa_align, \%dnaseqs));
34 Bio::AlignIO->new(-format=>'clustalw')->write_aln($dna_aln);
37 is $dna_aln->length, 36;
38 is $dna_aln->num_residues, 99;
39 is $dna_aln->num_sequences, 3;
40 is $dna_aln->consensus_string(50), "atgctgat?gacgtacgc????cgctagcact?aga";
42 my @dnaseqs = $dna_aln->each_seq;
43 is $dnaseqs[0]->display_id, 'n1dna';
44 $dna_aln->verbose(-1);
46 ok $replicates = &bootstrap_replicates($dna_aln,3);
48 is scalar @$replicates, 3;
49 my $repl_aln = pop @$replicates;
50 is $repl_aln->num_sequences, 3;
55 ##my $out = IO::String->new($string);
57 ##my $strout = Bio::AlignIO->new(-fh => $out,'-format' => 'pfam');
58 ##$strout->write_aln($repl_aln);