1 # -*-Perl-*- Test Harness script for Bioperl
11 test_begin(-tests => 14);
13 use_ok('Bio::Matrix::PSM::SiteMatrix');
22 my %param=(pA=>$A,pC=>$C,pG=>$G,pT=>$T,e_val=>$eval, correction =>0);
23 ok my $matrix=Bio::Matrix::PSM::SiteMatrix->new(%param);
26 is $matrix->IUPAC,'ABVCD';
28 is $matrix->consensus,'ATACT';
34 is $matrix->get_string('A'),$A;
36 my %x= (base=>'A',pA=>1,pC=>0,pG=>0,pT=>0,prob=>10,rel=>0,
37 lA=>undef,lC=>undef,lG=>undef,lT=>undef);
38 my %pos = $matrix->next_pos;
40 while(my ($k,$v) = each %x ) {
42 if( ! defined $v && ! defined $r) {
43 } elsif($pos{$k} ne $v ) {
52 ok $matrix->e_val(0.0001);
54 is $matrix->e_val,0.0001;
56 #Now some PSM specific methods like regexp and matrix info
57 is $matrix->regexp,'[Aa][CcGgTtBb][AaCcGgVv][Cc][AaGgTtDd]';
59 my @x=(1,0,0.5,0,0.1);
60 is_deeply [$matrix->get_array('A')], \@x;
62 @x=qw([Aa] [CcGgTtBb] [AaCcGgVv] [Cc] [AaGgTtDd]);
63 is_deeply [$matrix->regexp_array], \@x;