est_optimal_codons: Estimate optimal codons

est_optimal_codonsR Documentation

Estimate optimal codons

Description

est_optimal_codons determine optimal codon of each codon family with binomial regression. Usage of optimal codons should correlate negatively with enc.

Usage

est_optimal_codons(
  cf,
  codon_table = get_codon_table(),
  level = "subfam",
  gene_score = NULL,
  fdr = 0.001
)

Arguments

cf

matrix of codon frequencies as calculated by count_codons().

codon_table

a table of genetic code derived from get_codon_table or create_codon_table.

level

"subfam" (default) or "amino_acid". For which level to determine optimal codons.

gene_score

a numeric vector of scores for genes. The order of values should match with gene orders in the codon frequency matrix. The length of the vector should be equal to the number of rows in the matrix. The scores could be gene expression levels (RPKM or TPM) that are optionally log-transformed (for example, with log1p). The opposite of ENC will be used by default if gene_score is not provided.

fdr

false discovery rate used to determine optimal codons.

Value

data.table of optimal codons.

Examples

# 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


cubar documentation built on April 3, 2025, 8:58 p.m.