script/build_tai_param.pl untested

filter: Statementstmt 0.0% 0 / 33 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 9 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 52 SCAR 6.9
CC
1
Cov
0%
usage
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2  
3 use strict;
4 use warnings;
5 use lib '../lib';
6 use Bio::CUA::CUB::Builder;
7 use Bio::CUA::CodonTable;
8 use Getopt::Long;
9  
10 my $tRNAFile;
11 my $gcId;
12 my $outFile;
13 my $help;
14  
15 GetOptions(
16 't|tRNA=s' => \$tRNAFile,
17 'g|gc-id:i' => \$gcId,
18 'o|out-file:s' => \$outFile,
19 'h|help!' => \$help
20 );
21  
22 &usage() if($help or !defined($tRNAFile));
23  
24 $gcId ||= 1;
25 $outFile ||= '-';
26  
27 my $table = Bio::CUA::CodonTable->new(-id => $gcId);
28 my $builder = Bio::CUA::CUB::Builder->new(
29 -codon_table => $table
30 );
31  
32 $builder->build_tai($tRNAFile, $outFile) or
33 die "building tAI failed:$!";
34  
35 warn "Work done!!\n";
36  
37 exit 0;
38  
39 sub usage
40 {
41 print <<USAGE;
42  
43 Usage: $0 [options]
44  
45 This program reads tRNA abundance (ussally gene copy number) in a
46 genome and calculate tAI (tRNA adaptation index) for each codon.
47  
48 Options:
49  
50 Mandatory options:
51  
52 -t/--tRNA: the file containing tRNA abundance in the format:
53 anti-codon1<tab>3
54 anti-codon1<tab>6
55 ... ...
56 each line contains one anticodon followed by the total copy number of
57 tRNAs harboring this anticodon.
58  
59 Auxiliary options:
60  
61 -g/--gc-id: ID of genetic code table. Used for mapping between codons
62 and amino acids.
63  
64 -o/--out-file: the file to store the result. Default is standard
65 output.
66  
67 -h/--help: show this help message. For more detailed information, run
68 'perldoc build_tai_param.pl'
69  
70 Author: Zhenguo Zhang
71 Contact: zhangz.sci\@gmail.com
72 Created:
73 Sat May 2 00:45:05 EDT 2015
74  
75 USAGE
76
77 exit 1;
78 }
79  
80 =pod
81  
82 =head1 NAME
83  
84 build_tai_param.pl - a program to calculate tAI of each codon
85  
86 =head1 VERSION
87  
88 VERSION: 0.01
89  
90 =head1 SYNOPSIS
91  
92 This program calculates tAI (tRNA adaptaion index) at codon level,
93 which is part of distribution L<http://search.cpan.org/dist/Bio-CUA/>
94  
95 # calculate tAI for drosophila melanogaster
96 build_tai_param.pl -t dmel_tRNA_copy_number.tsv -o dmel_tAI.tsv
97  
98 # one can get tRNA copy numbers from the database
99 # L<GtRNADB|http://gtrnadb.ucsc.edu/>
100  
101 =head1 OPTIONS
102  
103  
104 =head3 Mandatory options:
105  
106 =over
107  
108 =item -t/--tRNA
109  
110 the file containing tRNA abundance in the format:
111  
112 anti-codon1<tab>3
113 anti-codon1<tab>6
114 ... ...
115  
116 each line contains one anticodon followed by the total copy number of
117 tRNAs harboring this anticodon.
118  
119 =back
120  
121 =head3 Auxiliary options:
122  
123 =over
124  
125 =item -g/--gc-id
126  
127 ID of genetic code table. Used for mapping between codons
128 and amino acids.
129  
130 =item -o/--out-file
131  
132 the file to store the result. Default is standard output.
133  
134 =item -h/--help
135  
136 show this help message. For more detailed information, run
137 'perldoc build_tai_param.pl'
138  
139 =back
140  
141 =head1 AUTHOR
142  
143 Zhenguo Zhang, C<< <zhangz.sci at gmail.com> >>
144  
145 =head1 BUGS
146  
147 Please report any bugs or feature requests to C<bug-bio-cua at
148 rt.cpan.org> or through the web interface at
149 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-CUA>. I will be
150 notified, and then you'll automatically be notified of progress on
151 your bug as I make changes.
152  
153 =cut
154  
155 =head1 SUPPORT
156  
157 You can find documentation for this class with the perldoc command.
158  
159 perldoc Bio::CUA
160  
161 You can also look for information at:
162  
163 =over 4
164  
165 =item * RT: CPAN's request tracker (report bugs here)
166  
167 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Bio-CUA>
168  
169 =item * AnnoCPAN: Annotated CPAN documentation
170  
171 L<http://annocpan.org/dist/Bio-CUA>
172  
173 =item * CPAN Ratings
174  
175 L<http://cpanratings.perl.org/d/Bio-CUA>
176  
177 =item * Search CPAN
178  
179 L<http://search.cpan.org/dist/Bio-CUA/>
180  
181 =back
182  
183  
184 =head1 ACKNOWLEDGEMENTS
185  
186  
187 =head1 LICENSE AND COPYRIGHT
188  
189 Copyright 2015 Zhenguo Zhang.
190  
191 This program is free software: you can redistribute it and/or modify
192 it under the terms of the GNU General Public License as published by
193 the Free Software Foundation, either version 3 of the License, or
194 (at your option) any later version.
195  
196 This program is distributed in the hope that it will be useful,
197 but WITHOUT ANY WARRANTY; without even the implied warranty of
198 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
199 GNU General Public License for more details.
200  
201 You should have received a copy of the GNU General Public License
202 along with this program. If not, see L<http://www.gnu.org/licenses/>.
203  
204 =cut
205