NAME
Bio::Tools::Run::WrapperBase - A Base object for wrappers around executables
SYNOPSIS
# do not use this object directly, it provides the following methods# for its subclassesmy $errstr = $obj->error_string();my $exe = $obj->executable();$obj->save_tempfiles($booleanflag)my $outfile= $obj->outfile_name();my $tempdir= $obj->tempdir(); # get a temporary dir for executingmy $io = $obj->io; # Bio::Root::IO objectmy $cleanup= $obj->cleanup(); # remove tempfiles$obj->run({-arg1 => $value});
DESCRIPTION
This is a basic module from which to build executable wrapper modules. It has some basic methods to help when implementing new modules.
FEEDBACK
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.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
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:
https://github.com/bioperl/bioperl-live/issues
AUTHOR - Jason Stajich
Email jason-at-bioperl.org
CONTRIBUTORS
Sendu Bala, [email protected]
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
run
Title : runUsage : $wrapper->run({ARGS HERE});Function: Support generic running with args passed inas a hashrefReturns : Depends on the implementation, status OR dataArgs : hashref of named arguments
error_string
Title : error_stringUsage : $obj->error_string($newval)Function: Where the output from the last analysis run is stored.Returns : value of error_stringArgs : newvalue (optional)
arguments
Title : argumentsUsage : $obj->arguments($newval)Function: Commandline parametersReturns : value of argumentsArgs : newvalue (optional)
no_param_checks
Title : no_param_checksUsage : $obj->no_param_checks($newval)Function: Boolean flag as to whether or not we shouldtrust the sanity checks for parameter valuesReturns : value of no_param_checksArgs : newvalue (optional)
save_tempfiles
Title : save_tempfilesUsage : $obj->save_tempfiles($newval)Function: Get/set the choice of if tempfiles in the temp dir (see tempdir())are kept or cleaned up. Default is '0', ie. delete temp files.NB: This must be set to the desired value PRIOR to first creatinga temp dir with tempdir(). Any attempt to set this after tempdir creation will get a warning.Returns : booleanArgs : none to get, boolean to set
outfile_name
Title : outfile_nameUsage : my $outfile = $wrapper->outfile_name();Function: Get/Set the name of the output file for this run(if you wanted to do something special)Returns : stringArgs : [optional] string to set value to
tempdir
Title : tempdirUsage : my $tmpdir = $self->tempdir();Function: Retrieve a temporary directory name (which is created)Returns : string which is the name of the temporary directoryArgs : none
cleanup
Title : cleanupUsage : $wrapper->cleanup();Function: Will cleanup the tempdir directoryReturns : noneArgs : none
io
Title : ioUsage : $obj->io($newval)Function: Gets a Bio::Root::IO objectReturns : Bio::Root::IO objectArgs : none
version
Title : versionUsage : $version = $wrapper->version()Function: Returns the program version (if available)Returns : string representing version of the programArgs : [Optional] value to (re)set version string
executable
Title : executableUsage : my $exe = $factory->executable();Function: Finds the full path to the executableReturns : string representing the full path to the exeArgs : [optional] name of executable to set path to[optional] boolean flag whether or not warn when exe is not found
program_path
Title : program_pathUsage : my $path = $factory->program_path();Function: Builds path for executableReturns : string representing the full path to the exeArgs : none
program_dir
Title : program_dirUsage : my $dir = $factory->program_dir();Function: Abstract get method for dir of program. To be implementedby wrapper.Returns : string representing program directoryArgs : none
program_name
Title : program_nameUsage : my $name = $factory->program_name();Function: Abstract get method for name of program. To be implementedby wrapper.Returns : string representing program nameArgs : none
quiet
Title : quietUsage : $factory->quiet(1);if ($factory->quiet()) { ... }Function: Get/set the quiet state. Can be used by wrappers to control ifprogram output is printed to the console or not.Returns : booleanArgs : none to get, boolean to set
_setparams()
Title : _setparamsUsage : $params = $self->_setparams(-params => [qw(window evalue_cutoff)])Function: For internal use by wrapper modules to build parameter stringssuitable for sending to the program being wrapped. For each methodname supplied, calls the method and adds the method name (as modifiedby optional things) along with its value (unless a switch) to theparameter stringExample : $params = $self->_setparams(-params => [qw(window evalue_cutoff)],-switches => [qw(simple large all)],-double_dash => 1,-underscore_to_dash => 1);If window() and simple() had not been previously called, butevalue_cutoff(0.5), large(1) and all(0) had been called, $paramswould be ' --evalue-cutoff 0.5 --large'Returns : parameter stringArgs : -params => [] or {} # array ref of method names to call,or hash ref where keys are method names andvalues are how those names should be outputin the params string-switches => [] or {}# as for -params, but no value is printed forthese methods-join => string # define how parameters and their values arejoined, default ' '. (eg. could be '=' forparam=value)-lc => boolean # lc() method names prior to output in string-dash => boolean # prefix all method names with a single dash-double_dash => bool # prefix all method names with a double dash-mixed_dash => bool # prefix single-character method names with a# single dash, and multi-character method names# with a double-dash-underscore_to_dash => boolean # convert all underscores in methodnames to dashes