Fix docs for water/needle, match more recent versions of EMBOSS
[bioperl-run.git] / t / SLR.t
blob3f2faba6aae95dacc5193bd0821d9f6beab0a44c
1 # This is -*-Perl-*- code
2 ## Bioperl Test Harness Script for Modules
3 ##
4 # $Id$
6 # Before `make install' is performed this script should be runnable with
7 # `make test'. After `make install' it should work as `perl test.t'
9 use strict;
11 BEGIN {
12     use Bio::Root::Test;
13     test_begin(-tests => 7,
14                            -requires_module => 'IO::String');
15         use_ok('Bio::Root::IO');
16         use_ok('Bio::Tools::Run::Phylo::SLR');
17         use_ok('Bio::AlignIO');
18         use_ok('Bio::TreeIO');
21 ok my $slr = Bio::Tools::Run::Phylo::SLR->new();
23 SKIP: {
24         test_skip(-requires_executable => $slr,
25                   -tests => 2);
27         # first set
28         my $alignio1 = Bio::AlignIO->new
29             (-format => 'fasta',
30              -file   => test_input_file('219877.cdna.fasta'));
32         my $treeio1 = Bio::TreeIO->new
33             (-format => 'newick',
34              -file   => test_input_file('219877.tree'));
36         my $aln1 = $alignio1->next_aln;
37         my $tree1 = $treeio1->next_tree;
39         $slr->alignment($aln1);
40         $slr->tree($tree1);
41         my ($rc,$results1) = $slr->run();
42         ok defined($results1);
44         # second set
45     $slr = Bio::Tools::Run::Phylo::SLR->new();
46         my $alignio2 = Bio::AlignIO->new
47             (-format => 'fasta',
48              -file   => test_input_file('277523.cdna.fasta'));
50         my $treeio2 = Bio::TreeIO->new
51             (-format => 'newick',
52              -file   => test_input_file('277523.tree'));
54         my $aln2 = $alignio2->next_aln;
55         my $tree2 = $treeio2->next_tree;
57         $slr->alignment($aln2);
58         $slr->tree($tree2);
59         my($rc2,$results2) = $slr->run();
60         ok defined($results2);
61 #         my $positive_sites = $results2->{'constant'};
62 #         print "Site,Omega\n";
63 #         foreach my $site (@{$positive_sites}) {
64 #             # print "# Site  Neutral  Optimal   Omega    lower    upper LRT_Stat    Pval     Adj.Pval  Result Note\n";
65 #             print $site->[0], ",", $site->[3], "\n";
66 #         }
68 #         # third set
69 #         $slr = Bio::Tools::Run::Phylo::SLR->new();
70 #       my $alignio3 = Bio::AlignIO->new
71 #             (-format => 'fasta',
72 #              -file   => 't/data/799906.cdna.fasta');
74 #       my $treeio3 = Bio::TreeIO->new
75 #             (-format => 'newick',
76 #              -file   => 't/data/799906.tree');
78 #       my $aln3 = $alignio3->next_aln;
79 #       my $tree3 = $treeio3->next_tree;
81 #       $slr->alignment($aln3);
82 #       $slr->tree($tree3);
83 #       my ($rc,$results3) = $slr->run();
84 #         my $sites = $results3->{'constant'};
85 #       ok defined($results3);
86 #         print "Site,Omega\n";
87 #         foreach my $site (@{$sites}) {
88 #             # print "# Site  Neutral  Optimal   Omega    lower    upper LRT_Stat    Pval     Adj.Pval  Result Note\n";
89 #             print $site->[0], ",", $site->[3], "\n";
90 #         }