NAME
Utils
SYNOPSIS
use Utils;
DESCRIPTION
A handy module comprising some commonly used helper functions in the TURNIP software.
FEEDBACK
Reporting Bugs
Please report bugs to the author.
AUTHOR
Rob Davey
APPENDIX
The rest of the documentation details each of the object methods. Internal (private) functions are preceded by an underscore (_)
hashcode
Title : hashcode
Usage : hashcode($s)
Function: generates a hashcode from a scalar
Returns : an integer scalar representing a hashcode
Args : the object from which to form the hashcode
use_config
Title : use_config
Usage : use_config($file)
Function: reads in a Prefs config file and checks for sanity
Returns : NONE
Args : a TURNIP .conf preferences file
slicestr
Title : slicestr
Usage : slicestr($string, $start, $end)
Function: grab a slice of a string. This is different from substr in that you do not provide a length, but rather the start- and endpoints of the desired slice.
Returns : the portion of the string that has been sliced
Args : a string, a start index and an end index
find_quality_alignment
Title : find_quality_alignment
Usage : find_quality_alignment($title, $strand, $start, $end, %dict)
Function: find a slice of quality scores for a corresponding sequence alignment
Returns : a slice of quality scores, separated by a whitespace character
Args : a read title, strand, slice start, slice end and corresponding sequence IndexDict
qual_to_prob
Title : qual_to_prob
Usage : qual_to_prob($quality)
Function: converts a fastq quality score into an error probability
Returns : an error probablity for this quality score
Args : a fastq quality integer, and an optional exponent and baseline
reverse_complement
Title : reverse_complement
Usage : reverse_complement($sequence)
Function: computes the reverse complement for a given DNA sequence
Returns : the reverse complement
Args : a string representing a DNA sequence
trim
Title : trim
Usage : trim($string)
Function: trim function to remove whitespace from the start and end of the string
Returns : the trimmed string
Args : a string
ltrim
Title : ltrim
Usage : ltrim($string)
Function: left trim function to remove leading whitespace
Returns : the left-trimmed string
Args : a string
rtrim
Title : rtrim
Usage : rtrim($string)
Function: right trim function to remove trailing whitespace
Returns : the right-trimmed string
Args : a string
zeros
Title : zeros
Usage : zeros($length)
Function: generate a list of given length filled with zeros
Returns : the zero-filled list
Args : the length of the list to generate
fisher_yates_shuffle
Title : fisher_yates_shuffle
Usage : fisher_yates_shuffle(\@list)
Function: shuffles the contents of a given arrayref according to the Fisher-Yates shuffle algorithm
Returns : NONE
Args : the arrayref to shuffle