3 # ## Bioperl Test Harness Script for Modules
8 test_begin
(-tests
=> 12);
9 use_ok
('Bio::AlignIO');
10 use_ok
('Bio::Tools::Run::Alignment::Lagan');
11 use_ok
('Bio::Root::IO');
14 use_ok
('Bio::Matrix::Mlagan');
17 my $seq1 = test_input_file
("lagan_dna.fa");
18 my $sio = Bio
::SeqIO
->new(-file
=>$seq1,-format
=>'fasta');
20 my $seq = $sio->next_seq;
21 $seq->id("first_seq");
22 my $seq2= Bio
::Seq
->new(-id
=>"second_seq",-seq
=>$seq->seq);
23 my $seq3= Bio
::Seq
->new(-id
=>"third_seq",-seq
=>$seq->seq);
27 'order' => "\"-gs -7 -gc -2 -mt 2 -ms -1\"",
28 'tree' => "\"(first_seq (second_seq third_seq))\"",
37 my $factory = Bio
::Tools
::Run
::Alignment
::Lagan
->new(@params,
40 isa_ok
$factory,'Bio::Tools::Run::Alignment::Lagan';
41 test_skip
(-requires_executable
=> $factory,
43 -requires_env
=> 'LAGAN_DIR');
45 my $simple_align= $factory->lagan($seq,$seq2);
47 isa_ok
$simple_align, 'Bio::SimpleAlign';
49 is
$simple_align->percentage_identity, 100;
51 my $multi = $factory->mlagan([$seq,$seq2,$seq3]);
52 is
$multi->percentage_identity, 100;
54 my $matrix = Bio
::Matrix
::Mlagan
->new(-values => [[qw(115 -161 -81 -161 0 -72)],
55 [qw(-161 115 -161 -81 0 -72)],
56 [qw(-81 -161 115 -161 0 -72)],
57 [qw(-161 -81 -161 115 0 -72)],
59 [qw(-72 -72 -72 -72 0 -72)]],
61 -gap_continue
=> -25);
63 is
$factory->nuc_matrix($matrix), $matrix;
64 #*** weak test; doesn't show the supplied matrix had any effect on results...
65 $multi = $factory->mlagan([$seq,$seq2,$seq3]);
66 is
$multi->percentage_identity, 100;