1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 39);
12 use_ok('Bio::SeqEvolution::Factory');
13 use_ok('Bio::PrimarySeq');
20 ok my $evolve = Bio::SeqEvolution::Factory->new (-verbose => 1);
21 isa_ok $evolve, 'Bio::SeqEvolution::DNAPoint';
23 ok $evolve = Bio::SeqEvolution::DNAPoint->new (-verbose => 2);
24 isa_ok $evolve, 'Bio::SeqEvolution::DNAPoint';
26 ok $evolve = Bio::SeqEvolution::Factory->new (-verbose => 3,
27 -type => 'Bio::SeqEvolution::DNAPoint');
28 isa_ok $evolve, 'Bio::SeqEvolution::DNAPoint';
31 my $seq = Bio::PrimarySeq->new(-id=>'test',
35 ok $evolve = Bio::SeqEvolution::Factory->new (-verbose => 0,
41 is $evolve->seq->id, 'test';
42 is $evolve->rate, 5, 'get rate()';
43 is $evolve->rate(2), 2, 'get and set rate()';
46 is $evolve->identity(80), 80, 'identity()';
47 is $evolve->identity(undef), undef, 'identity()';
49 is $evolve->pam, undef, 'pam()';
50 is $evolve->pam(80), 80, 'pam()';
52 is $evolve->mutation_count, undef, 'mutation_count()';
53 is $evolve->mutation_count(5), 5, , 'mutation_count()';
57 is $evolve->seq_type, 'Bio::PrimarySeq', 'seq_type()';
58 is $evolve->seq_type('Bio::Seq'), 'Bio::Seq', 'seq_type()';
60 ok my $newseq = $evolve->next_seq, 'next_seq()';
62 foreach ( $evolve->each_mutation('string')) {
65 is $evolve->each_mutation, 5, 'each_mutation()';
67 ok $evolve = Bio::SeqEvolution::Factory->new (-verbose => 0,
72 ok $newseq = $evolve->next_seq;
73 cmp_ok $evolve->get_alignment_identity, '<=', 50, "get_alignment_identity()";
75 ok $evolve = Bio::SeqEvolution::Factory->new (-verbose => 0,
80 ok $newseq = $evolve->next_seq;
81 is $evolve->get_mutation_counter, 6, 'get_mutation_counter()';
82 $newseq = $evolve->next_seq;
83 is $evolve->get_sequence_counter, 2, 'get_sequence_counter()';
84 ok $evolve->reset_sequence_counter(), 'reset_sequence_counter()';
85 is $evolve->get_sequence_counter, 0, 'get_sequence_counter() == 0';
87 ok $evolve = Bio::SeqEvolution::Factory->new (-verbose => 0,
93 ok $newseq = $evolve->next_seq;
94 # ok $evolve->get_alignment_identity <= 50, "get_alignment_identity()";
95 isa_ok $evolve->get_alignmet, 'Bio::SimpleAlign';
99 #print "-----------------------------------------\n";
100 #print $evolve->{'_ori_locatableseq'}->seq, "\n";
101 #print $evolve->{'_mut_locatableseq'}->seq, "\n";
102 #print $evolve->{'_align'}->overall_percentage_identity, "\n";
103 #print $evolve->get_mutation_counter, "\n";
104 #print "-----------------------------------------\n";
112 #use Bio::SeqEvolution::DNAIndel;
113 #ok $evolve = Bio::SeqEvolution::DNAIndel->new (-verbose => 0,
114 # -mutation_count => 3,
121 #ok $newseq = $evolve->next_seq;
122 #ok $evolve->get_mutation_counter, 3;
123 ##print Dumper $evolve;
125 #foreach ( $evolve->each_mutation) {
127 ## print $_->sysname, "\n";
132 #ok $evolve = Bio::SeqEvolution::DNAIndel->new (-verbose => 0,
135 # -mutation_count => 3,
139 ##$evolve->{'_mut_string'} = $evolve->{'_ori_string'};
141 ##ok $newseq = $evolve->mutate(12);
142 #ok $newseq = $evolve->next_seq;
143 ##print Dumper $evolve;
144 ##print $evolve->{'_ori_locatableseq'}->seq, "\n";
145 ##print $evolve->{'_mut_locatableseq'}->seq, "\n";
147 #print "-----------------------------------------\n";
148 #print $evolve->{'_ori_locatableseq'}->seq, "\n";
149 #print $evolve->{'_mut_locatableseq'}->seq, "\n";
150 #print $evolve->{'_align'}->overall_percentage_identity, "\n";
151 #print "-----------------------------------------\n";
159 #ok my $evolve2 = Bio::SeqEvolution::Factory->new (-verbose => 0,
162 # -set_mutated_seq => $newseq,
164 # -mutation_count => 1 ###
166 #ok $evolve2->seq_type('Bio::LocatableSeq');
168 #print "=-----------------------------------------\n";
169 #print $evolve2->{'_ori_locatableseq'}->seq, "\n";
170 #print $evolve2->{'_mut_locatableseq'}->seq, "\n";
171 #print $evolve2->{'_align'}->overall_percentage_identity, "\n";
172 #print "-----------------------------------------\n";
174 #ok $newseq = $evolve2->next_seq;
177 #print "-----------------------------------------\n";
178 #print $evolve2->{'_ori_locatableseq'}->seq, "\n";
179 #print $evolve2->{'_mut_locatableseq'}->seq, "\n";
180 #print $evolve2->{'_align'}->overall_percentage_identity, "\n";
181 #print "-----------------------------------------\n";