[BUG] bug 2598
[bioperl-live.git] / t / AAChange.t
blob1b0d8acaf01beac98d599056f74ececa4dd084ca
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN { 
7     use lib 't/lib';
8     use BioperlTest;
9     
10     test_begin(-tests => 27);
11         
12         use_ok('Bio::Variation::Allele');
13         use_ok('Bio::Variation::AAChange');
14         use_ok('Bio::Variation::RNAChange');
18 ok my $obj = Bio::Variation::AAChange->new();
19 isa_ok $obj, 'Bio::Variation::AAChange';
21 $obj->start(3);           
22 is $obj->start, 3;
24 $obj->end(3); 
25 is $obj->end, 3;
27 $obj->length(3);
29 is $obj->length, 3;
31 $obj->strand('1');  
32 is $obj->strand, '1';
34 is $obj->primary_tag, 'Variation';
36 $obj->source_tag('source');
37 is $obj->source_tag, 'source';
39 $obj->frame(2);   
40 is $obj->frame,2;
42 $obj->score(2);   
43 is $obj->score, 2;
45 $obj->isMutation(1); 
46 ok $obj->isMutation;
48 my $a1 = Bio::Variation::Allele->new(-seq => 'V');
49 $obj->allele_ori($a1);
51 is $obj->allele_ori->seq, 'V';
53 my $a2 = Bio::Variation::Allele->new('-seq' => 'A');
54 $obj->add_Allele($a2);
56 is $obj->allele_mut->seq, 'A';
58 is $obj->similarity_score, 0;
60 $obj->upStreamSeq('upStreamSeq'); 
61 is $obj->upStreamSeq, 'upStreamSeq';
63 $obj->dnStreamSeq('dnStreamSeq'); 
64 is $obj->dnStreamSeq, 'dnStreamSeq' ;
66 is $obj->label, 'substitution, conservative';
68 $obj->status('proven'); 
69 is $obj->status, 'proven';
71 $obj->proof('experimental'); 
72 is $obj->proof, 'experimental';
74 $obj->region('region'); 
75 is $obj->region, 'region';
77 $obj->region_value('region_value'); 
78 is $obj->region_value, 'region_value';
80 $obj->numbering('coding'); 
81 is $obj->numbering, 'coding';
83 my $obj2 = Bio::Variation::RNAChange->new(-start => 7, 
84                                           -end => 7,
85                                           -cds_end => 100,
86                                           -codon_pos => 1,
87                                           -upStreamSeq => 'acgcgcgcgc',
88                                           -dnStreamSeq => 'acgcgcgcgc'
89                                           );
90 $obj2->label('missense');
91 $obj->RNAChange($obj2);
93 is $obj->trivname, 'V3A', "Trivial name is [". $obj->trivname. "]";
95 $obj->mut_number(2);
96 is $obj->mut_number, 2;