GenOO

 view release on metacpan or  search on metacpan

lib/GenOO/RegionCollection/Type/DoubleHashArray.pm  view on Meta::CPAN

# POD documentation - main docs before the code

=head1 NAME

GenOO::RegionCollection::Type::DoubleHashArray - Object for a collection of GenOO::Region objects, with features

=head1 SYNOPSIS

    # Object that manages a collection of GenOO::Region objects.

    # To initialize
    my $locus_collection = GenOO::RegionCollection::DoubleHashArray->new({
        name          => undef,
        species       => undef,
        description   => undef,
        extra         => undef,
    });


=head1 DESCRIPTION

	The primary data structure of this object is a 2D hash whose primary key
	is the strand and its secondary key is the reference sequence name. Each
	such pair of keys correspond to an array reference which stores objects of
	the class L<GenOO::Region> sorted by start position.

=head1 EXAMPLES

    # Get the records contained in a specific region
    my @recs = $region_collection->records_contained_in_region(
		1, 'chr3', 127726308, 127792250);

    # Get the longest record
    my $longest_record = $region_collection->longest_record;

=cut

# Let the code begin...

package GenOO::RegionCollection::Type::DoubleHashArray;
$GenOO::RegionCollection::Type::DoubleHashArray::VERSION = '1.5.2';

#######################################################################
#######################   Load External modules   #####################
#######################################################################
use Modern::Perl;
use autodie;
use Moose;
use namespace::autoclean;


#######################################################################
#########################   Load GenOO modules   ######################
#######################################################################
use GenOO::Module::Search::Binary;
use GenOO::Data::Structure::DoubleHashArray;


#######################################################################
#######################   Interface attributes   ######################
#######################################################################
has 'name' => (
	isa => 'Str',
	is  => 'rw'
);

has 'species' => (
	isa => 'Str',
	is  => 'rw'
);

has 'description' => (
	isa => 'Str',
	is  => 'rw'
);

has 'longest_record' => (
	is        => 'ro',
	builder   => '_find_longest_record',
	clearer   => '_clear_longest_record',
	init_arg  => undef,
	lazy      => 1,
);

has 'extra' => (
	is => 'rw'
);


#######################################################################
########################   Private attributes   #######################
#######################################################################
has '_container' => (
	is => 'ro',
	builder => '_build_container',
	init_arg => undef,
	lazy => 1
);

#######################################################################
##########################   Consumed Roles   #########################
#######################################################################
with 'GenOO::RegionCollection';


#######################################################################



( run in 3.135 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )