lib/Bio/Roary/External/Fasttree.pm

filter: Statementstmt 42.8% 15 / 35 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 40.0% 2 / 5 Podpod 0.0% 0 / 1 totaltotal 32.6% 17 / 52 CC 5 SCAR 23.7
CC
5
Cov
34%
run
20.0
_command_to_run
6.0
_build_output_file
2.0
CRAP 10.7
« lib/Bio/Roary/AccessoryClustering.pm ↑ Summary lib/Bio/Roary/CommandLine/ExtractProteomeFromGff.pm »
1 package Bio::Roary::External::Fasttree;
2 1 $Bio::Roary::External::Fasttree::VERSION = '3.13.0';
3 # ABSTRACT: Wrapper to run Fasttree
4  
5  
6 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 with 'Bio::Roary::JobRunner::Role';
8  
9 1 has 'input_file' => ( is => 'ro', isa => 'Str', required => 1 );
10 1 has 'output_file' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_output_file' );
11 1 has 'exec' => ( is => 'ro', isa => 'Str', default => 'FastTree' );
12 1 has 'alt_exec' => ( is => 'ro', isa => 'Str', default => 'fasttree' );
13 1 has '_logging' => ( is => 'ro', isa => 'Str', default => '2> /dev/null' );
14  
15 sub _build_output_file
16 0 ▶{
Subroutine _build_output_file: not called CC=1 SCAR=6.9
17 0 my ($self) = @_;
18 0 return $self->input_file.".newick";
19 }
20  
21 0 ▶sub _command_to_run {
Subroutine _command_to_run: not called CC=2 SCAR=17.9
22 0 my ($self) = @_;
23  
24 0 my $executable = $self->_find_exe([$self->exec, $self->alt_exec]);
25 0 my $logging_str = "";
26 0 ▶ $logging_str = $self->_logging if(! $self->verbose);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->verbose 0 0 0
27  
28 0 return join(
29 ' ', ($executable, '-fastest', '-nt', $self->input_file, '>', $self->output_file, $logging_str)
30 );
31 }
32  
33 0 ▶sub run {
Subroutine run: not called CC=4 SCAR=30.0
Pod undocumented
34 0 my ($self) = @_;
35 0 my @commands_to_run;
36  
37 0 ▶ if(!defined($self->input_file) || ! ( -e $self->input_file))
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->input_file and -e $self->input_file) 0 0 0
Condition0%0/3
defined $self->input_file and -e $self->input_file
!ll&&!rl&&r
000
MC/DC0%0/2
defined $self->input_file and -e $self->input_file
defined $self->input_file -e $self->input_file
Truth table0%0/3
A and B
A= defined $self->input_fileB= -e $self->input_file
ABresult
0X0
100
111
38 {
39 0 $self->logger->error( "The input file is missing so not creating a tree" );
40 0 return 1;
41 }
42  
43 0 ▶ if(-s $self->input_file < 5)
Branch: 1 branch
BranchTrueFalseTotal
if (-s $self->input_file < 5) 0 0 0
44 {
45 0 $self->logger->info( "The input file is too small so not creating a tree" );
46 0 return 1;
47 }
48  
49 0 push(@commands_to_run, $self->_command_to_run() );
50 0 $self->logger->info( "Running command: " . $self->_command_to_run() );
51 0 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 );
52 0 $job_runner_obj->run();
53
54 0 1;
55 }
56  
57 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
58 1 __PACKAGE__->meta->make_immutable;
59  
60 1 1;
61  
62 __END__
« lib/Bio/Roary/AccessoryClustering.pm ↑ Summary lib/Bio/Roary/CommandLine/ExtractProteomeFromGff.pm »