1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 16);
11 use_ok('Bio::Matrix::PSM::IO');
14 #Let's try masta formats here
15 my $mio = Bio::Matrix::PSM::IO->new(-format=>'masta',
16 -file=>test_input_file('masta.dat'));
17 my $masta_w_dat = test_output_file();
18 my $wmio=Bio::Matrix::PSM::IO->new(-format=>'masta',
19 -file=>">".$masta_w_dat);
20 $wmio->_flush_on_write(1);
25 while (my $site=$mio->next_matrix) {
27 push @cons,$site->consensus;
28 $carry=$site if ($site->id eq 'm1logs');
30 is $cons[0],'CAGAAAAATNGAATNCCCACCCCCC';
31 is $cons[1],'CAGAAAAATAGAATCCCCACCCCCC';
32 is $cons[2],'CAGAAAAATNNAATNCCCACCNCCC';
34 $wmio->write_psm($carry,'PWM');
36 $wmio->write_psm($carry,'PFM');
38 $wmio->write_psm($carry,'SEQ');
40 my $chio=Bio::Matrix::PSM::IO->new(-format=>'masta',
43 my $site=$chio->next_matrix;
44 is $site->id,'m1logs';
45 is $site->consensus,'CAGAAAAATAGAATCCCCACCCCCC';
46 $site=$chio->next_matrix;
47 is $site->id,'m1freq';
48 is $site->consensus,'CAGAAAAATAGAATCCCCACCCCCC';
49 $site=$chio->next_matrix;
51 is $site->consensus,'CAGAAAAATAGAATCCCCACCCCCC';