1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 16);
12 use_ok('Bio::Matrix::PSM::IO');
15 #Let's try masta formats here
16 my $mio = Bio::Matrix::PSM::IO->new(-format=>'masta',
17 -file=>test_input_file('masta.dat'));
18 my $masta_w_dat = test_output_file();
19 my $wmio=Bio::Matrix::PSM::IO->new(-format=>'masta',
20 -file=>">".$masta_w_dat);
21 $wmio->_flush_on_write(1);
26 while (my $site=$mio->next_matrix) {
28 push @cons,$site->consensus;
29 $carry=$site if ($site->id eq 'm1logs');
31 is $cons[0],'CAGAAAAATNGAATNCCCACCCCCC';
32 is $cons[1],'CAGAAAAATAGAATCCCCACCCCCC';
33 is $cons[2],'CAGAAAAATNNAATNCCCACCNCCC';
35 $wmio->write_psm($carry,'PWM');
37 $wmio->write_psm($carry,'PFM');
39 $wmio->write_psm($carry,'SEQ');
41 my $chio=Bio::Matrix::PSM::IO->new(-format=>'masta',
44 my $site=$chio->next_matrix;
45 is $site->id,'m1logs';
46 is $site->consensus,'CAGAAAAATAGAATCCCCACCCCCC';
47 $site=$chio->next_matrix;
48 is $site->id,'m1freq';
49 is $site->consensus,'CAGAAAAATAGAATCCCCACCCCCC';
50 $site=$chio->next_matrix;
52 is $site->consensus,'CAGAAAAATAGAATCCCCACCCCCC';