Skip to contents

get_fop calculates the fraction of optimal codons (Fop) for each coding sequence, which represents the proportion of codons that are considered optimal for translation efficiency. Higher Fop values suggest stronger selection for optimal codon usage.

Usage

get_fop(cf, op = NULL, codon_table = get_codon_table(), ...)

Arguments

cf

A matrix of codon frequencies as calculated by count_codons(). Rows represent sequences and columns represent codons.

op

A character vector specifying which codons are considered optimal. If not provided, optimal codons will be determined automatically using est_optimal_codons().

codon_table

A codon table defining the genetic code, derived from get_codon_table() or create_codon_table().

...

Additional arguments passed to est_optimal_codons() when optimal codons are determined automatically.

Value

A named numeric vector of Fop values (ranging from 0 to 1). Names correspond to sequence identifiers from the input matrix. Higher values indicate greater usage of optimal codons.

References

Ikemura T. 1981. Correlation between the abundance of Escherichia coli transfer RNAs and the occurrence of the respective codons in its protein genes: a proposal for a synonymous codon choice that is optimal for the E. coli translational system. J Mol Biol 151:389-409.

Examples

# Calculate Fop for yeast genes (optimal codons determined automatically)
cf_all <- count_codons(yeast_cds)
fop <- get_fop(cf_all)
head(fop)
#>   YPL071C   YLL050C   YMR172W   YOR185C   YLL032C   YBR225W 
#> 0.4315068 0.7785714 0.4763271 0.6009390 0.5112219 0.4846066 
hist(fop, main = "Distribution of Fop values")