| 1 | package BioX::Workflow::Plugin::FileDetails; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | our $VERSION = '0.10'; | |||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use List::Uniq ':all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | has 'collect_outdirs' => ( | ||||||||||
| 10 | traits => ['Array'], | ||||||||||
| 11 | is => 'rw', | ||||||||||
| 12 | isa => 'ArrayRef', | ||||||||||
| 13 | 0 | ▶ | default => sub {[]}, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 14 | 1 | handles => { | |||||||||
| 15 | add_collect_outdirs => 'push', | ||||||||||
| 16 | has_collect_outdirs => 'count', | ||||||||||
| 17 | }, | ||||||||||
| 18 | ); | ||||||||||
| 19 | |||||||||||
| 20 | after 'process_template' => sub { | ||||||||||
| 21 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 22 | 0 | my $data = shift; | |||||||||
| 23 | |||||||||||
| 24 | 0 | $self->add_collect_outdirs($self->outdir); | |||||||||
| 25 | 0 | $self->add_collect_outdirs($self->indir); | |||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | @{$self->collect_outdirs} = uniq(@{$self->collect_outdirs}) if $self->has_collect_outdirs; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 1 | }; | |||||||||
| 29 | |||||||||||
| 30 | after 'write_pipeline' => sub { | ||||||||||
| 31 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 32 | |||||||||||
| 33 | 0 | print <<EOF; | |||||||||
| 34 | |||||||||||
| 35 | # | ||||||||||
| 36 | # Starting FileDetails Plugin | ||||||||||
| 37 | # | ||||||||||
| 38 | |||||||||||
| 39 | EOF | ||||||||||
| 40 | 0 | foreach my $outdir (@{$self->collect_outdirs}){ | |||||||||
| 41 | 0 | my $cmd = "filedetails.pl --check_dir ".$outdir; | |||||||||
| 42 | 0 | print "\n"; | |||||||||
| 43 | 0 | print "filedetails.pl --check_dir ".$outdir; | |||||||||
| 44 | 0 | print "\n\n"; | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 0 | print <<EOF; | |||||||||
| 48 | |||||||||||
| 49 | # | ||||||||||
| 50 | # Ending FileDetails Plugin | ||||||||||
| 51 | # | ||||||||||
| 52 | EOF | ||||||||||
| 53 | |||||||||||
| 54 | 1 | }; | |||||||||
| 55 | |||||||||||
| 56 | 1 | 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 | ||||||||||