The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bio::JBrowse::Store::NCList::IntervalStore

SYNOPSIS

  my $is = Bio::JBrowse::Store::NCList::IntervalStore->new({
               urlTemplate => "lf-{Chunk}.jsonz",
           });
  my $chunkBytes = 80_000;
  $is->startLoad( $measure, $chunkBytes );
  $is->addSorted([10, 100, -1])
  $is->addSorted([50, 80, 1])
  $is->addSorted([90, 150, -1])
  $is->finishLoad();
  $is->overlap(60, 85)

  => ([10, 100, -1], [50, 80, 1])

NAME

Bio::JBrowse::Store::NCList::IntervalStore - stores a set of intervals (genomic features) in an on-disk lazy nested-containment list

METHODS

new

 Title   : new
 Usage   : Bio:JBrowse::Store::NCList::IntervalStore->new(
               arrayRepr => {attributes => ["start", "end", "strand"]},
           )
 Function: create a new store
 Returns : an Bio::JBrowse::Store::NCList::IntervalStore object
 Args    : The Bio::JBrowse::Store::NCList::IntervalStore constuctor accepts the named parameters:
           store: optional object with put(path, data) method, will be used to output
                  feature data
           compress: if true, attempt to compress the data on disk
           arrayRepr: Bio::JBrowse::Store::NCList::ArrayRepr object used to represent the feature data
           urlTemplate (optional): template for URLs where chunks of feature
                                   data will be stored.  This is relative to
                                   the directory with the "trackData.json" file
           nclist (optional): the root of the nclist
           count (optional): the number of intervals in this Bio::JBrowse::Store::NCList::IntervalStore
           minStart (optional): the earliest interval start point
           maxEnd (optional): the latest interval end point

           If this Bio::JBrowse::Store::NCList::IntervalStore hasn't been loaded yet, the optional
           parameters aren't necessary.  But to access a previously-loaded
           Bio::JBrowse::Store::NCList::IntervalStore, the optional parameters *are* needed.

startLoad( $measure, $chunkBytes )

addSorted( \@feature )

finishLoad()

overlapCallback( $from, $to, \&func )

Calls the given function once for each of the intervals that overlap the given interval if <$from <= $to>, iterates left-to-right, otherwise iterates right-to-left.

descriptor

 Title   : descriptor
 Usage   : $list->descriptor
 Returns : a hash containing the data needed to re-construct this
           Bio::JBrowse::Store::NCList::IntervalStore, including the
           root of the NCList plus some metadata and configuration.
           The return value can be passed to the constructor later.

AUTHOR

Mitchell Skinner <jbrowse@arctur.us>

Copyright (c) 2007-2011 The Evolutionary Software Foundation

This package and its accompanying libraries are free software; you can redistribute it and/or modify it under the terms of the LGPL (either version 2.1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text.

AUTHOR

Robert Buels <rbuels@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Robert Buels.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.