NAME
Bio::ToolBox::utility -
DESCRIPTION
These are general subroutines that don't fit in either Bio::ToolBox::file_helper or Bio::ToolBox::db_helper.
SUBROUTINES
The following subroutines are automatically exported when you use this module.
- parse_list()
-
This subroutine parses a scalar value into a list of values. The scalar is a text string of numbers (usually column or dataset indices) delimited by commas and/or including a range. For example, a string "1,2,5-7" would become an array of [1,2,5,6,7].
Pass the module the scalar string.
It will return the array of numbers.
Example
my $index_request = '1,2,5-7'; my @indices = parse_list($index_request); # returns [1,2,5,6,7]
- format_with_commas()
-
This subroutine process a large number (e.g. 4327908475) into a human-friendly version with commas delimiting the thousands (4,327,908,475).
Pass the module a scalar string with a number value.
It will return a scalar value containing the formatted number.
Example
my $count = '4327908475'; print " The final count was " . format_with_commas($count) . "\n";
AUTHOR
Timothy J. Parnell, PhD
Dept of Oncological Sciences
Huntsman Cancer Institute
University of Utah
Salt Lake City, UT, 84112
This package is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0.