Bio-MUST-Core
view release on metacpan or search on metacpan
lib/Bio/MUST/Core/Ali/Stash.pm view on Meta::CPAN
package Bio::MUST::Core::Ali::Stash;
# ABSTRACT: Thin wrapper for an indexed Ali read from disk
$Bio::MUST::Core::Ali::Stash::VERSION = '0.252040';
use Moose;
use namespace::autoclean;
use autodie;
use feature qw(say);
use Smart::Comments;
use Carp;
use Bio::MUST::Core::Types;
use Bio::MUST::Core::Constants qw(:seqids);
use aliased 'Bio::MUST::Core::Ali';
# ATTRIBUTES
has 'seqs' => (
is => 'ro',
isa => 'Bio::MUST::Core::Ali',
required => 1,
handles => [
qw(filename count_comments all_comments get_comment
guessing all_seq_ids has_uniq_ids is_protein is_aligned
get_seq first_seq all_seqs filter_seqs count_seqs
gapmiss_regex
)
], # comment-related methods needed by IdList
);
has 'lookup' => (
is => 'ro',
isa => 'Bio::MUST::Core::IdList',
init_arg => undef,
lazy => 1,
builder => '_build_lookup',
handles => [ qw(index_for) ],
);
with 'Bio::MUST::Core::Roles::Aliable';
## no critic (ProhibitUnusedPrivateSubroutines)
sub _build_lookup {
return shift->seqs->new_lookup;
}
## use critic
# ACCESSORS
sub get_seq_with_id {
my $self = shift;
my $id = shift;
# override Ali method with faster lookup-based alternative
my $index = $self->index_for($id);
return $self->get_seq($index)
if defined $index;
( run in 0.466 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )