Bio-Palantir

 view release on metacpan or  search on metacpan

lib/Bio/Palantir/Refiner.pm  view on Meta::CPAN

package Bio::Palantir::Refiner;
# ABSTRACT: front-end class for Bio::Palantir::Refiner module, wich handles the refinement of NRPS/PKS BGC annotations
$Bio::Palantir::Refiner::VERSION = '0.211420';
use Moose;
use namespace::autoclean;

use Data::UUID;

use aliased 'Bio::Palantir::Parser';
use aliased 'Bio::Palantir::Refiner::ClusterPlus';
extends 'Bio::FastParsers::Base';


# ATTRIBUTES



has 'module_delineation' => (
    is      => 'ro',
    isa     => 'Str',
    default => 'substrate-selection',
);


has 'clusters' => (
    traits   => ['Array'],
    is       => 'ro',
    isa      => 'ArrayRef[Bio::Palantir::Refiner::ClusterPlus]',
    init_arg => undef,
    lazy     => 1,
    builder  => '_build_clusters',
    handles  => {
         count_clusters => 'count',
           all_clusters => 'elements',
           get_cluster  => 'get',
          next_cluster  => 'shift',        
    },
);

## no critic (ProhibitUnusedPrivateSubroutines)

sub _build_clusters {
    my $self = shift;
   
    my $report = Parser->new( file => $self->file );
    my $root = $report->root;

    my @cluster_plus;
    push @cluster_plus, ClusterPlus->new(
        _cluster => $_,
        module_delineation => $self->module_delineation
        ) for $root->all_clusters
    ;

    return \@cluster_plus;

}

## use critic


__PACKAGE__->meta->make_immutable;
1;

__END__



( run in 1.001 second using v1.01-cache-2.11-cpan-98e64b0badf )