test commits after fsfs transfer
[bioperl-live.git] / t / DNAMutation.t
blobddf2fb2c3ac0ca6057a4a880e3698e466594a3d5
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 => 37);
11         
12         use_ok('Bio::Variation::DNAMutation');
13         use_ok('Bio::Variation::Allele');
16 my($obj,$a1,$a2,$obj2);
17 $obj = Bio::Variation::DNAMutation -> new;
19 ok defined $obj;
21 $obj->start(3);           
22 is $obj->start, 3;
24 $obj->end(3); 
25 is $obj->end, 3;
27 $obj->length(2);
28 is $obj->length, 2;
30 $obj->strand('1');  
31 is $obj->strand, '1';
33 is $obj->primary_tag, 'Variation';
35 $obj->source_tag('source');
36 is $obj->source_tag, 'source';
38 $obj->frame(2);   
39 is $obj->frame,2;
41 $obj->score(2);   
42 is $obj->score, 2;
44 if( $obj->can('dna_mut') ) {
45         #test gff string
46     $obj->dna_mut('dna_mut'); 
47     is( $obj->dna_mut,'dna_mut');
50 $a1 = Bio::Variation::Allele->new(-seq => 'c');
51 $obj->allele_ori($a1);
53 is $obj->allele_ori->seq, 'c';
55 $a2 = Bio::Variation::Allele->new('-seq' => 'g');
56 $obj->allele_mut($a2);
58 is $obj->allele_mut->seq, 'g';
60 $obj->upStreamSeq('agcacctcccggcgccagtttgctg'); 
61 is $obj->upStreamSeq, 'agcacctcccggcgccagtttgctg';
63 $obj->dnStreamSeq('tgctgcagcagcagcagcagcagca'); 
64 is $obj->dnStreamSeq, 'tgctgcagcagcagcagcagcagca';
67 is $obj->label, 'point, transversion' ;
69 $obj->status('proven'); 
70 is $obj->status, 'proven';
73 $obj->proof('experimental'); 
74 is $obj->proof, 'experimental';
77 is $obj->restriction_changes, '-BbvI, +BstXI, -Fnu4HI, -TseI';
79 $obj->region('region'); 
80 is $obj->region, 'region';
82 $obj->region_value('region_value'); 
83 is $obj->region_value, 'region_value';
85 $obj->region_dist(-5); 
86 is $obj->region_dist, -5;
88 $obj->numbering('coding'); 
89 is $obj->numbering, 'coding';
91 ok not $obj->CpG;
93 $obj->mut_number(2);
94 is $obj->mut_number, 2;
97 ok defined ($obj2 = Bio::Variation::DNAMutation -> new
98             ('-mut_number' => 2));
100 is $obj2->mut_number, 2;
103 $obj->isMutation(1); 
104 ok $obj->isMutation;
106 $obj->add_Allele($a1);
107 $obj->add_Allele($a2);
109 is scalar ($obj->each_Allele), 2;
112 $obj = Bio::Variation::DNAMutation->new
113     ('-start'         => 23,
114      '-end'           => 24,
115      '-length'        => 2,
116      '-upStreamSeq'   => 'gt',
117      '-dnStreamSeq'   => 'at',
118      '-proof'         => 'experimental',
119      '-isMutation'    => 1,
120      '-mut_number'    => 2
121      );
123 is $obj->start(), 23;
124 is $obj->end(), 24;
125 is $obj->length(), 2;
126 is $obj->upStreamSeq(), 'gt';
127 is $obj->dnStreamSeq(), 'at';
128 is $obj->proof(), 'experimental';
129 is $obj->mut_number(), 2;
130 ok $obj->isMutation;