2 ## Bioperl Test Harness Script for Modules
8 test_begin(-tests => 25);
9 use_ok('Bio::Tools::Run::Meme');
13 my $seq1_file = test_input_file('fasta.fa');
14 my $seq2_file = test_input_file('lagan_dna.fa');
15 my $seq3_file = test_input_file('new_dna.fa');
17 # object setup and testing
18 my $factory = Bio::Tools::Run::Meme->new(-verbose => -1,
23 isa_ok($factory, 'Bio::Tools::Run::Meme');
24 ok $factory->can('nmotifs'), 'has a created method not in args';
25 is $factory->mod, 'oops', 'mod param was set';
26 ok $factory->dna, 'dna switch was set';
28 is ($factory->program_dir, $ENV{'MEME_BIN'}, 'program_dir returned correct default');
29 is ($factory->program_name(), 'meme', 'Correct exe default name');
31 # test the program itself
33 test_skip(-tests => 18,
34 -requires_executable => $factory);
37 my $si = Bio::SeqIO->new(-file => $seq1_file, -format => 'fasta');
38 ok my $seq1 = $si->next_seq;
39 $si = Bio::SeqIO->new(-file => $seq2_file, -format => 'fasta');
40 ok my $seq2 = $si->next_seq;
41 $si = Bio::SeqIO->new(-file => $seq3_file, -format => 'fasta');
42 ok my $seq3 = $si->next_seq;
44 # get an alignio given seq objects
45 ok my $alignio = $factory->run($seq1, $seq2, $seq3);
47 while (my $align = $alignio->next_aln) {
50 is $align->score, '1.3e+002';
51 is $align->length, 20;
53 my @expected = (['sequence_10', 738], ['Scaffold_2042.1', 787], ['SINFRUT00000067802', 941]);
56 foreach my $seq ($align->each_seq) {
59 my @answers = @{shift @expected};
60 is $seq->id, shift @answers;
61 is $seq->start, shift @answers;
68 # get a Bio::Map::Prediction