Bio-RNA-Treekin
view release on metacpan or search on metacpan
lib/Bio/RNA/Treekin/Record.pm view on Meta::CPAN
# Bio/RNA/Treekin/Record.pm
# Stores a data from a single row of the Treekin file, i.e. the populations of
# all minima at a given time point.
package Bio::RNA::Treekin::Record;
our $VERSION = '0.05';
use v5.14; # required for non-destructive subst m///r
use strict;
use warnings;
use Moose;
use MooseX::StrictConstructor;
use namespace::autoclean;
use autodie qw(:all);
use Scalar::Util qw(reftype openhandle);
use List::Util qw(first pairmap max uniqnum all);
use Carp qw(croak);
use Bio::RNA::Treekin::PopulationDataRecord;
use overload '""' => \&stringify;
has '_population_data' => (
is => 'ro',
required => 1,
init_arg => 'population_data',
);
has 'date' => (is => 'ro', required => 1);
has 'sequence' => (is => 'ro', required => 1);
has 'method' => (is => 'ro', required => 1);
has 'start_time' => (is => 'ro', required => 1);
has 'stop_time' => (is => 'ro', required => 1);
has 'temperature' => (is => 'ro', required => 1);
has 'basename' => (is => 'ro', required => 1);
has 'time_increment' => (is => 'ro', required => 1);
has 'degeneracy' => (is => 'ro', required => 1);
has 'absorbing_state' => (is => 'ro', required => 1);
has 'states_limit' => (is => 'ro', required => 1);
# Add optional attributes including predicate.
has $_ => (
is => 'ro',
required => 0,
predicate => "has_$_",
)
foreach qw(
info
init_population
rates_file
file_index
cmd
of_iterations
);
# Get number of population data rows stored.
sub population_data_count {
my ($self) = @_;
my $data_count = @{ $self->_population_data };
return $data_count;
}
# Number of states / minima in this simulation.
# Get number of mins in the first population record; it should be the
# same for all records.
sub min_count {
my $self = shift;
my $first_pop = $self->population(0);
confess 'min_count: no population data present'
( run in 2.132 seconds using v1.01-cache-2.11-cpan-98e64b0badf )