Bio::Grid::Run::SGE::Util - Utility functions for Bio::Grid::Run::SGE
use Bio::Grid::Run::SGE::Util qw( my_glob my_sys MSG INFO delete_by_regex expand_path my_mkdir concat_files faiterate my_sys_non_fatal my_glob_non_fatal timer expand_path_rel );
Provides utility functions for the Bio::Grid::Run::SGE module.
See File::Glob::bsd_glob for an explanation of the $pattern. This function is for convenience only and takes care of some quirks of bsd_glob.
$pattern
Same as my_glob, but does not die if glob result is empty.
my_glob
Expands a path to its absoulte equivalent. Taks also care of paths beginning with '~'.
Expands the '~' at the beginning of a path to the home directory.
Runs command eiter as array or as simple string (see also system) and dies if something goes wrong.
Runs command eiter as array or as simple string (see also system) and gives a warning message if something goes wrong.
It returns undef is something went wrong and 1/true if the exit code of the program was ok.
undef
1/true
Creates $path and dies if something goes wrong. See also "mkpath" in File::Path.
$path
Prints @text concatenated by spaces indented by a <TAB> to standard error.
@text
Just prints @text to standard error.
Opens $dir and deletes all files that match $file_regex. If simulate is true, then just print the files that would be deleted.
$dir
$file_regex
Concatenates all result files in one file $c-{result_dir}/$c->{job_name}.j${job_id}.result.concat and deletes the single result files. Result files are determined by following regex:
qr/\Q$c->{job_name}\E #job name \.j$c->{job_id} #the job id \.[0-9]+ #the sge task id \.t[\-0-9]+(?:\.[\w\-.#]+)? #my task id (?:\..*)? #suffix $/x;
If your toolwrapper makes use of it, you can also invoke it by hand. In the working dir of your job run:
~/script/<toolwrapper>.pl -p <job_id> <tmp>/<job_name>.config
TAKE CARE, IT DELETES THE RESULT FILES AND OVERWRITES THE LAST RESULT.CONCAT FILE
Time something. Usage:
# get a timer my $timer = timer(); # start my $start_time = $timer->(); # stop my $stop_time = $timer->(); my ($stop_time, $elapsed_time_as_string) = $timer->();
Bio::Grid::Run::SGE
jw bargsten, <joachim.bargsten at wur.nl>
<joachim.bargsten at wur.nl>
To install Bio::Grid::Run::SGE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::Grid::Run::SGE
CPAN shell
perl -MCPAN -e shell install Bio::Grid::Run::SGE
For more information on module installation, please visit the detailed CPAN module installation guide.