lib/Bio/Roary/SpreadsheetRole.pm

filter: Statementstmt 93.7% 30 / 32 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 1 totaltotal 88.3% 38 / 43 CC 2 SCAR 2.9
CC
2
Cov
91%
_build__input_spreadsheet_fh
2.0
BUILD
2.0
BEGIN
1.0
CRAP 1.3
« lib/Bio/Roary/Output/CoreGeneAlignmentCoordinatesEMBL.pm ↑ Summary lib/Bio/Roary/External/Mafft.pm »
1 package Bio::Roary::SpreadsheetRole;
2 4 $Bio::Roary::SpreadsheetRole::VERSION = '3.13.0';
3 # ABSTRACT: Read and write a spreadsheet
4  
5 4 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 has 'spreadsheet' => ( is => 'ro', isa => 'Str', required => 1 );
8 4 has '_fixed_headers' => ( is => 'ro', isa => 'ArrayRef', lazy => 1, builder => '_build__fixed_headers' );
9 4 has '_input_spreadsheet_fh' => ( is => 'ro', lazy => 1, builder => '_build__input_spreadsheet_fh' );
10 4 has '_output_spreadsheet_fh' => ( is => 'ro', lazy => 1, builder => '_build__output_spreadsheet_fh' );
11 4 has '_fixed_headers' => ( is => 'ro', isa => 'ArrayRef', lazy => 1, builder => '_build__fixed_headers' );
12 4 has '_num_fixed_headers' => ( is => 'ro', isa => 'Int', lazy => 1, builder => '_build__num_fixed_headers' );
13 4 has '_csv_parser' => ( is => 'ro', isa => 'Text::CSV',lazy => 1, builder => '_build__csv_parser' );
14 4 has '_csv_output' => ( is => 'ro', isa => 'Text::CSV',lazy => 1, builder => '_build__csv_output' );
15  
16 sub BUILD
17 0 ▶{
Subroutine BUILD: not called CC=1 SCAR=6.9
Pod undocumented
18 0 my ($self) = @_;
19 0 $self->_input_spreadsheet_fh;
20 }
21  
22 sub _build__fixed_headers
23 18 ▶{
Subroutine _build__fixed_headers: called CC=1 SCAR=0.0
24 18 my ($self) = @_;
25 18 my @fixed_headers = @{Bio::Roary::GroupStatistics->fixed_headers()};
26 18 return \@fixed_headers;
27 }
28  
29 sub _build__csv_parser
30 18 ▶{
Subroutine _build__csv_parser: called CC=1 SCAR=0.0
31 18 my ($self) = @_;
32 18 return Text::CSV->new( { binary => 1, always_quote => 1} );
33 }
34  
35 sub _build__csv_output
36 14 ▶{
Subroutine _build__csv_output: called CC=1 SCAR=0.0
37 14 my ($self) = @_;
38 14 return Text::CSV->new( { binary => 1, always_quote => 1, eol => "\r\n"} );
39 }
40  
41 18 ▶sub _build__input_spreadsheet_fh {
Subroutine _build__input_spreadsheet_fh: called CC=2 SCAR=7.1
42 18 my ($self) = @_;
43 18 ▶ open( my $fh, $self->spreadsheet ) or die "Couldnt open input spreadsheet: ".$self->spreadsheet ;
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, $self->spreadsheet or die 'Couldnt open input spreadsheet: ' . $self->spreadsheet 18 0 18
44 18 return $fh;
45 }
46  
47 14 ▶sub _build__output_spreadsheet_fh {
Subroutine _build__output_spreadsheet_fh: called CC=1 SCAR=0.0
48 14 my ($self) = @_;
49 14 open( my $fh, '>', $self->output_filename );
50 14 return $fh;
51 }
52  
53 sub _build__num_fixed_headers
54 18 ▶{
Subroutine _build__num_fixed_headers: called CC=1 SCAR=0.0
55 18 my ($self) = @_;
56 18 return @{$self->_fixed_headers};
57 }
58  
59  
60  
61 4 1;
62  
63 __END__
« lib/Bio/Roary/Output/CoreGeneAlignmentCoordinatesEMBL.pm ↑ Summary lib/Bio/Roary/External/Mafft.pm »