NAME
RandomJungle::File::OOB - Low level access to the data in the RandomJungle OOB output file
VERSION
Version 0.05
SYNOPSIS
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;
METHODS
new()
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.
parse()
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.
get_data_for_sample_index()
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;
get_matrix()
Returns a reference to an array that contains the lines in the OOB file:
my $aref = $oob->get_matrix;
get_filename()
Returns the name of the OOB file specified in new():
my $file = $oob->get_filename;
get_data()
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.
set_err()
Sets the error message (provided as a parameter) and creates a stack trace:
$oob->set_err( 'Something went boom' );
err_str()
Returns the last error message that was set:
my $msg = $oob->err_str;
err_trace()
Returns a backtrace for the last error that was encountered:
my $trace = $oob->err_trace;
SEE ALSO
RandomJungle::Jungle, RandomJungle::Tree, RandomJungle::Tree::Node, RandomJungle::XML, RandomJungle::OOB, RandomJungle::RAW, RandomJungle::DB, RandomJungle::Classification_DB
AUTHOR
Robert R. Freimuth
COPYRIGHT
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.