| 1 | #!/usr/bin/env perl -w |
| 2 | |
| 3 | use TFBS::Matrix::PFM; |
| 4 | use Test; |
| 5 | plan(tests => 4); |
| 6 | # print STDERR join("\n", @INC); |
| 7 | |
| 8 | my $matrixstring = |
| 9 | "2 2 2 2 2 2 2 2\n0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0"; |
| 10 | |
| 11 | my $pfm = TFBS::Matrix::PFM->new(-matrix=>$matrixstring, |
| 12 | -name=>"MyMatrix"); |
| 13 | |
| 14 | my $pfmstring = $pfm->rawprint; |
| 15 | |
| 16 | my $icmstring = $pfm->to_ICM(-add_pseudocounts=>0)->rawprint; |
| 17 | |
| 18 | ok($pfmstring, $icmstring); |
| 19 | |
| 20 | ok(1, defined $pfm->to_ICM); |
| 21 | |
| 22 | my $pwmstring = $pfm->to_PWM->rawprint; |
| 23 | |
| 24 | my @pwmlines = split "\n", $pwmstring; |
| 25 | |
| 26 | ok ($pwmlines[1], $pwmlines[3]); |
| 27 | ok (1, ($pwmlines[0] ne $pwmlines[1])); |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 |