Learn R Programming

⚠️There's a newer version (1.2.0) of this package.Take me there.

cubar

Overview

cubar is a package for codon usage bias analysis in R. Main features are as follows:

  • Codon level analyses
    • Calculate codon weights based on gene expression, tRNA availability, and mRNA stability;
    • Calculate relative synonymous codon usage (RSCU);
    • Machine learning-based inference of optimal codons;
    • Visualization codon-anticodon pairing relationships;
  • Gene level analyses
    • Tabulate codon frequency of each coding sequence;
    • Measure codon usage similarity to highly expressed genes with Codon Adaptation Index (CAI);
    • Quantify the influence of codon usage on mRNA stability with Mean Codon Stabilization Coefficients (CSCg);
    • Measure codon usage bias with the nonparametric index Effective number of codons (ENC);
    • Measure the fraction of pre-determined optimal codons (Fop) in each sequence;
    • Overall GC content (GC) or that of 3rd synonymous positions (GC3s) or 4-fold degenerate sites (GC4d);
    • Quantify whether codon usage matches tRNA availability using tRNA Adaptation Index (tAI);
    • Measure the deviation from porportionality (Dp) of viral synonymous codon usage from host tRNA supply;
  • Utilities
    • Sliding window analysis of codon usage within a coding sequence;
    • Optimize codon usage based on optimal codons for heterologous expression;
    • Test differential usage of codons between two sets of sequences;

Main advantages of cubar are as follows:

  • Process large datasets (>10,0000 sequences) efficiently using the Biostrings and data.table backends;
  • Support genetic codes cataloged by NCBI as well as custom ones;
  • Integrate with other data analysis or bioinformatic packages in the R ecosystem;

Dependencies

Depends

  • R (>= 4.1.0)

Imports

  • Biostrings (>= 2.60.0),
  • IRanges (>= 2.34.0),
  • data.table (>= 1.14.0),
  • ggplot2 (>= 3.3.5),
  • rlang (>= 0.4.11)

Installation

The latest release of cubar can be installed with:

install.packages("cubar")

The latest developmental version of cubar can be installed with:

devtools::install_github("mt1022/cubar", dependencies = TRUE)

Usage

Documentation can be found within R (by typing ?function_name). The following tutorials are available from our website:

Getting help

Please use GitHub issues for bug reports, questions, and feature requests.

Suggests

  • Biostrings for sequence input/output and manipulation;
  • Peptides for peptide- or protein-related indices;

Acknowledgements

GitHub Copilot was used to suggest code snippets in the development of this package. Thanks the GitHub Education teacher program for providing free access to GitHub Copilot.

Copy Link

Version

Install

install.packages('cubar')

Monthly Downloads

308

Version

1.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Hong Zhang

Last Published

December 7th, 2024

Functions in cubar (1.1.0)

get_gc3s

GC contents at synonymous 3rd codon positions
get_dp

Deviation from Proportionality
plot_ca_pairing

Plot codon-anticodon pairing relationship
get_gc

GC contents
yeast_exp

yeast mRNA expression levels
slide_codon

sliding window of codons
slide_apply

apply a cub index to a sliding window
show_codon_tables

show available codon tables
get_tai

Calculate TAI
slide

slide window interval generator
get_fop

Fraction of optimal codons (Fop)
slide_plot

plot sliding window codon usage
human_mt

human mitochondrial CDS sequences
yeast_cds

yeast CDS sequences
yeast_trna

yeast tRNA sequences
yeast_trna_gcn

yeast tRNA gene copy numbers (GCN)
yeast_half_life

Half life of yeast mRNAs
count_codons

Count occurrences of different codons
codon_optimize

Optimize codons
est_csc

Estimate Codon Stabilization Coefficient
check_cds

Quality control of CDS
est_optimal_codons

Estimate optimal codons
aa2codon

amino acids to codons
create_codon_table

create custom codon table from a data frame
est_rscu

Estimate RSCU
codon_diff

Differential codon usage analysis
est_trna_weight

Estimate tRNA weight w
get_cai

Calculate CAI
get_enc

Calculate ENC
get_cscg

Mean Codon Stabilization Coefficients
get_gc4d

GC contents at 4-fold degenerate sites
seq_to_codons

Convert CDS to codons
get_codon_table

get codon table by NCBI gene code ID
rev_comp

Reverse complement