3
#Some simple test, nothing fancy...
8
# to handle systems with no installed Test module
9
# we include the t dir (where a copy of Test.pm is located)
11
eval { require Test; };
19
use Bio::Matrix::PSM::SiteMatrix;
29
my %param=(pA=>$A,pC=>$C,pG=>$G,pT=>$T,e_val=>$eval, correction =>0);
30
my $matrix=new Bio::Matrix::PSM::SiteMatrix(%param);
34
ok $matrix->IUPAC,'ATMCK';
36
ok $matrix->consensus,'ATACT';
42
ok $matrix->get_string('A'),$A;
44
my %x= (base=>'A',pA=>1,pC=>0,pG=>0,pT=>0,prob=>10,rel=>0);
45
ok $matrix->next_pos, %x;
49
ok $matrix->e_val(0.0001);
51
ok $matrix->e_val,0.0001;
53
#Now some PSM specific methods like regexp and matrix info
54
ok $matrix->regexp,'[Aa][Tt][AaCc][Cc][GgTt]';
55
my $regexp=$matrix->regexp;
56
ok 'ATCCT',"/$regexp/";
58
my @x=(1,0,0.5,0,0.1);
59
ok $matrix->get_array('A'),@x;
61
@x=qw(Aa Tt AaCc Cc GgTt);
62
ok $matrix->regexp_array,@x;
2
# $Id: SiteMatrix.t,v 1.4.6.3 2006/10/02 23:10:40 sendu Exp $
3
#Some simple test, nothing fancy...
8
$ENV{PERL_HASH_SEED} = 0;
12
# to handle systems with no installed Test module
13
# we include the t dir (where a copy of Test.pm is located)
15
eval { require Test; };
23
use Bio::Matrix::PSM::SiteMatrix;
33
my %param=(pA=>$A,pC=>$C,pG=>$G,pT=>$T,e_val=>$eval, correction =>0);
34
my $matrix=new Bio::Matrix::PSM::SiteMatrix(%param);
38
ok $matrix->IUPAC,'ABVCD';
40
ok $matrix->consensus,'ATACT';
46
ok $matrix->get_string('A'),$A;
48
my %x= (base=>'A',pA=>1,pC=>0,pG=>0,pT=>0,prob=>10,rel=>0,
49
lA=>undef,lC=>undef,lG=>undef,lT=>undef);
50
my %pos = $matrix->next_pos;
52
while(my ($k,$v) = each %x ) {
54
if( ! defined $v && ! defined $r) {
55
} elsif($pos{$k} ne $v ) {
64
ok $matrix->e_val(0.0001);
66
ok $matrix->e_val,0.0001;
68
#Now some PSM specific methods like regexp and matrix info
69
ok $matrix->regexp,'[Aa][CcGgTtBb][AaCcGgVv][Cc][AaGgTtDd]';
70
my $regexp=$matrix->regexp;
71
ok 'ATCCT',"/$regexp/";
73
my @x=(1,0,0.5,0,0.1);
74
ok $matrix->get_array('A'),@x;
76
@x=qw(Aa Tt AaCc Cc GgTt);
77
ok $matrix->regexp_array,@x;