2
#Some simple tests for meme and transfac parsers
7
# to handle systems with no installed Test module
8
# we include the t dir (where a copy of Test.pm is located)
10
eval { require Test; };
19
use Bio::Matrix::PSM::IO;
24
unlink(Bio::Root::IO->catfile(qw(t data masta_w.dat)));
26
#Let's try masta formats here
27
my $mio = new Bio::Matrix::PSM::IO(-format=>'masta',
28
-file=>Bio::Root::IO->catfile(qw(t data masta.dat)));
29
my $wmio=new Bio::Matrix::PSM::IO(-format=>'masta',
30
-file=>">".Bio::Root::IO->catfile(qw(t data masta_w.dat)));
31
$wmio->_flush_on_write(1);
36
while (my $site=$mio->next_matrix) {
38
push @cons,$site->consensus;
39
$carry=$site if ($site->id eq 'm1logs');
41
ok $cons[0],'CAGAAAAATNGAATNCCCACCCCCC';
42
ok $cons[1],'CAGAAAAATAGAATCCCCACCCCCC';
43
ok $cons[2],'CAGAAAAATNNAATNCCCACCNCCC';
45
$wmio->write_psm($carry,'PWM');
47
$wmio->write_psm($carry,'PFM');
49
$wmio->write_psm($carry,'SEQ');
51
my $chio=new Bio::Matrix::PSM::IO(-format=>'masta',
52
-file=>Bio::Root::IO->catfile(qw(t data masta_w.dat)));
54
my $site=$chio->next_matrix;
55
ok $site->id,'m1logs';
56
ok $site->consensus,'CAGAAAAATAGAATCCCCACCCCCC';
57
$site=$chio->next_matrix;
58
ok $site->id,'m1freq';
59
ok $site->consensus,'CAGAAAAATAGAATCCCCACCCCCC';
60
$site=$chio->next_matrix;
62
ok $site->consensus,'CAGAAAAATAGAATCCCCACCCCCC';