est_optimal_codons
identifies optimal codons within each codon family
or amino acid group using binomial regression. Optimal codons are those whose
usage correlates positively with high gene expression or negatively with
codon usage bias (ENC), suggesting they are preferred for efficient translation.
est_optimal_codons(
cf,
codon_table = get_codon_table(),
level = "subfam",
gene_score = NULL,
fdr = 0.001
)
A data.table containing the input codon table with additional columns indicating codon optimality status, statistical significance, and effect sizes from the regression analysis. The columns include single-letter abbreviation of the amino acid, three-letter abbreviation, codon, codon subfamily, regression coefficient, regression P-value, Benjamini and Hochberg corrected Q-value, and indication of whether the codon is optimal.
A matrix of codon frequencies as calculated by count_codons()
.
Rows represent sequences and columns represent codons.
A codon table defining the genetic code, derived from
get_codon_table()
or create_codon_table()
.
Character string specifying the analysis level: "subfam" (default, analyzes codon subfamilies) or "amino_acid" (analyzes at amino acid level).
A numeric vector of gene-level scores used to identify
optimal codons. Length must equal the number of rows in cf
. Common
choices include:
Gene expression levels (RPKM, TPM, FPKM) - optionally log-transformed
Protein abundance measurements
Custom gene importance scores
If not provided, the negative of ENC values will be used (lower ENC = higher bias).
Numeric value specifying the false discovery rate threshold for determining statistical significance of codon optimality (default depends on method).
Presnyak V, Alhusaini N, Chen YH, Martin S, Morris N, Kline N, Olson S, Weinberg D, Baker KE, Graveley BR, et al. 2015. Codon optimality is a major determinant of mRNA stability. Cell 160:1111-1124.
# perform binomial regression for optimal codon estimation
cf_all <- count_codons(yeast_cds)
codons_opt <- est_optimal_codons(cf_all)
codons_opt <- codons_opt[optimal == TRUE]
codons_opt
Run the code above in your browser using DataLab