lib/Bio/AssemblyImprovement/FillGaps/GapFiller/Main.pm

filter: Statementstmt 100% 41 / 41 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 1 / 1 totaltotal 98.0% 51 / 52 CC 2 SCAR 2.0
CC
2
Cov
98%
run
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« lib/Bio/AssemblyImprovement/Assemble/SGA/IndexAndCorrectReads.pm ↑ Summary lib/Bio/AssemblyImprovement/Scaffold/SSpace/Main.pm »
1 package Bio::AssemblyImprovement::FillGaps::GapFiller::Main;
2 # ABSTRACT: Run a single iteration of gapfiller
3  
4  
5 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Cwd;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use File::Copy;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Bio::AssemblyImprovement::FillGaps::GapFiller::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 with 'Bio::AssemblyImprovement::Scaffold::SSpace::OutputFilenameRole';
10 2 with 'Bio::AssemblyImprovement::Scaffold::SSpace::TempDirectoryRole';
11  
12 2 has 'input_files' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
13 2 has 'insert_size' => ( is => 'ro', isa => 'Int', required => 1 );
14 2 has 'mapper' => ( is => 'ro', isa => 'Str', default => 'bwa' );
15 2 has 'merge_size' => ( is => 'ro', isa => 'Int', default => 10 );
16 2 has 'threads' => ( is => 'ro', isa => 'Int', default => 1 );
17 2 has 'gap_filler_exec' => ( is => 'rw', isa => 'Str', required => 1 );
18 2 has 'debug' => ( is => 'ro', isa => 'Bool', default => 0 );
19 2 has 'num_iterations' => ( is => 'ro', isa => 'Int', default => 20 );
20  
21 2 has '_config_file_obj' => ( is => 'ro', isa => 'Bio::AssemblyImprovement::FillGaps::GapFiller::Config', lazy => 1, builder => '_build__config_file_obj' );
22  
23 24 ▶sub _build__config_file_obj {
Subroutine _build__config_file_obj: called CC=1 SCAR=0.0
24 24 my ($self) = @_;
25 24 Bio::AssemblyImprovement::FillGaps::GapFiller::Config->new(
26 input_files => $self->input_files,
27 insert_size => $self->insert_size,
28 output_filename => join( '/', ( $self->_temp_directory, '_gap_filler.config' ) ),
29 mapper => $self->mapper
30 )->create_config_file();
31 }
32  
33 24 ▶sub _intermediate_file_name {
Subroutine _intermediate_file_name: called CC=1 SCAR=0.0
34 24 my ($self) = @_;
35 24 $self->_output_prefix.'/'.$self->_output_prefix . '.gapfilled.final.fa';
36 }
37  
38 24 ▶sub run {
Subroutine run: called CC=2 SCAR=6.9
Pod documented
39 24 my ($self) = @_;
40 24 my $original_cwd = getcwd();
41 24 chdir( $self->_temp_directory );
42
43 24 my $stdout_of_program = '';
44 24 ▶ $stdout_of_program = "> /dev/null 2>&1" if($self->debug == 0);
Branch: 1 branch
BranchTrueFalseTotal
if $self->debug == 0 24 0 24
45  
46 24 system(
47 join(
48 ' ',
49 (
50 'perl', $self->gap_filler_exec,
51 '-l', $self->_config_file_obj->output_filename,
52 '-s', $self->input_assembly,
53 '-i', $self->num_iterations,
54 '-m', $self->merge_size,
55 '-T', $self->threads,
56 '-b', $self->_output_prefix,
57 $stdout_of_program
58 )
59 )
60 );
61 24 move( $self->_intermediate_file_name, $self->output_filename );
62 24 chdir($original_cwd);
63 24 return $self;
64 }
65  
66 2 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
67 2 __PACKAGE__->meta->make_immutable;
68 2 1;
69  
70 __END__
« lib/Bio/AssemblyImprovement/Assemble/SGA/IndexAndCorrectReads.pm ↑ Summary lib/Bio/AssemblyImprovement/Scaffold/SSpace/Main.pm »