~ubuntu-branches/ubuntu/edgy/bioperl/edgy

« back to all changes in this revision

Viewing changes to t/DNAMutation.t

  • Committer: Bazaar Package Importer
  • Author(s): Matt Hope
  • Date: 2002-03-20 01:16:30 UTC
  • Revision ID: james.westby@ubuntu.com-20020320011630-wyvmxwc7o5bi4665
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*-
 
2
## Bioperl Test Harness Script for Modules
 
3
## $Id: DNAMutation.t,v 1.6 2001/04/01 17:54:59 heikki Exp $
 
4
 
 
5
# Before `make install' is performed this script should be runnable with
 
6
# `make test'. After `make install' it should work as `perl test.t'
 
7
 
 
8
use strict;
 
9
BEGIN {
 
10
    # to handle systems with no installed Test module
 
11
    # we include the t dir (where a copy of Test.pm is located)
 
12
    # as a fallback
 
13
    eval { require Test; };
 
14
    if( $@ ) {
 
15
        use lib 't';
 
16
    }
 
17
    use Test;
 
18
 
 
19
    plan tests => 28 }
 
20
 
 
21
use Bio::Variation::DNAMutation;
 
22
use Bio::Variation::Allele;
 
23
 
 
24
ok(1);
 
25
 
 
26
## End of black magic.
 
27
##
 
28
## Insert additional test code below but remember to change
 
29
## the print "1..x\n" in the BEGIN block to reflect the
 
30
## total number of tests that will be run. 
 
31
 
 
32
my($obj,$a1,$a2,$obj2);
 
33
$obj = Bio::Variation::DNAMutation -> new;
 
34
 
 
35
ok defined $obj;
 
36
 
 
37
$obj->start(3);           
 
38
ok $obj->start, 3;
 
39
 
 
40
$obj->end(3); 
 
41
ok $obj->end, 3;
 
42
 
 
43
$obj->length(2);
 
44
ok $obj->length, 2;
 
45
 
 
46
$obj->strand('1');  
 
47
ok $obj->strand, '1';
 
48
 
 
49
ok $obj->primary_tag, 'Variation';
 
50
 
 
51
$obj->source_tag('source');
 
52
ok $obj->source_tag, 'source';
 
53
 
 
54
$obj->frame(2);   
 
55
ok $obj->frame,2;
 
56
 
 
57
$obj->score(2);   
 
58
ok $obj->score, 2;
 
59
 
 
60
if( $obj->can('dna_mut') ) {
 
61
#test gff string
 
62
    $obj->dna_mut('dna_mut'); 
 
63
    ok( $obj->dna_mut,'dna_mut');
 
64
}
 
65
 
 
66
$a1 = Bio::Variation::Allele->new(-seq => 'c');
 
67
$obj->allele_ori($a1);
 
68
 
 
69
ok $obj->allele_ori->seq, 'c';
 
70
 
 
71
$a2 = Bio::Variation::Allele->new('-seq' => 'g');
 
72
$obj->allele_mut($a2);
 
73
 
 
74
ok $obj->allele_mut->seq, 'g';
 
75
 
 
76
$obj->upStreamSeq('agcacctcccggcgccagtttgctg'); 
 
77
ok $obj->upStreamSeq, 'agcacctcccggcgccagtttgctg';
 
78
 
 
79
$obj->dnStreamSeq('tgctgcagcagcagcagcagcagca'); 
 
80
ok $obj->dnStreamSeq, 'tgctgcagcagcagcagcagcagca';
 
81
 
 
82
 
 
83
ok $obj->label, 'point, transversion' ;
 
84
 
 
85
$obj->status('proven'); 
 
86
ok $obj->status, 'proven';
 
87
 
 
88
 
 
89
$obj->proof('experimental'); 
 
90
ok $obj->proof, 'experimental';
 
91
 
 
92
 
 
93
ok $obj->restriction_changes, '-BbvI, +BstXI, -Fnu4HI, -TseI';
 
94
 
 
95
$obj->region('region'); 
 
96
ok $obj->region, 'region';
 
97
 
 
98
$obj->region_value('region_value'); 
 
99
ok $obj->region_value, 'region_value';
 
100
 
 
101
$obj->region_dist(-5); 
 
102
ok $obj->region_dist, -5;
 
103
 
 
104
$obj->numbering('coding'); 
 
105
ok $obj->numbering, 'coding';
 
106
 
 
107
ok not $obj->CpG;
 
108
 
 
109
$obj->mut_number(2);
 
110
ok $obj->mut_number, 2;
 
111
 
 
112
 
 
113
ok defined ($obj2 = Bio::Variation::DNAMutation -> new
 
114
            ('-mut_number' => 2));
 
115
 
 
116
ok $obj2->mut_number, 2;
 
117
 
 
118
 
 
119
$obj->isMutation(1); 
 
120
ok $obj->isMutation;
 
121
 
 
122
$obj->add_Allele($a1);
 
123
$obj->add_Allele($a2);
 
124
 
 
125
ok scalar ($obj->each_Allele), 2;