Skip to content

Commit

Permalink
Renamed script names and fixed some errors in tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
fortune9 committed Jul 12, 2015
1 parent 1133fcc commit eb22f22
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 59 deletions.
9 changes: 9 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
Revision history for Bio-CUA

1.04 Thu May 28 10:37:37 EDT 2015
1. Update Tutorial.pod by correcting format errors and reword
sentences.
2. Change program names as follows:
build_cai_param.pl -> cai_codon.pl
build_tai_param.pl -> tai_codon.pl
calculate_CUB.pl -> cub_seq.pl
The new names reflect the functions of the programs better.

1.03 Wed May 20 13:25:29 EDT 2015
1. Add option --fop-param to calculate_CUB.pl so that the
program can compute the metric Fop.
Expand Down
6 changes: 3 additions & 3 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bin/build_cai_param.pl
bin/build_tai_param.pl
bin/calculate_CUB.pl
bin/cai_codon.pl
bin/tai_codon.pl
bin/cub_seq.pl
Changes
ignore.txt
lib/Bio/CUA.pm
Expand Down
6 changes: 3 additions & 3 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ WriteMakefile(
ABSTRACT_FROM => 'lib/Bio/CUA.pm',
LICENSE => 'gpl_3',
#PL_FILES => {'other.PL' => ''}, # files run during compilation
EXE_FILES => ["bin/build_cai_param.pl",
"bin/build_tai_param.pl",
"bin/calculate_CUB.pl"
EXE_FILES => ["bin/cai_codon.pl",
"bin/tai_codon.pl",
"bin/cub_seq.pl"
], # files in bin directory
MIN_PERL_VERSION => 5.006,
CONFIGURE_REQUIRES => {
Expand Down
11 changes: 8 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1. Bio-CUA

Version: 1.01
This is a Perl software package for analyzing codon usage bias.

2. Purpose

Expand Down Expand Up @@ -57,6 +57,11 @@ perldoc command.

perldoc Bio::CUA

You can also find a tutorial on the CPAN, which is also accessible
through

perldoc Bio::CUA::Tutorial

You can also look for information at:

RT, CPAN's request tracker (report bugs here)
Expand Down Expand Up @@ -93,6 +98,6 @@ along with this program. If not, see L<http://www.gnu.org/licenses/>.

6. CITATION

Zhenguo Zhang and Daven C. Presgraves, CUA: a Flexible Codon Usage
Analyzer (In preparation)
Zhenguo Zhang, CUA: a Flexible and
Comprehensive Codon Usage Analyzer (In preparation)

11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##1. Bio-CUA

Version: 1.01
This is a Perl software package for analyzing codon usage bias.

##2. Purpose

Expand Down Expand Up @@ -57,6 +57,11 @@ perldoc command.

perldoc Bio::CUA

You can also find a tutorial on the CPAN, which is also accessible
through

perldoc Bio::CUA::Tutorial

You can also look for information at:

RT, CPAN's request tracker (report bugs here)
Expand Down Expand Up @@ -93,6 +98,6 @@ along with this program. If not, see L<http://www.gnu.org/licenses/>.

##6. CITATION

Zhenguo Zhang and Daven C. Presgraves, CUA: a Flexible Codon Usage
Analyzer (In preparation)
Zhenguo Zhang, CUA: a Flexible and
Comprehensive Codon Usage Analyzer (In preparation)

10 changes: 5 additions & 5 deletions bin/build_cai_param.pl → bin/cai_codon.pl
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ sub usage
-o/--out-file: the file to store the result. Default is standard output.
-h/--help: show this help message. For more detailed information, run
'perldoc build_cai_param.pl'
'perldoc cai_codon.pl'
Author: Zhenguo Zhang
Contact: zhangz.sci\@gmail.com
Expand All @@ -366,7 +366,7 @@ sub usage
=head1 NAME
build_cai_param.pl - a program to calculate CAI for each codon
cai_codon.pl - a program to calculate CAI for each codon
=head1 VERSION
Expand All @@ -379,14 +379,14 @@ =head1 SYNOPSIS
L<http://search.cpan.org/dist/Bio-CUA/>
# calculate codon CAI by choosing the top 200 highly expressed genes
build_cai_param.pl -i seqs.fasta -e gene_expression.tsv -s 200 -o CAI_top200
cai_codon.pl -i seqs.fasta -e gene_expression.tsv -s 200 -o CAI_top200
# the same as above but normalize RSCUs with expected RSCUs under even
# codon usage
build_cai_param.pl -i seqs.fasta -e gene_expression.tsv -s 200 -o CAI_top200.by_mean -m mean
cai_codon.pl -i seqs.fasta -e gene_expression.tsv -s 200 -o CAI_top200.by_mean -m mean
# normalize RSCUs by RSCUs derived from bottom 1000 lowely expressed genes
build_cai_param.pl -i seqs.fasta -e gene_expression.tsv -s 200 -o CAI_top200.b1000 -b 1000
cai_codon.pl -i seqs.fasta -e gene_expression.tsv -s 200 -o CAI_top200.b1000 -b 1000
=head1 OPTIONS
Expand Down
38 changes: 21 additions & 17 deletions bin/calculate_CUB.pl → bin/cub_seq.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Bio::CUA::CodonTable;
use Getopt::Long;

our $VERSION = 0.11;
our $VERSION = 0.12;
my @args = @ARGV;
my $sep = "\t";
my $seqIO_pkg;
Expand Down Expand Up @@ -187,13 +187,13 @@ sub usage
print <<USAGE;
Usage: $0 [options]
This program computes CUB indices and additional sequence statistics
for each sequence. Available CUB indices are ENC, CAI, tAI, Fop.
This program computes CUB metrics and additional sequence statistics
for each sequence. Available CUB metrics are ENC, CAI, tAI, Fop.
Options:
-s/--seq-file: file containing sequences in fasta format, from which
CUB indices are computed.
CUB metrics are computed.
-g/--gc-id: genetic code table ID used for deriving amino acids for
sequences in input file. Default is 1, i.e., standard table
Expand Down Expand Up @@ -228,7 +228,7 @@ sub usage
-o/--out: the file to store the results. Default is to standard output.
-h/--help: show this message. For more details, run
'perldoc calculate_CUB.pl'
'perldoc cub_seq.pl'
Author: Zhenguo Zhang
Contact: zhangz.sci\@gmail.com
Expand All @@ -245,30 +245,30 @@ sub usage
=head1 NAME
calculate_CUB.pl - a program to calculate sequence codon usage bias
cub_seq.pl - a program to calculate sequence codon usage bias
metrics and other sequence parameters.
=head1 VERSION
VERSION: 0.11
VERSION: 0.12
=head1 SYNOPSIS
This program computes CUB indices for each sequence; the types of
computed CUB indices depend on the provided options (see below).
This program computes CUB metrics for each sequence; the types of
computed CUB metrics depend on the provided options (see below).
In addition to CUB indices, the program also computes some other
In addition to CUB metrics, the program also computes some other
features such as counts of amino acids, GC-content of the whole
sequence and the 3rd codon positions.
# compute ENC, ENC_r, CAI, and tAI for each sequence in file cds.fa
summarize_cds_stat.pl --cai CAI_param.top_200 --tai tAI_param \
--enc enc,enc_r --seq cds.fa -o CUB_indice.tsv
cub_seq.pl --cai CAI_codon.top_200 --tai tAI_codon \
--enc enc,enc_r --seq cds.fa -o CUB_seq.tsv
# the same as above but not output GC content, AA counts and protein
# lengths
summarize_cds_stat.pl --cai CAI_param.top_200 --tai tAI_param \
--enc enc,enc_r --seq cds.fa -o CUB_indice.tsv --lite
cub_seq.pl --cai CAI_codon.top_200 --tai tAI_codon \
--enc enc,enc_r --seq cds.fa -o CUB_seq.tsv --lite
=head1 OPTIONS
Expand All @@ -279,7 +279,7 @@ =head3 Mandatory options
=item -s/--seq-file
file containing sequences in fasta format, from which each sequence's
CUB indices are computed.
CUB metrics are computed.
=back
Expand All @@ -298,14 +298,14 @@ =head3 Auxiliary options
file containing tAI value for each codon in the
format 'codon<tab>tAI_value', which can be produced by
L<build_tai_param.pl>. If not given, tAI values would not be
L<tai_codon.pl>. If not given, tAI values would not be
computed.
=item -c/--cai-param
similar to --tai-param, except that CAI values are
provided in the same format. This file may be produced by
L<build_cai_param.pl>. If not given, CAI values would not be computed.
L<cai_codon.pl>. If not given, CAI values would not be computed.
=item -f/--fop-param
Expand Down Expand Up @@ -414,6 +414,10 @@ =head1 ACKNOWLEDGEMENTS
=head1 UPDATES
0.12 - Thu Jun 4 11:31:03 EDT 2015
1. update documentation
0.11 - Thu May 21 16:00:28 EDT 2015
1. modify/add option --base-comp and --lite.
Expand Down
8 changes: 4 additions & 4 deletions bin/build_tai_param.pl → bin/tai_codon.pl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sub usage
output.
-h/--help: show this help message. For more detailed information, run
'perldoc build_tai_param.pl'
'perldoc tai_codon.pl'
Author: Zhenguo Zhang
Contact: zhangz.sci\@gmail.com
Expand All @@ -81,7 +81,7 @@ sub usage
=head1 NAME
build_tai_param.pl - a program to calculate tAI of each codon
tai_codon.pl - a program to calculate tAI of each codon
=head1 VERSION
Expand All @@ -93,7 +93,7 @@ =head1 SYNOPSIS
which is part of distribution L<http://search.cpan.org/dist/Bio-CUA/>
# calculate tAI for drosophila melanogaster
build_tai_param.pl -t dmel_tRNA_copy_number.tsv -o dmel_tAI.tsv
tai_codon.pl -t dmel_tRNA_copy_number.tsv -o dmel_tAI.tsv
# one can get tRNA copy numbers from the database
# L<GtRNADB|http://gtrnadb.ucsc.edu/>
Expand Down Expand Up @@ -134,7 +134,7 @@ =head3 Auxiliary options:
=item -h/--help
show this help message. For more detailed information, run
'perldoc build_tai_param.pl'
'perldoc tai_codon.pl'
=back
Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/CUA/CUB/Calculator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ use strict;
use warnings;
use parent qw/Bio::CUA::CUB/;
use Bio::CUA::CodonTable;
use Scalar::Util qw/blessed/;

=head1 METHODS
Expand Down Expand Up @@ -480,7 +481,7 @@ sub _enc_factory

# a hash ref, codon => counts
my $codonList = $self->get_codon_list($seq) or return;
my $seqId = (ref($seq) and $seq->can('id'))? $seq->id : '';
my $seqId = (blessed($seq) and $seq->can('id'))? $seq->id : '';

# determine expected codon frequency if necessary
my $expectedCodonFreq;
Expand Down
Loading

0 comments on commit eb22f22

Please sign in to comment.