1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 44);
12 use_ok('Bio::Variation::SeqDiff');
13 use_ok('Bio::Variation::DNAMutation');
14 use_ok('Bio::Variation::Allele');
17 my ($obj, $mm, $aa, $dna, $m);
19 ok $obj = Bio::Variation::SeqDiff->new();
24 ok $obj->sysname('sysname');
25 is $obj->sysname, 'sysname';
27 $obj->trivname('trivname');
28 is $obj->trivname, 'trivname';
30 ok $obj->chromosome('chr');
31 is $obj->chromosome, 'chr';
33 ok $obj->description('desc');
34 is $obj->description, 'desc';
36 ok $obj->numbering('numbering');
37 is $obj->numbering, 'numbering';
41 # 12345678901234567890
42 ok $obj->dna_ori ('gctgctgatcgatcgtagctagctag');
43 is $obj->dna_ori, 'gctgctgatcgatcgtagctagctag';
45 # generate mutated DNA seq from the mutation
46 ok $m = Bio::Variation::DNAMutation->new(-isMutation => 1, -start=>14, -end=>14);
47 ok $a = Bio::Variation::Allele->new(-seq=>'c');
48 $b = Bio::Variation::Allele->new(-seq=>'g');
49 ok $m->allele_ori($a);
50 ok $m->allele_mut($b);
51 ok $obj->add_Variant($m);
52 my $m2 = Bio::Variation::DNAMutation->new(-isMutation => 1, -start=>19, -end=>19);
53 my $a2 = Bio::Variation::Allele->new(-seq=>'c');
54 my $b2 = Bio::Variation::Allele->new(-seq=>'g');
57 $obj->add_Variant($m2);
59 #ok $obj->dna_mut('gctgctgatcggtcgtagctagctag');
60 is $obj->dna_mut, 'gctgctgatcgatggtaggtagctag';
62 ok $obj->rna_ori('gctgctgatcgatcgtagctagctag');
63 is $obj->rna_ori, 'gctgctgatcgatcgtagctagctag';
65 $obj->rna_mut('gctgctgatcgatcgtagctagctag');
66 is $obj->rna_mut, 'gctgctgatcgatcgtagctagctag';
68 ok $obj->aa_ori('MHYTRD');
69 is $obj->aa_ori, 'MHYTRD';
71 ok $obj->aa_mut('MHGTRD');
72 is $obj->aa_mut, 'MHGTRD';
74 foreach $mm ( $obj->each_Variant ) {
75 $mm->primary_tag('a');
76 isa_ok($mm,'Bio::Variation::VariantI');
80 ok $obj->gene_symbol('fos');
81 is $obj->gene_symbol, 'fos';
83 ok $obj->rna_offset(10);
84 is $obj->rna_offset, 10;
86 ok $obj->rna_id('transcript#3');
87 is $obj->rna_id, 'transcript#3';
89 ok $dna = $obj->seqobj('dna_ori');
90 isa_ok($dna,'Bio::PrimarySeq');
93 $aa = $obj->seqobj('aa_mut');
97 $dna = $obj->seqobj('dna_ri');