| 1 | package Bio::Roary::External::Prank; | ||||||||||
| 2 | 2 | $Bio::Roary::External::Prank::VERSION = '3.13.0'; | |||||||||
| 3 | # ABSTRACT: Wrapper to run prank | ||||||||||
| 4 | |||||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | ▶ | use File::Spec; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | with 'Bio::Roary::JobRunner::Role'; | |||||||||
| 9 | |||||||||||
| 10 | 2 | has 'input_filename' => ( is => 'ro', isa => 'Str', required => 1 ); | |||||||||
| 11 | 2 | has 'output_filename' => ( is => 'ro', isa => 'Str', default => 'output' ); | |||||||||
| 12 | 2 | has 'exec' => ( is => 'ro', isa => 'Str', default => 'prank' ); | |||||||||
| 13 | |||||||||||
| 14 | # Overload Role | ||||||||||
| 15 | 2 | has 'memory_in_mb' => ( is => 'ro', isa => 'Int', lazy => 1, builder => '_build_memory_in_mb' ); | |||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | sub _build_memory_in_mb { | ||||||||
|
Subroutine
_build_memory_in_mb: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 1 | my ($self) = @_; | |||||||||
| 19 | 1 | my $memory_required = 2000; | |||||||||
| 20 | 1 | return $memory_required; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 3 | ▶ | sub _command_to_run { | ||||||||
|
Subroutine
_command_to_run: called CC=2 SCAR=7.6
| |||||||||||
| 24 | 3 | my ($self) = @_; | |||||||||
| 25 | |||||||||||
| 26 | 3 | ▶ | if(! -e $self->input_filename) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | { | ||||||||||
| 28 | 0 | $self->logger->error( "Input file to PRANK missing: " . $self->input_filename ); | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 3 | return join( | |||||||||
| 32 | ' ', | ||||||||||
| 33 | ( | ||||||||||
| 34 | $self->exec, | ||||||||||
| 35 | "-d=" . $self->input_filename, | ||||||||||
| 36 | "-o=" . $self->output_filename, | ||||||||||
| 37 | '-codon', '-F', '-quiet', '-once', '> /dev/null 2>&1', | ||||||||||
| 38 | '&&', 'mv', $self->output_filename . '*.fas', | ||||||||||
| 39 | $self->output_filename | ||||||||||
| 40 | ) | ||||||||||
| 41 | ); | ||||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 1 | ▶ | sub run { | ||||||||
|
Subroutine
run: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 45 | 1 | my ($self) = @_; | |||||||||
| 46 | 1 | my @commands_to_run; | |||||||||
| 47 | |||||||||||
| 48 | 1 | push( @commands_to_run, $self->_command_to_run() ); | |||||||||
| 49 | 1 | $self->logger->info( "Running command: " . $self->_command_to_run() ); | |||||||||
| 50 | |||||||||||
| 51 | 1 | my $job_runner_obj = $self->_job_runner_class->new( | |||||||||
| 52 | commands_to_run => \@commands_to_run, | ||||||||||
| 53 | memory_in_mb => $self->memory_in_mb, | ||||||||||
| 54 | queue => $self->_queue, | ||||||||||
| 55 | cpus => $self->cpus | ||||||||||
| 56 | ); | ||||||||||
| 57 | 1 | $job_runner_obj->run(); | |||||||||
| 58 | |||||||||||
| 59 | 1 | 1; | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | 2 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 63 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||
| 64 | |||||||||||
| 65 | 2 | 1; | |||||||||
| 66 | |||||||||||
| 67 | __END__ | ||||||||||