1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 24,
11 -requires_module => 'IO::String');
13 use_ok('Bio::LiveSeq::Mutator');
14 use_ok('Bio::LiveSeq::IO::BioPerl');
15 use_ok('Bio::Variation::IO');
18 $a = Bio::LiveSeq::Mutator->new();
21 is $a->numbering, 'coding';
22 ok $a->numbering('coding 1');
23 is $a->numbering, 'coding 1';
25 my $mt = Bio::LiveSeq::Mutation->new();
28 ok ($a->add_Mutation($mt));
29 my @each = $a->each_Mutation;
30 is( (scalar @each), 1 );
33 my $filename=test_input_file('ar.embl');
34 my $loader=Bio::LiveSeq::IO::BioPerl->load('-file' => "$filename");
35 my $gene_name='AR'; # was G6PD
37 my $gene=$loader->gene2liveseq('-gene_name' => $gene_name);
41 my $results = $a->change_gene();
44 # bug 1701 - mutations on intron/exon boundaries where codon is split
46 $loader = Bio::LiveSeq::IO::BioPerl->load( -db => 'EMBL',
47 -file => test_input_file('ssp160.embl.1')
49 # move across intron/exon boundaries, check expected mutations
50 my @positions = (3128..3129,3188..3189);
51 my @bases = (qw(C C T T));
52 my @expected = (qw(T683T T684P T684I T684T));
55 for my $pos (@positions) {
57 my $gene = $loader->gene2liveseq( -gene_name => 'ssp160');
58 my $mutation = Bio::LiveSeq::Mutation->new( -seq => $bases[$ct],
61 my $mutate = Bio::LiveSeq::Mutator->new( -gene => $gene,
62 -numbering => 'entry',
65 $mutate->add_Mutation( $mutation );
67 my $results = $mutate->change_gene();
69 ok(defined($results));
70 is($expected[$ct], $results->trivname);
75 my $io = IO::String->new($s);
76 my $out = Bio::Variation::IO->new('-fh' => $io,
79 ok($out->write($results));
80 ok ($s=~/DNA/ && $s=~/RNA/ && $s=~/AA/);