Bio-ToolBox
view release on metacpan or search on metacpan
scripts/manipulate_datasets.pl view on Meta::CPAN
# sort
if ( scalar(@indices) == 1 ) {
# excellent! only one column index to sort by
$Data->sort_data( $indices[0], $direction );
}
else {
# need to sort by the mean of provided column indices
# we will generate a temporary column of the mean
# first need to set the target of mean which is needed by combine function
my $original = $opt_target; # keep a backup just in case
$opt_target = 'mean';
combine_function(@indices);
my $i = $Data->last_column;
$opt_target = $original; # restore backup just in case
$Data->sort_data( $i, $direction );
$Data->delete_column($i); # delete the temporary column
}
# remove any pre-existing sorted metadata since no longer valid
for ( my $i = 0; $i < $Data->number_columns; $i++ ) {
$Data->delete_metadata( $i, 'sorted' );
}
# annotate metadata, but only if there was one index
scripts/manipulate_datasets.pl view on Meta::CPAN
replacement for common manipulations performed in a full featured
spreadsheet program, e.g. Excel, particularly with datasets too large to be
loaded, all in a conveniant command line program. The program is designed
to be operated primarily as an interactive program, allowing for multiple
manipulations to be performed. Alternatively, single manipulations may be
performed as specified using command line options. As such, the program can
be called in shell scripts.
The program keeps track of the number of manipulations performed, and if
any are performed, will write out to file the changed data. Unless an
output file name is provided, it will overwrite the input file (NO backup is
made!).
=head1 FUNCTIONS
This is a list of the functions available for manipulating columns. These may
be selected interactively from the main menu (note the case sensitivity!),
or specified on the command line using the C<--func> option.
=over 4
( run in 0.351 second using v1.01-cache-2.11-cpan-7add2cbd662 )