RandomJungle::File::OOB - Low level access to the data in the RandomJungle OOB output file
Version 0.05
RandomJungle::File::OOB provides access to the data contained within RandomJungle's OOB output file. See RandomJungle::Jungle for higher-level methods.
use RandomJungle::File::OOB; my $oob = RandomJungle::File::OOB->new( filename => $oobfile ) || die $RandomJungle::File::OOB::ERROR; $oob->parse || die $oob->err_str; my $file = $oob->get_filename; # returns the filename of the OOB file my $aref = $oob->get_matrix; # returns an aref to the entire matrix (all lines, in file order) # Note $i is the index (row num) of the sample, not the IID my $line = $oob->get_data_for_sample_index( $i ) || die $oob->err_str; # $line is unsplit my $href = $oob->get_data; # for debugging only; returns raw data structs # Error handling $oob->set_err( 'Something went boom' ); my $msg = $oob->err_str; my $trace = $oob->err_trace;
Creates and returns a new RandomJungle::File::OOB object:
my $oob = RandomJungle::File::OOB->new( filename => $oobfile );
The 'filename' parameter is required. Returns undef and sets $ERROR on failure.
Parses the OOB file specified in new():
my $retval = $oob->parse;
Returns a true value on success. Sets err_str and returns undef on failure.
Returns a line from the OOB file, specified by sample index (row number, not IID):
my $line = $oob->get_data_for_sample_index( $i ) || die $oob->err_str;
Returns a reference to an array that contains the lines in the OOB file:
my $aref = $oob->get_matrix;
Returns the name of the OOB file specified in new():
my $file = $oob->get_filename;
Returns the data structures contained in $self:
my $href = $oob->get_data;
This method is for debugging only and should not be used in production code.
Sets the error message (provided as a parameter) and creates a stack trace:
$oob->set_err( 'Something went boom' );
Returns the last error message that was set:
my $msg = $oob->err_str;
Returns a backtrace for the last error that was encountered:
my $trace = $oob->err_trace;
RandomJungle::Jungle, RandomJungle::Tree, RandomJungle::Tree::Node, RandomJungle::XML, RandomJungle::OOB, RandomJungle::RAW, RandomJungle::DB, RandomJungle::Classification_DB
Robert R. Freimuth
Copyright (c) 2011 Mayo Foundation for Medical Education and Research. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install RandomJungle::Tree, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RandomJungle::Tree
CPAN shell
perl -MCPAN -e shell install RandomJungle::Tree
For more information on module installation, please visit the detailed CPAN module installation guide.