NAME

MS::Reader - Base class for all file parsers

SYNOPSIS

    package MS::Reader::Foo;

    use parent qw/MS::Reader/;

DESCRIPTION

MS::Reader is the base class from which all MS::Reader parsers are derived. It's sole purpose (currently) is to transparently handle on-disk indexes and opening of BGZF-compressed files.

METHODS

All subclasses by default inherit the following constructor

new

    my $parser = MS::Reader::Foo->new( $fn,
        use_cache => 0,
        paranoid  => 0,
    );

Takes an input filename (required) and optional argument hash and returns an MS::Reader object. Available options include:

  • use_cache — cache fetched records in memory for repeat access (default: FALSE)

  • paranoid — when loading index from disk, recalculates MD5 checksum each time to make sure raw file hasn't changed. This adds (typically) a few seconds to load times. By default, only file size and mtime are checked.

get_app_data

set_app_data

    $parser->set_app_data(
        $APP_ID,
        $field => $value,
    );
    my $value = $parser->get_app_data(
        $APP_ID,
        $field,
    );

These functions allow for the storage of arbitrary key/value information along with the file index. They have no effect upon the indexed file itself. The application ID, key and value can have any value and are not validated in any way. There is no protection against one application overwriting another application's data. Care should be taken to use a unique application ID (such as a UUID).

CAVEATS AND BUGS

The API is in alpha stage and is not guaranteed to be stable.

Please reports bugs or feature requests through the issue tracker at https://github.com/jvolkening/p5-MS/issues.

AUTHOR

Jeremy Volkening <jdv@base2bio.com>

COPYRIGHT AND LICENSE

Copyright 2015-2016 Jeremy Volkening

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.