Bio::MAGETAB::Util::Reader - A parser/validator for MAGE-TAB documents.
use Bio::MAGETAB::Util::Reader;
my $reader = Bio::MAGETAB::Util::Reader->new({
idf => $idf,
relaxed_parser => $is_relaxed,
});
my $magetab = $reader->parse();
This is the main parsing and validation class which can be used to read a
MAGE-TAB document into a set of Bio::MAGETAB classes for further manipulation.
- idf
- A filesystem or URI path to the top-level IDF file describing the
investigation. This attribute is *required*.
- relaxed_parser
- A boolean value (default FALSE) indicating whether or not the parse should
take place in "relaxed mode" or not. The regular parsing mode
will throw an exception in cases where an object is referenced before it
has been declared (e.g., Protocol REF pointing to a non-existent Protocol
Name). Relaxed parsing mode will silently autogenerate the non-existent
objects instead.
- namespace
- An optional namespace string to be used in object creation.
- authority
- An optional authority string to be used in object creation.
- builder
- An optional Builder object. These Builder objects are used to track the
creation of Bio::MAGETAB objects by caching the objects in an internal
store, keyed by a set of identifying information (see the Builder class).
This object can be used in multiple Reader objects to help link common
objects from multiple MAGE-TAB documents together. In its simplest form
this internal store is a simple hash; however in principle this could be
extended by subclassing Builder to create e.g. persistent database storage
mechanisms.
- ignore_datafiles
- A boolean value (default FALSE) indicating whether to skip parsing of Data
Matrix files.
- common_directory
- A boolean value (default TRUE) indicating whether the IDF, SDRF, ADF and
Data Matrices are located in the same directory. This influences whether
URIs found in IDF and SDRF files are interpreted relative to the locations
of those files, or relative to the current working directory. Note that
this will not affect local file URIs giving absolute locations or URIs
using other schemes (e.g. http).
- document_version
- A string representing the MAGE-TAB version used in the parsed document.
This is populated by the parse() method.
- parse
- Attempts to parse the full MAGE-TAB document, starting with the top-level
IDF file, and returns the resulting Bio::MAGETAB container object in
scalar context, or the top-level Bio::MAGETAB::Investigation object and
container object in list context.
Tim F. Rayner <tfrayner@gmail.com>
This library is released under version 2 of the GNU General Public License
(GPL).