1 # -*-Perl-*- Test Harness script for Bioperl
11 test_begin(-tests => 14);
13 use_ok 'Bio::Matrix::PSM::ProtMatrix';
18 '-id' => 'A. thaliana protein atp1',
20 '-ic' => [ '0.28', '0.40', '0.64', '0.68', '0.68', '0.70', '0.72', '0.72' ],
21 '-lS' => [ '-2', '3', '-3', '2', '-3', '1', '1', '3' ],
22 '-lF' => [ '-1', '-4', '0', '-5', '0', '-5', '-4', '-4' ],
23 '-lT' => [ '-1', '1', '0', '1', '-2', '-1', '0', '1' ],
24 '-lN' => [ '-3', '-1', '-2', '3', '-5', '5', '-2', '0' ],
25 '-lK' => [ '-2', '0', '-3', '2', '-3', '2', '-3', '-1' ],
26 '-lY' => [ '-2', '-3', '-3', '-4', '-3', '-4', '-4', '-4' ],
27 '-lE' => [ '-3', '4', '-3', '2', '-4', '-2', '-3', '2' ],
28 '-lV' => [ '0', '-2', '1', '-4', '1', '-4', '-1', '-3' ],
29 '-lQ' => [ '-1', '0', '-2', '3', '-4', '1', '-3', '0' ],
30 '-lM' => [ '8', '-3', '8', '-3', '1', '-3', '-3', '-3' ],
31 '-lC' => [ '-2', '-3', '-3', '-4', '-3', '-4', '-3', '-3' ],
32 '-lL' => [ '1', '-3', '1', '-4', '3', '-4', '-2', '-4' ],
33 '-lA' => [ '-2', '1', '-2', '0', '-2', '-2', '2', '2' ],
34 '-lW' => [ '-2', '-4', '-3', '-5', '-4', '-5', '-5', '-5' ],
35 '-lP' => [ '-3', '-2', '-4', '-3', '-1', '-3', '6', '-3' ],
36 '-lH' => [ '-2', '-2', '-3', '-2', '-5', '-2', '-2', '-3' ],
37 '-lD' => [ '-4', '-1', '-3', '1', '-3', '-1', '-3', '4' ],
38 '-lR' => [ '-2', '-1', '-3', '0', '-4', '4', '-4', '-3' ],
39 '-lI' => [ '0', '-3', '0', '-4', '6', '-4', '-2', '-2' ],
40 '-lG' => [ '-4', '-2', '-4', '-2', '-5', '-3', '-1', '-2' ],
41 '-pS' => [ '0', '33', '0', '16', '1', '12', '11', '25' ],
42 '-pF' => [ '0', '0', '2', '0', '3', '0', '0', '0' ],
43 '-pT' => [ '0', '8', '7', '10', '1', '2', '7', '8' ],
44 '-pN' => [ '0', '0', '2', '13', '0', '36', '1', '4' ],
45 '-pK' => [ '0', '5', '0', '13', '1', '15', '0', '2' ],
46 '-pY' => [ '0', '0', '0', '0', '0', '0', '0', '0' ],
47 '-pE' => [ '0', '41', '1', '12', '0', '0', '0', '15' ],
48 '-pV' => [ '0', '3', '9', '0', '2', '0', '3', '1' ],
49 '-pQ' => [ '0', '0', '0', '15', '0', '4', '0', '3' ],
50 '-pM' => [ '100', '0', '66', '0', '2', '0', '0', '0' ],
51 '-pC' => [ '0', '0', '0', '0', '0', '0', '0', '0' ],
52 '-pL' => [ '0', '0', '8', '0', '25', '0', '4', '0' ],
53 '-pA' => [ '0', '10', '1', '9', '2', '0', '22', '16' ],
54 '-pW' => [ '0', '0', '0', '0', '0', '0', '0', '0' ],
55 '-pP' => [ '0', '0', '0', '0', '3', '1', '45', '0' ],
56 '-pH' => [ '0', '0', '0', '0', '0', '0', '1', '0' ],
57 '-pD' => [ '0', '0', '1', '7', '2', '2', '0', '22' ],
58 '-pR' => [ '0', '0', '0', '3', '0', '27', '0', '0' ],
59 '-pI' => [ '0', '0', '3', '0', '59', '1', '2', '3' ],
60 '-pG' => [ '0', '0', '0', '1', '0', '0', '4', '1' ],
63 my $matrix = Bio::Matrix::PSM::ProtMatrix->new(%param);
67 is $matrix->IUPAC,'MEMSINPS';
69 is $matrix->consensus,'MEMSINPS';
75 is $matrix->get_string('A'), '0100a90200220160';
78 'base' => 'M', 'prob' => 100, 'rel' => 0,
121 my %x2 = $matrix->next_pos;
122 is_deeply \%x1, \%x2;
124 is $matrix->curpos,1;
126 ok $matrix->e_val(0.0001);
127 is $matrix->e_val,0.0001;
129 #Now some PSM specific methods like regexp and matrix info
131 my @a = ('0', '10', '1', '9', '2', '0', '22', '16');
132 is_deeply [$matrix->get_array('A')], \@a;
134 my $regexp = '[Mm][EeSs][Mm]\.[IiLl][RrNn][AaPp][DdSs]';
135 is $matrix->regexp, $regexp;
136 is $matrix->sequence_match_weight('MSMPLRPD'), 33;