File Coverage

blib/lib/BioX/Workflow/Plugin/FileDetails.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package BioX::Workflow::Plugin::FileDetails;
2              
3             our $VERSION = '0.09';
4              
5 1     1   12798 use Moose::Role;
  1         290248  
  1         3  
6 1     1   3952 use List::Uniq ':all';
  1         450  
  1         102  
7 1     1   488 use Data::Dumper;
  1         5148  
  1         324  
8              
9             has 'collect_outdirs' => (
10             traits => ['Array'],
11             is => 'rw',
12             isa => 'ArrayRef',
13             default => sub {[]},
14             handles => {
15             add_collect_outdirs => 'push',
16             has_collect_outdirs => 'count',
17             },
18             );
19              
20             after 'process_template' => sub {
21             my $self = shift;
22             my $data = shift;
23              
24             $self->add_collect_outdirs($self->outdir);
25             $self->add_collect_outdirs($self->indir);
26              
27             @{$self->collect_outdirs} = uniq(@{$self->collect_outdirs}) if $self->has_collect_outdirs;
28             };
29              
30             after 'write_pipeline' => sub {
31             my $self = shift;
32              
33             print <<EOF;
34              
35             #
36             # Starting FileDetails Plugin
37             #
38              
39             EOF
40             foreach my $outdir (@{$self->collect_outdirs}){
41             my $cmd = "filedetails.pl --check_dir ".$outdir;
42             print "\n";
43             print "filedetails.pl --check_dir ".$outdir;
44             print "\n\n";
45             }
46              
47             print <<EOF;
48              
49             #
50             # Ending FileDetails Plugin
51             #
52             EOF
53              
54             };
55              
56             1;
57             __END__
58              
59             =encoding utf-8
60              
61             =head1 NAME
62              
63             BioX::Workflow::Plugin::FileDetails - Get metadata for files in directories
64             processed by L<BioX::Workflow>
65              
66             =head1 SYNOPSIS
67              
68             List your plugins in your workflow.yml file
69              
70             ---
71             plugins:
72             - FileDetails
73             global:
74             - indir: /home/user/gemini
75             - outdir: /home/user/gemini/gemini-wrapper
76             - file_rule: (.vcf)$|(.vcf.gz)$
77             - infile:
78             #So On and So Forth
79              
80             =head1 DESCRIPTION
81              
82             BioX::Workflow::Plugin::FileDetails is a plugin for L<BioX::Workflow>. It gets
83             metadata for files in directories processed by L<BioX::Workflow> including MD5,
84             size, human readable size, date created, last accessed, and last modified.
85              
86             =head1 AUTHOR
87              
88             Jillian Rowe E<lt>jillian.e.rowe@gmail.comE<gt>
89              
90             =head1 Acknowledgements
91              
92             This modules continuing development is supported by NYU Abu Dhabi in the Center for Genomics and Systems Biology.
93             With approval from NYUAD, this information was generalized and put on bitbucket, for which
94             the authors would like to express their gratitude.
95              
96             =head1 COPYRIGHT
97              
98             Copyright 2015- Jillian Rowe
99              
100             =head1 LICENSE
101              
102             This library is free software; you can redistribute it and/or modify
103             it under the same terms as Perl itself.
104              
105             =head1 SEE ALSO
106              
107             =cut