File Coverage

lib/Bio/VertRes/Config/Pipelines/BamImprovement.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Bio::VertRes::Config::Pipelines::BamImprovement;
2              
3             # ABSTRACT: The base class for the bam improvement pipeline.
4              
5              
6 1     1   132268 use Moose;
  0            
  0            
7             use Bio::VertRes::Config::Pipelines::Common;
8             use Bio::VertRes::Config::References;
9             use Bio::VertRes::Config::Pipelines::Roles::MetaDataFilter;
10             use Bio::VertRes::Config::Pipelines::Roles::MultiplePrefix;
11             extends 'Bio::VertRes::Config::Pipelines::Common';
12             with 'Bio::VertRes::Config::Pipelines::Roles::MetaDataFilter';
13             with 'Bio::VertRes::Config::Pipelines::Roles::MultiplePrefix';
14             with 'Bio::VertRes::Config::Pipelines::Roles::FilenameWithReference';
15              
16             has 'pipeline_short_name' => ( is => 'ro', isa => 'Str', default => 'improvement' );
17             has 'module' => ( is => 'ro', isa => 'Str', default => 'VertRes::Pipelines::BamImprovement::NonHuman' );
18             has 'reference' => ( is => 'ro', isa => 'Str', required => 1 );
19             has 'reference_lookup_file' => ( is => 'ro', isa => 'Str', required => 1);
20             has 'toplevel_action' => ( is => 'ro', isa => 'Str', default => '__VRTrack_BamImprovement__' );
21              
22             has 'slx_mapper' => ( is => 'ro', isa => 'Str', default => 'smalt' );
23             has '_reference_fasta' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build__reference_fasta' );
24             has '_keep_original_bam_files' => ( is => 'ro', isa => 'Bool', default => 0 );
25             has '_ignore_bam_improvement_status' => ( is => 'ro', isa => 'Int', default => 1 );
26              
27             sub _build__reference_fasta {
28             my ($self) = @_;
29             Bio::VertRes::Config::References->new( reference_lookup_file => $self->reference_lookup_file )
30             ->get_reference_location_on_disk( $self->reference );
31             }
32              
33             override 'to_hash' => sub {
34             my ($self) = @_;
35             my $output_hash = super();
36             $output_hash->{limits} = $self->_escaped_limits;
37            
38             $output_hash->{vrtrack_processed_flags} = { import => 1, qc => 1, stored => 1, mapped => 1 };
39             $output_hash->{data}{reference} = $self->_reference_fasta;
40             $output_hash->{data}{assembly_name} = $self->reference;
41             $output_hash->{data}{slx_mapper} = $self->slx_mapper;
42             $output_hash->{data}{keep_original_bam_files} = $self->_keep_original_bam_files;
43             $output_hash->{data}{ignore_bam_improvement_status} = $self->_ignore_bam_improvement_status;
44             return $output_hash;
45             };
46              
47             __PACKAGE__->meta->make_immutable;
48             no Moose;
49             1;
50              
51             __END__
52              
53             =pod
54              
55             =head1 NAME
56              
57             Bio::VertRes::Config::Pipelines::BamImprovement - The base class for the bam improvement pipeline.
58              
59             =head1 VERSION
60              
61             version 1.133090
62              
63             =head1 SYNOPSIS
64              
65             The base class for the bam improvement pipeline.
66             use Bio::VertRes::Config::Pipelines::BamImprovement;
67              
68             my $pipeline = Bio::VertRes::Config::Pipelines::BamImprovement->new(
69             database => 'abc',
70             reference => 'Staphylococcus_aureus_subsp_aureus_ABC_v1',
71             limits => {
72             project => ['ABC study'],
73             species => ['EFG']
74             }
75              
76             );
77             $pipeline->to_hash();
78              
79             =head1 AUTHOR
80              
81             Andrew J. Page <ap13@sanger.ac.uk>
82              
83             =head1 COPYRIGHT AND LICENSE
84              
85             This software is Copyright (c) 2013 by Wellcome Trust Sanger Institute.
86              
87             This is free software, licensed under:
88              
89             The GNU General Public License, Version 3, June 2007
90              
91             =cut