Bio-AutomatedAnnotation

 view release on metacpan or  search on metacpan

lib/Bio/AutomatedAnnotation/CommandLine/AnnotateBacteria.pm  view on Meta::CPAN

package Bio::AutomatedAnnotation::CommandLine::AnnotateBacteria;
$Bio::AutomatedAnnotation::CommandLine::AnnotateBacteria::VERSION = '1.182770';
# ABSTRACT: provide a commandline interface to the annotation wrappers


use Moose;
use Getopt::Long qw(GetOptionsFromArray);
use Bio::AutomatedAnnotation;

has 'args'        => ( is => 'ro', isa => 'ArrayRef', required => 1 );
has 'script_name' => ( is => 'ro', isa => 'Str',      required => 1 );
has 'help'        => ( is => 'rw', isa => 'Bool',     default  => 0 );

has 'sample_name'       => ( is => 'rw', isa => 'Str'  );
has 'dbdir'             => ( is => 'rw', isa => 'Str', default => '/lustre/scratch118/infgen/pathogen/pathpipe/prokka'  );
has 'assembly_file'     => ( is => 'rw', isa => 'Str'  );
has 'annotation_tool'   => ( is => 'rw', isa => 'Str', default  => 'Prokka' );
has 'tmp_directory'     => ( is => 'rw', isa => 'Str', default  => '/tmp' );
has 'sequencing_centre' => ( is => 'rw', isa => 'Str', default  => 'SC' );
has 'accession_number'  => ( is => 'rw', isa => 'Maybe[Str]' );
has 'genus'             => ( is => 'rw', isa => 'Str' );
has 'kingdom'           => ( is => 'rw', isa => 'Str', default  => 'Bacteria' );
has 'cpus'              => ( is => 'rw', isa => 'Int', default  => 1);
has 'gcode'             => ( is => 'rw', isa => 'Int', default  => 11 );
has 'outdir'            => ( is => 'rw', isa => 'Str', default  => 'annotation' );
has 'keep_original_order_and_names' => ( is => 'rw', isa => 'Bool', default => 0 );

sub BUILD {
    my ($self) = @_;

    my ( $sample_name, $kingdom, $dbdir, $assembly_file, $annotation_tool, $tmp_directory, $sequencing_centre, $accession_number,$genus, $cpus, $gcode,
        $help, $keep_original_order_and_names, $outdir );

    GetOptionsFromArray(
        $self->args,
        's|sample_name=s'       => \$sample_name,
        'd|dbdir=s'             => \$dbdir,
        'a|assembly_file=s'     => \$assembly_file,
        't|tmp_directory=s'     => \$tmp_directory,
        'p|annotation_tool=s'   => \$annotation_tool,
        'c|sequencing_centre=s' => \$sequencing_centre,
        'g|genus=s'             => \$genus,
        'k|kingdom=s'           => \$kingdom,
        'i|cpus=s'              => \$cpus,
        'n|accession_number=s'  => \$accession_number,
        'h|help'                => \$help,
				'o|outdir=s'            => \$outdir,
        'gcode=i'               => \$gcode,
        'keep_original_order_and_names' => \$keep_original_order_and_names,
    );

    $self->sample_name($sample_name)             if ( defined($sample_name) );
    $self->dbdir($dbdir)                         if ( defined($dbdir) );
    $self->assembly_file($assembly_file)         if ( defined($assembly_file) );
    $self->annotation_tool($annotation_tool)     if ( defined($annotation_tool) );
    $self->tmp_directory($tmp_directory)         if ( defined($tmp_directory) );
    $self->sequencing_centre($sequencing_centre) if ( defined($sequencing_centre) );
    $self->accession_number($accession_number)   if ( defined($accession_number) );
    $self->genus($genus)                         if ( defined($genus) );
    $self->kingdom($kingdom)                     if ( defined($kingdom) );
    $self->cpus($cpus)                           if ( defined($cpus) );
    $self->gcode($gcode)                         if ( defined($gcode) );
		$self->outdir($outdir)                       if ( defined($outdir) );
    $self->keep_original_order_and_names($keep_original_order_and_names) if ( defined($keep_original_order_and_names) );
}

sub run {
    my ($self) = @_;
    (( -e $self->assembly_file ) && ! $self->help ) or die $self->usage_text;



( run in 3.313 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )