1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 14);
12 use_ok('Bio::Matrix::PSM::SiteMatrix');
21 my %param=(pA=>$A,pC=>$C,pG=>$G,pT=>$T,e_val=>$eval, correction =>0);
22 ok my $matrix=Bio::Matrix::PSM::SiteMatrix->new(%param);
25 is $matrix->IUPAC,'ABVCD';
27 is $matrix->consensus,'ATACT';
33 is $matrix->get_string('A'),$A;
35 my %x= (base=>'A',pA=>1,pC=>0,pG=>0,pT=>0,prob=>10,rel=>0,
36 lA=>undef,lC=>undef,lG=>undef,lT=>undef);
37 my %pos = $matrix->next_pos;
39 while(my ($k,$v) = each %x ) {
41 if( ! defined $v && ! defined $r) {
42 } elsif($pos{$k} ne $v ) {
51 ok $matrix->e_val(0.0001);
53 is $matrix->e_val,0.0001;
55 #Now some PSM specific methods like regexp and matrix info
56 is $matrix->regexp,'[Aa][CcGgTtBb][AaCcGgVv][Cc][AaGgTtDd]';
58 my @x=(1,0,0.5,0,0.1);
59 is_deeply [$matrix->get_array('A')], \@x;
61 @x=qw([Aa] [CcGgTtBb] [AaCcGgVv] [Cc] [AaGgTtDd]);
62 is_deeply [$matrix->regexp_array], \@x;