File Coverage

lib/Bio/VertRes/Config/Pipelines/SmaltMapping.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::SmaltMapping;
2              
3             # ABSTRACT: Base class for the smalt mapper
4              
5              
6 1     1   133026 use Moose;
  0            
  0            
7             extends 'Bio::VertRes::Config::Pipelines::Mapping';
8              
9             has 'slx_mapper' => ( is => 'ro', isa => 'Str', default => 'smalt' );
10             has 'slx_mapper_exe' => ( is => 'ro', isa => 'Str', default => '/software/pathogen/external/apps/usr/local/smalt-0.7.4/smalt_x86_64' );
11              
12             has 'additional_mapper_params' => ( is => 'ro', isa => 'Maybe[Str]' );
13             has 'mapper_index_params' => ( is => 'ro', isa => 'Maybe[Str]' );
14             has '_mapper_index_suffix' => ( is => 'ro', isa => 'Maybe[Str]', lazy => 1, builder => '_build__mapper_index_suffix' );
15              
16             sub _build__mapper_index_suffix {
17             my ($self) = @_;
18             if ( defined( $self->mapper_index_params ) ) {
19             my $mapping_index_suffix = $self->mapper_index_params;
20             $mapping_index_suffix =~ s![^\da-z]!!gi;
21             return $mapping_index_suffix;
22             }
23             return undef;
24             }
25              
26             override 'to_hash' => sub {
27             my ($self) = @_;
28             my $output_hash = super();
29              
30             $output_hash->{data}{additional_mapper_params} = $self->additional_mapper_params if ( defined( $self->additional_mapper_params ) );
31             $output_hash->{data}{mapper_index_params} = $self->mapper_index_params if ( defined( $self->mapper_index_params ) );
32             $output_hash->{data}{mapper_index_suffix} = $self->_mapper_index_suffix if ( defined( $self->_mapper_index_suffix ) );
33              
34             return $output_hash;
35             };
36              
37             __PACKAGE__->meta->make_immutable;
38             no Moose;
39             1;
40              
41             __END__
42              
43             =pod
44              
45             =head1 NAME
46              
47             Bio::VertRes::Config::Pipelines::SmaltMapping - Base class for the smalt mapper
48              
49             =head1 VERSION
50              
51             version 1.133090
52              
53             =head1 SYNOPSIS
54              
55             Base class for the smalt mapper. Can be used on its own as is, or more probably subclassed to provide a standard mapping method for a particular group.
56             use Bio::VertRes::Config::Pipelines::SmaltMapping;
57              
58             my $pipeline = Bio::VertRes::Config::Pipelines::SmaltMapping->new(
59             database => 'abc',
60             reference => 'Staphylococcus_aureus_subsp_aureus_ABC_v1',
61             limits => {
62             project => ['ABC study'],
63             species => ['EFG']
64             },
65             additional_mapper_params => '-x',
66             mapper_index_params => '-s 5'
67             );
68             $pipeline->to_hash();
69              
70             =head1 AUTHOR
71              
72             Andrew J. Page <ap13@sanger.ac.uk>
73              
74             =head1 COPYRIGHT AND LICENSE
75              
76             This software is Copyright (c) 2013 by Wellcome Trust Sanger Institute.
77              
78             This is free software, licensed under:
79              
80             The GNU General Public License, Version 3, June 2007
81              
82             =cut