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