NAME

Bio::MAGETAB::Util::Reader::Tabfile - An abstract class providing methods for handling tab-delimited files.

SYNOPSIS

use base qw(Bio::MAGETAB::Util::Reader::Tabfile);

DESCRIPTION

This abstract class acts as a wrapper for the Text::CSV_XS module and line ending detection code used by the rest of the Bio::MAGETAB::Util::Reader modules. It is not designed to be used directly.

ATTRIBUTES

uri

Required URI path to the file to be parsed.

eol_char

The end-of-line character to use while parsing. Typically this is set by the Reader subclasses.

filehandle

The filehandle for the file being parsed.

csv_parser

A Text::CSV_XS parser object.

builder

A Bio::MAGETAB::Util::Builder object, used by subclasses to track MAGE-TAB object creation.

METHODS

getline

A simple wrapper for the Text::CSV_XS getline() method which takes an optional filehandle argument, using the cached filehandle returned by get_filehandle() as the default. This filehandle argument can be useful when explicitly controlling the read position of the script within the file (e.g. as in ADF parsing).

can_ignore

When passed an arrayref of column values for a given line, returns 1 if the line is ignorable (typically blank or commented lines fall into this category) or undef if not.

strip_whitespace

This method strips any whitespace surrounding the string values passed to it in an arrayref.

confirm_full_parse

Raises an exception if the file has not been parsed to completion (i.e., EOF). Takes a line arrayref as returned by $self->getline() as an optional argument to allow testing for either (a) the existence of a next line in the file, or (b) EOF. This is useful when pausing parsing partway through a file, e.g. after parsing the ADF header section.

In addition, each attribute has accessor (get_*) and mutator (set_*) methods.

SEE ALSO

Bio::MAGETAB::Util::Reader Bio::MAGETAB::Util::Reader::TagValueFile

AUTHOR

Tim F. Rayner <tfrayner@gmail.com>

LICENSE

This library is released under version 2 of the GNU General Public License (GPL).