File Coverage

blib/lib/BioX/Wrapper.pm
Criterion Covered Total %
statement 24 37 64.8
branch 0 4 0.0
condition n/a
subroutine 8 9 88.8
pod n/a
total 32 50 64.0


line stmt bran cond sub pod time code
1             package BioX::Wrapper;
2              
3 1     1   16758 use File::Find::Rule;
  1         7498  
  1         10  
4 1     1   54 use File::Basename;
  1         1  
  1         94  
5 1     1   5 use File::Path qw(make_path remove_tree);
  1         7  
  1         56  
6 1     1   4 use File::Find::Rule;
  1         1  
  1         4  
7 1     1   25 use Cwd;
  1         1  
  1         44  
8 1     1   961 use DateTime;
  1         156314  
  1         56  
9              
10 1     1   951 use Moose;
  1         420549  
  1         6  
11 1     1   5988 use Moose::Util::TypeConstraints;
  1         2  
  1         9  
12             with 'MooseX::Getopt';
13             with 'MooseX::Getopt::Usage';
14             with 'MooseX::Getopt::Usage::Role::Man';
15             with 'MooseX::SimpleConfig';
16              
17             # For pretty man pages!
18             $ENV{TERM}='xterm-256color';
19              
20             our $VERSION = '1.5';
21              
22             =head1 BioX::Wrapper
23              
24             Base class for BioX::Wrapper
25              
26             =head2 Wrapper Options
27              
28             =cut
29              
30             =head3 example.yml
31              
32             ---
33             indir: "/path/to/files"
34             outdir: "path/to/testdir"
35              
36             =cut
37              
38             has '+configfile' => (
39             required => 0,
40             documentation => q{
41             If you get tired of putting all your options on the command line create a config file instead.
42             ---
43             indir: "/path/to/files"
44             outdir: "path/to/testdir"
45             }
46             );
47              
48             =head3 comment_char
49              
50             For a bash script a comment is "#", but is other characters for other languages
51              
52             =cut
53              
54             has 'comment_char' => (
55             is => 'rw',
56             isa => 'Str',
57             default => '#',
58             );
59              
60             =head2 print_opts
61              
62             Print out the command line options
63              
64             =cut
65              
66             sub print_opts {
67 0     0     my($self) = @_;
68              
69 0           my $now = DateTime->now();
70              
71 0           print "$self->{comment_char}\n";
72 0           print "$self->{comment_char} Generated at: $now\n";
73 0           print "$self->{comment_char} This file was generated with the following options\n";
74              
75 0           for(my $x=0; $x<=$#ARGV; $x++){
76 0 0         next unless $ARGV[$x];
77 0           print "$self->{comment_char}\t$ARGV[$x]\t";
78 0 0         if($ARGV[$x+1]){
79 0           print $ARGV[$x+1];
80             }
81 0           print "\n";
82 0           $x++;
83             }
84              
85 0           print "$self->{comment_char}\n\n";
86             }
87              
88             =head3 indir
89              
90             A path to your vcf files can be given, and using File::Find::Rule it will recursively search for vcf or vcf.gz
91              
92             =cut
93              
94             has 'indir' => (
95             is => 'rw',
96             isa => 'Str|Undef',
97             required => 0,
98             );
99              
100             =head3 outdir
101              
102             Path to write out annotation files. It creates the structure
103              
104             outdir
105             --annovar_interim
106             --annovar_final
107             --vcf-annotate_interim #If you choose to reannotate VCF file
108             --vcf-annotate_final #If you choose to reannotate VCF file
109              
110             A lot of interim files are created by annovar, and the only one that really matters unless you debugging a new database is the multianno file found in annovar_final
111              
112             If not given the outdirectory is assumed to be the current working directory.
113              
114             =cut
115              
116             has 'outdir' => (
117             is => 'rw',
118             isa => 'Str',
119             required => 1,
120             default => sub { return getcwd() },
121             );
122              
123             1;
124             __END__
125              
126             =encoding utf-8
127              
128             =head1 NAME
129              
130             BioX::Wrapper - Base class for BioX::Wrappers
131              
132             =head1 SYNOPSIS
133              
134             use BioX::Wrapper;
135              
136             =head1 DESCRIPTION
137              
138             BioX::Wrapper is
139              
140             =head1 Acknowledgements
141              
142             This module was originally developed at and for Weill Cornell Medical
143             College in Qatar within ITS Advanced Computing Team. With approval from
144             WCMC-Q, this information was generalized and put on github, for which
145             the authors would like to express their gratitude.
146              
147             =head1 AUTHOR
148              
149             Jillian Rowe E<lt>jillian.e.rowe@gmail.comE<gt>
150              
151             =head1 COPYRIGHT
152              
153             Copyright 2015 - Weill Cornell Medical College in Qatar
154              
155             =head1 LICENSE
156              
157             This library is free software; you can redistribute it and/or modify
158             it under the same terms as Perl itself.
159              
160             =head1 SEE ALSO
161              
162             =cut