Bio::Tools::Run::Phylo::Hyphy::BatchFile - Wrapper for custom execution of Hyphy batch files


my $aln = Bio::Align::AlignI->new(); my $treeio = Bio::TreeIO->new(-format => "nexus", -file => "$tree_file"); my $tree = $treeio->next_tree(); my $bf_exec = Bio::Tools::Run::Phylo::Hyphy::BatchFile->new(-params => {'bf' => "", 'order' => ["Universal", "Custom", $aln, "001001", $tree]}); $bf_exec->set_parameter('3', "012012"); my ($rc,$parser) = $bf_exec->run();


This module creates a generic interface to processing of HBL files in HyPhy ([Hy]pothesis Testing Using [Phy]logenies), a package by Sergei Kosakowsky Pond, Spencer V. Muse, Simon D.W. Frost and Art Poon. See for more information.

Instances of this module require only a link to the batch file and an ordered list of parameters, as described in the HyPhy documentation "SelectionAnalyses.pdf."


Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated.                  - General discussion  - About the mailing lists


Please direct usage questions or support issues to the mailing list:

rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.

Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:

AUTHOR - Daisie Huang



Additional contributors names and emails here


 Title   : valid_values
 Usage   : $factory->valid_values()
 Function: returns the possible parameters
 Returns:  an array holding all possible parameters. The default
values are always the first one listed.  These descriptions are
essentially lifted from the python wrapper or provided by the author.
 Args    : None


 Title   : new
 Usage   : my $obj = Bio::Tools::Run::Phylo::Hyphy::BatchFile->new();
 Function: Builds a new Bio::Tools::Run::Phylo::Hyphy::BatchFile object
 Returns : Bio::Tools::Run::Phylo::Hyphy::BatchFile
 Args    : -alignment => the Bio::Align::AlignI object
           -save_tempfiles => boolean to save the generated tempfiles and
                              NOT cleanup after onesself (default FALSE)
           -tree => the Bio::Tree::TreeI object
           -params => a hashref of parameters (all passed to set_parameter)
                      this hashref should include   'bf' =>
                                                    'order' => [array of ordered parameters]
           -executable => where the hyphy executable resides

See also: Bio::Tree::TreeI, Bio::Align::AlignI


 Title   : update_ordered_parameters
 Usage   : $BatchFile->update_ordered_parameters();
 Function: updates all of the parameters needed for the ordered input redirect in HBL.
 Returns : nothing
 Args    : none


 Title   : run
 Usage   : my ($rc,$results) = $BatchFile->run();
 Function: run the Hyphy analysis using the specified batchfile and its ordered parameters
 Returns : Return code, Hash
 Args    : none


 Title   : create_wrapper
 Usage   : $self->create_wrapper
 Function: Creates the wrapper file for the batchfile specified in the hash, saves it to the hash as '_wrapper'.
 Returns : nothing
 Args    : none


Title : set_parameter Usage : $hyphy->set_parameter($param,$val); Function: Sets the named parameter $param to $val if it is a non-numeric parameter If $param is a number, sets the corresponding value of the ordered redirect array (starts from 1). Returns : boolean if set was successful Args : $param => name of the parameter $value => value to set the parameter to


Title : batchfile Usage : $hyphy->batchfile($bf_name); Function: Gets/sets the batchfile that is run by $hyphy. Returns : The batchfile path. Args : $bf_name => path of new batchfile


Title : make_batchfile_with_contents Usage : $hyphy->make_batchfile_with_contents($bf_string); Function: Creates a temporary file with the specified string of contents for the batchfile. Returns : The batchfile path. Args : $bf_string => contents for the batchfile


 Title   : set_default_parameters
 Usage   : $BatchFile->set_default_parameters(0);
 Function: (Re)set the default parameters from the defaults
           (the first value in each array in the
 Returns : none
 Args    : boolean: keep existing parameter values