~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to t/DNAMutation.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

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.7 2002/03/20 13:08:04 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 => 36 }
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;
126
 
 
127
 
 
128
 
$obj = Bio::Variation::DNAMutation->new
129
 
    ('-start'         => 23,
130
 
     '-end'           => 24,
131
 
     '-length'        => 2,
132
 
     '-upStreamSeq'   => 'gt',
133
 
     '-dnStreamSeq'   => 'at',
134
 
     '-proof'         => 'experimental',
135
 
     '-isMutation'    => 1,
136
 
     '-mut_number'    => 2
137
 
     );
138
 
 
139
 
ok $obj->start(), 23;
140
 
ok $obj->end(), 24;
141
 
ok $obj->length(), 2;
142
 
ok $obj->upStreamSeq(), 'gt';
143
 
ok $obj->dnStreamSeq(), 'at';
144
 
ok $obj->proof(), 'experimental';
145
 
ok $obj->mut_number(), 2;
146
 
ok $obj->isMutation;