lib/Bio/Roary/LookupGeneFiles.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 92.8% 26 / 28 CC 3 SCAR 8.0
CC
3
Cov
92%
_build_ordered_gene_files
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« lib/Bio/Roary/Output/GroupMultifasta.pm ↑ Summary lib/Bio/Roary/ExtractProteomeFromGFFs.pm »
1 package Bio::Roary::LookupGeneFiles;
2 1 $Bio::Roary::LookupGeneFiles::VERSION = '3.13.0';
3 # ABSTRACT: Take in an ordering of genes and a directory and return an ordered list of file locations
4  
5  
6 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 has 'multifasta_directory' => ( is => 'ro', isa => 'Str', default => 'pan_genome_sequences' );
9 1 has 'ordered_genes' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
10  
11 1 has 'ordered_gene_files' => ( is => 'ro', isa => 'ArrayRef', lazy => 1, builder => '_build_ordered_gene_files' );
12  
13  
14 sub _build_ordered_gene_files
15 2 ▶{
Subroutine _build_ordered_gene_files: called CC=3 SCAR=11.1
16 2 my ($self) = @_;
17 2 my @gene_files;
18 2 for my $gene (@{$self->ordered_genes})
19 {
20 4 $gene =~ s!\W!_!gi;
21 4 my $filename = $gene.'.fa.aln';
22 4 my $gene_filepath = join('/',($self->multifasta_directory, $filename));
23
24 4 ▶ if(! -e $gene_filepath)
Branch: 1 branch
BranchTrueFalseTotal
if (not -e $gene_filepath) { } 0 4 4
25 {
26 0 print "Core gene file missing: ". $gene_filepath."\n";
27 }
28 else
29 {
30 4 push(@gene_files, $gene_filepath);
31 }
32 }
33 2 return \@gene_files;
34 }
35  
36 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 1 __PACKAGE__->meta->make_immutable;
38  
39 1 1;
40  
41 __END__
« lib/Bio/Roary/Output/GroupMultifasta.pm ↑ Summary lib/Bio/Roary/ExtractProteomeFromGFFs.pm »