lib/Bio/Roary/External/Mafft.pm

filter: Statementstmt 96.7% 30 / 31 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 92.5% 37 / 40 CC 2 SCAR 2.8
CC
2
Cov
94%
_command_to_run
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« lib/Bio/Roary/SpreadsheetRole.pm ↑ Summary lib/Bio/Roary/External/Prank.pm »
1 package Bio::Roary::External::Mafft;
2 2 $Bio::Roary::External::Mafft::VERSION = '3.13.0';
3 # ABSTRACT: Wrapper to run mafft
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 => 'mafft' );
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
BranchTrueFalseTotal
unless (-e $self->input_filename) 0 3 3
27 {
28 0 $self->logger->error( "Input file to MAFFT missing: " . $self->input_filename );
29 }
30 3 return join(
31 ' ',
32 (
33 $self->exec,
34 '--auto',
35 '--quiet',
36 $self->input_filename,
37 '>',
38 $self->output_filename
39 )
40 );
41 }
42  
43 1 ▶sub run {
Subroutine run: called CC=1 SCAR=0.0
Pod undocumented
44 1 my ($self) = @_;
45 1 my @commands_to_run;
46  
47 1 push( @commands_to_run, $self->_command_to_run() );
48 1 $self->logger->info( "Running command: " . $self->_command_to_run() );
49  
50 1 my $job_runner_obj = $self->_job_runner_class->new(
51 commands_to_run => \@commands_to_run,
52 memory_in_mb => $self->memory_in_mb,
53 queue => $self->_queue,
54 cpus => $self->cpus
55 );
56 1 $job_runner_obj->run();
57  
58 1 1;
59 }
60  
61 2 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
62 2 __PACKAGE__->meta->make_immutable;
63  
64 2 1;
65  
66 __END__
« lib/Bio/Roary/SpreadsheetRole.pm ↑ Summary lib/Bio/Roary/External/Prank.pm »