File Coverage

lib/Bio/Roary/CombinedProteome.pm
Criterion Covered Total %
statement 19 19 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 26 28 92.8


line stmt bran cond sub pod time code
1             package Bio::Roary::CombinedProteome;
2             $Bio::Roary::CombinedProteome::VERSION = '3.11.0';
3             # ABSTRACT: Take in multiple FASTA sequences containing proteomes and concat them together and output a FASTA file, filtering out more than 5% X's
4              
5              
6 3     3   84908 use Moose;
  3         373350  
  3         20  
7 3     3   18127 use Bio::Roary::Exceptions;
  3         7  
  3         491  
8              
9             has 'proteome_files' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
10             has 'output_filename' => ( is => 'ro', isa => 'Str', default => 'combined_output.fa' );
11              
12             sub BUILD {
13 3     3 0 10 my ($self) = @_;
14              
15 3         4 for my $filename ( @{ $self->proteome_files } ) {
  3         84  
16 5 100       177 Bio::Roary::Exceptions::FileNotFound->throw( error => 'Cant open file: ' . $filename )
17             unless ( -e $filename );
18             }
19             }
20              
21              
22              
23             sub create_combined_proteome_file {
24 1     1 0 2 my ($self) = @_;
25            
26 1         26 unlink($self->output_filename);
27 1         2 for my $filename (@{$self->proteome_files })
  1         21  
28             {
29 2         96 system(join(' ', ("cat", $filename, ">>", $self->output_filename)));
30             }
31              
32 1         30 1;
33             }
34              
35 3     3   19 no Moose;
  3         7  
  3         18  
36             __PACKAGE__->meta->make_immutable;
37              
38             1;
39              
40             __END__
41              
42             =pod
43              
44             =encoding UTF-8
45              
46             =head1 NAME
47              
48             Bio::Roary::CombinedProteome - Take in multiple FASTA sequences containing proteomes and concat them together and output a FASTA file, filtering out more than 5% X's
49              
50             =head1 VERSION
51              
52             version 3.11.0
53              
54             =head1 SYNOPSIS
55              
56             Take in multiple FASTA sequences containing proteomes and concat them together and output a FASTA file, filtering out more than 5% X's
57             use Bio::Roary::CombinedProteome;
58              
59             my $obj = Bio::Roary::CombinedProteome->new(
60             proteome_files => ['abc.fa','efg.fa'],
61             output_filename => 'example_output.fa',
62             maximum_percentage_of_unknowns => 5.0,
63             );
64             $obj->create_combined_proteome_file;
65              
66             =head1 AUTHOR
67              
68             Andrew J. Page <ap13@sanger.ac.uk>
69              
70             =head1 COPYRIGHT AND LICENSE
71              
72             This software is Copyright (c) 2013 by Wellcome Trust Sanger Institute.
73              
74             This is free software, licensed under:
75              
76             The GNU General Public License, Version 3, June 2007
77              
78             =cut