File Coverage

lib/Bio/Roary/Output/GroupsMultifastas.pm
Criterion Covered Total %
statement 22 22 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 29 31 93.5


line stmt bran cond sub pod time code
1             package Bio::Roary::Output::GroupsMultifastas;
2             $Bio::Roary::Output::GroupsMultifastas::VERSION = '3.10.2';
3             # ABSTRACT: Take in a list of groups and create multifastas files for each group
4              
5              
6 2     2   87261 use Moose;
  2         396198  
  2         14  
7 2     2   13302 use Bio::Roary::Exceptions;
  2         5  
  2         61  
8 2     2   223 use Bio::Roary::AnalyseGroups;
  2         4  
  2         79  
9 2     2   892 use Bio::Roary::Output::GroupMultifasta;
  2         6  
  2         291  
10              
11             has 'group_names' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
12             has 'analyse_groups' => ( is => 'ro', isa => 'Bio::Roary::AnalyseGroups', required => 1 );
13             has 'output_filename_base' => ( is => 'ro', isa => 'Str', default => 'output_groups' );
14              
15             sub create_files {
16 7     7 0 28 my ($self) = @_;
17 7         17 for my $group_name ( @{ $self->group_names } ) {
  7         256  
18             # Check the group name exists
19 12 50       1028 next unless($self->analyse_groups->_groups_to_genes->{$group_name});
20 12         329 my $group_multifasta = Bio::Roary::Output::GroupMultifasta->new(
21             group_name => $group_name,
22             analyse_groups => $self->analyse_groups,
23             output_filename_base => $self->output_filename_base
24             );
25 12         79 $group_multifasta->create_file;
26             }
27 7         989 1;
28             }
29              
30 2     2   18 no Moose;
  2         4  
  2         10  
31             __PACKAGE__->meta->make_immutable;
32              
33             1;
34              
35             __END__
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Bio::Roary::Output::GroupsMultifastas - Take in a list of groups and create multifastas files for each group
44              
45             =head1 VERSION
46              
47             version 3.10.2
48              
49             =head1 SYNOPSIS
50              
51             Take in a list of groups and create multifastas files for each group
52             use Bio::Roary::Output::GroupsMultifastas;
53              
54             my $obj = Bio::Roary::Output::GroupsMultifastas->new(
55             group_names => ['aaa','bbb'],
56             analyse_groups => $analyse_groups
57             );
58             $obj->create_files();
59              
60             =head1 AUTHOR
61              
62             Andrew J. Page <ap13@sanger.ac.uk>
63              
64             =head1 COPYRIGHT AND LICENSE
65              
66             This software is Copyright (c) 2013 by Wellcome Trust Sanger Institute.
67              
68             This is free software, licensed under:
69              
70             The GNU General Public License, Version 3, June 2007
71              
72             =cut