| 1 | package Bio::Roary::External::Makeblastdb; | ||
| 2 | 5 | $Bio::Roary::External::Makeblastdb::VERSION = '3.13.0'; | |
| 3 | # ABSTRACT: Wrapper around NCBIs makeblastdb command | ||
| 4 | |||
| 5 | |||
| 6 | 5 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 5 | ▶ | use File::Temp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 5 | ▶ | use Cwd; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 5 | with 'Bio::Roary::JobRunner::Role'; | |
| 10 | |||
| 11 | 5 | has 'fasta_file' => ( is => 'ro', isa => 'Str', required => 1 ); | |
| 12 | 5 | has 'exec' => ( is => 'ro', isa => 'Str', default => 'makeblastdb' ); | |
| 13 | 4 | ▶ | has '_working_directory' => ( is => 'ro', isa => 'File::Temp::Dir', default => sub { File::Temp->newdir( DIR => getcwd, CLEANUP => 1 ); } ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 14 | 5 | has '_dbtype' => ( is => 'ro', isa => 'Str', default => 'prot' ); | |
| 15 | 5 | has '_logfile' => ( is => 'ro', isa => 'Str', default => '/dev/null' ); | |
| 16 | 5 | has 'output_database' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_output_database' ); | |
| 17 | |||
| 18 | # Overload Role | ||
| 19 | 5 | has 'memory_in_mb' => ( is => 'ro', isa => 'Int', default => 4000); | |
| 20 | |||
| 21 | 4 | ▶ | sub _build_output_database { |
|
Subroutine
_build_output_database: called CC=1 SCAR=0.0
| |||
| 22 | 4 | my ($self) = @_; | |
| 23 | 4 | return join( '/', ( $self->_working_directory->dirname(), 'output_contigs' ) ); | |
| 24 | } | ||
| 25 | |||
| 26 | 9 | ▶ | sub _command_to_run { |
|
Subroutine
_command_to_run: called CC=1 SCAR=0.0
| |||
| 27 | 9 | my ($self) = @_; | |
| 28 | 9 | return join( | |
| 29 | " ", | ||
| 30 | ( | ||
| 31 | $self->exec, | ||
| 32 | '-in', $self->fasta_file, | ||
| 33 | '-dbtype', $self->_dbtype, | ||
| 34 | '-out', $self->output_database, | ||
| 35 | '-logfile', $self->_logfile | ||
| 36 | ) | ||
| 37 | ); | ||
| 38 | } | ||
| 39 | |||
| 40 | 4 | ▶ | sub run { |
|
Subroutine
run: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 41 | 4 | my ($self) = @_; | |
| 42 | 4 | my @commands_to_run; | |
| 43 | 4 | push(@commands_to_run, $self->_command_to_run ); | |
| 44 | 4 | $self->logger->info( "Running command: " . $self->_command_to_run() ); | |
| 45 | 4 | my $job_runner_obj = $self->_job_runner_class->new( commands_to_run => \@commands_to_run, memory_in_mb => $self->memory_in_mb, queue => $self->_queue, cpus => $self->cpus ); | |
| 46 | 4 | $job_runner_obj->run(); | |
| 47 | |||
| 48 | 4 | 1; | |
| 49 | } | ||
| 50 | |||
| 51 | 5 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 52 | 5 | __PACKAGE__->meta->make_immutable; | |
| 53 | 5 | 1; | |
| 54 | |||
| 55 | __END__ | ||