Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Hyphy/BatchFile.pm: Changed @validvals[$i] to $validvals[$i].

Hyphy.t: Fixed number of skipped tests, eliminated a duplicated "my $rel".
Removed tabs.
  • Loading branch information...
commit 27094fb06ab9194de67a18fba51cd9e339a370c9 1 parent 4e7884e
@fjossandon fjossandon authored
Showing with 64 additions and 61 deletions.
  1. +1 −1  lib/Bio/Tools/Run/Phylo/Hyphy/BatchFile.pm
  2. +63 −60 t/Hyphy.t
View
2  lib/Bio/Tools/Run/Phylo/Hyphy/BatchFile.pm
@@ -304,7 +304,7 @@ sub set_default_parameters {
}
my @validvals = $self->valid_values();
for (my $i=0; $i< scalar (@validvals); $i++) {
- my $elem = @validvals[$i];
+ my $elem = $validvals[$i];
keys %$elem; #reset hash iterator
my ($param,$val) = each %$elem;
# skip if we want to keep old values and it is already set
View
123 t/Hyphy.t
@@ -7,78 +7,81 @@ use strict;
BEGIN {
use Bio::Root::Test;
- test_begin(-tests => 10, -requires_module =>'IO::String');
+ test_begin(-tests => 10,
+ -requires_module =>'IO::String');
-
- use_ok('Bio::Tools::Run::Phylo::Hyphy::SLAC');
- use_ok('Bio::Tools::Run::Phylo::Hyphy::FEL');
- use_ok('Bio::Tools::Run::Phylo::Hyphy::REL');
- use_ok('Bio::Tools::Run::Phylo::Hyphy::Modeltest');
- use_ok('Bio::Tools::Run::Phylo::Hyphy::BatchFile');
+ use_ok('Bio::Tools::Run::Phylo::Hyphy::SLAC');
+ use_ok('Bio::Tools::Run::Phylo::Hyphy::FEL');
+ use_ok('Bio::Tools::Run::Phylo::Hyphy::REL');
+ use_ok('Bio::Tools::Run::Phylo::Hyphy::Modeltest');
+ use_ok('Bio::Tools::Run::Phylo::Hyphy::BatchFile');
}
SKIP: {
- my $rel = Bio::Tools::Run::Phylo::Hyphy::REL->new();
+ my $rel = Bio::Tools::Run::Phylo::Hyphy::REL->new();
- test_skip(-requires_executable => $rel, -tests => 4);
+ test_skip(-requires_executable => $rel,
+ -tests => 5);
- my $alignio = Bio::AlignIO->new(-format => 'fasta',
- -file => 't/data/hyphy1.fasta');
+ my $alignio = Bio::AlignIO->new(-format => 'fasta',
+ -file => 't/data/hyphy1.fasta');
- my $treeio = Bio::TreeIO->new(-format => 'newick',
- -file => 't/data/hyphy1.tree');
+ my $treeio = Bio::TreeIO->new(-format => 'newick',
+ -file => 't/data/hyphy1.tree');
- my $aln = $alignio->next_aln;
- my $tree = $treeio->next_tree;
- my $debug = test_debug();
- my ($rc,$results);
+ my $aln = $alignio->next_aln;
+ my $tree = $treeio->next_tree;
+ my $debug = test_debug();
+ my ($rc,$results);
- my $rel = Bio::Tools::Run::Phylo::Hyphy::REL->new();
- $rel->alignment($aln);
- $rel->tree($tree);
- ($rc,$results) = $rel->run();
- if (($rc == 0) && ($debug == 1)){
- warn("ERROR in REL module $rc:" . $rel->error_string() . "\n");
- }
- ok ($rc != 0, "REL module");
+ $rel->alignment($aln);
+ $rel->tree($tree);
+ ($rc,$results) = $rel->run();
+ if (($rc == 0) && ($debug == 1)){
+ warn("ERROR in REL module $rc:" . $rel->error_string() . "\n");
+ }
+ ok ($rc != 0, "REL module");
- my $fel = Bio::Tools::Run::Phylo::Hyphy::FEL->new();
- $fel->alignment($aln);
- $fel->tree($tree);
- ($rc,$results) = $fel->run();
- if (($rc == 0) && ($debug == 1)){
- warn("ERROR in FEL module $rc:" . $fel->error_string() . "\n");
- }
- ok (defined($results->{'LRT'}), "FEL module");
+ my $fel = Bio::Tools::Run::Phylo::Hyphy::FEL->new();
+ $fel->alignment($aln);
+ $fel->tree($tree);
+ ($rc,$results) = $fel->run();
+ if (($rc == 0) && ($debug == 1)){
+ warn("ERROR in FEL module $rc:" . $fel->error_string() . "\n");
+ }
+ ok (defined($results->{'LRT'}), "FEL module");
- my $modeltest = Bio::Tools::Run::Phylo::Hyphy::Modeltest->new();
- $modeltest->alignment($aln);
- $modeltest->tree($tree);
- ($rc,$results) = $modeltest->run();
- if (($rc == 0) && ($debug == 1)){
- warn("ERROR in Modeltest module $rc:" . $modeltest->error_string() . "\n");
- }
- ok (defined($results->{'AIC'}), "Modeltest module");
+ my $modeltest = Bio::Tools::Run::Phylo::Hyphy::Modeltest->new();
+ $modeltest->alignment($aln);
+ $modeltest->tree($tree);
+ ($rc,$results) = $modeltest->run();
+ if (($rc == 0) && ($debug == 1)){
+ warn("ERROR in Modeltest module $rc:" . $modeltest->error_string() . "\n");
+ }
+ ok (defined($results->{'AIC'}), "Modeltest module");
- my $bf_exec = Bio::Tools::Run::Phylo::Hyphy::BatchFile->new(-params => {'bf' => "ModelTest.bf", 'order' => [$aln, $tree, '4', 'AIC Test', ""]});
- $bf_exec->alignment($aln);
- $bf_exec->tree($tree);
- my ($tfh, $t) = $bf_exec->io->tempfile;
- $bf_exec->set_parameter(5, $t);
- $bf_exec->version();
- ($rc,$results) = $bf_exec->run();
- if (($rc == 0) && ($debug == 1)){
- warn("ERROR in Batchfile module $rc:" . $bf_exec->error_string() . "\n");
- }
- ok ($rc != 0, "Batchfile module");
+ my $bf_exec = Bio::Tools::Run::Phylo::Hyphy::BatchFile->new(
+ -params => {'bf' => "ModelTest.bf",
+ 'order' => [$aln, $tree, '4', 'AIC Test', ""]}
+ );
+ $bf_exec->alignment($aln);
+ $bf_exec->tree($tree);
+ my ($tfh, $t) = $bf_exec->io->tempfile;
+ $bf_exec->set_parameter(5, $t);
+ $bf_exec->version();
+ ($rc,$results) = $bf_exec->run();
+ if (($rc == 0) && ($debug == 1)){
+ warn("ERROR in Batchfile module $rc:" . $bf_exec->error_string() . "\n");
+ }
+ ok ($rc != 0, "Batchfile module");
- my $slac = Bio::Tools::Run::Phylo::Hyphy::SLAC->new();
- $slac->alignment($aln);
- $slac->tree($tree);
- ($rc,$results) = $slac->run();
- if (($rc == 0) && ($debug == 1)){
- warn("ERROR in SLAC module $rc:" . $slac->error_string() . "\n");
- }
- ok (defined($results->{'Observed NS Changes'}), "SLAC module");
+ my $slac = Bio::Tools::Run::Phylo::Hyphy::SLAC->new();
+ $slac->alignment($aln);
+ $slac->tree($tree);
+ ($rc,$results) = $slac->run();
+ if (($rc == 0) && ($debug == 1)){
+ warn("ERROR in SLAC module $rc:" . $slac->error_string() . "\n");
+ }
+ ok (defined($results->{'Observed NS Changes'}), "SLAC module");
}
Please sign in to comment.
Something went wrong with that request. Please try again.