2 ## Bioperl Test Harness Script for Modules
8 test_begin(-tests => 9);
9 use_ok('Bio::Tools::Run::Alignment::Pal2Nal');
12 # setup input files etc
13 my $nucleotide_filename = test_input_file('pal2nal.nuc');
14 my $protein_alignfilename = test_input_file('pal2nal.aln');
15 my $mxlib = test_input_file('transfac.dat');
17 my $factory = Bio::Tools::Run::Alignment::Pal2Nal->new();
19 isa_ok($factory, 'Bio::Tools::Run::Alignment::Pal2Nal');
21 # test default factory values
22 is ($factory->program_dir, $ENV{'PAL2NALDIR'}, 'program_dir returned correct default');
23 is ($factory->program_name(), 'pal2nal.pl', 'Correct exe default name');
25 # test the program itself
27 test_skip(-requires_executable => $factory,
30 # Run Pal2Nal with a protein alignment file and a multi-fasta nucleotide
32 ok my $aln1 = $factory->run($protein_alignfilename, $nucleotide_filename);
34 # or with Bioperl objects
35 use_ok('Bio::AlignIO');
37 my $ai = Bio::AlignIO->new(-file => $protein_alignfilename);
38 my $protein_bio_simplalign = $ai->next_aln;
39 my $si = Bio::SeqIO->new(-file => $nucleotide_filename, -format => 'fasta');
40 my $nucleotide_bio_seq1 = $si->next_seq;
41 my $nucleotide_bio_seq2 = $si->next_seq;
42 ok my $aln2 = $factory->run($protein_bio_simplalign,
43 [$nucleotide_bio_seq1, $nucleotide_bio_seq2]);
45 is_deeply($aln1, $aln2);