Skip to contents

get_enc computes ENC of each CDS

Usage

get_enc(cf, codon_table = get_codon_table(), level = "subfam")

Arguments

cf

matrix of codon frequencies as calculated by count_codons().

codon_table

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 ENC.

Value

vector of ENC values, sequence names are used as vector names

References

- Wright F. 1990. The 'effective number of codons' used in a gene. Gene 87:23-29. - Sun X, Yang Q, Xia X. 2013. An improved implementation of effective number of codons (NC). Mol Biol Evol 30:191-196.

Examples

# estimate ENC of yeast genes
cf_all <- count_codons(yeast_cds)
enc <- get_enc(cf_all)
head(enc)
#>  YPL071C  YLL050C  YMR172W  YOR185C  YLL032C  YBR225W 
#> 53.00343 45.06356 56.01914 50.84984 53.29440 53.82957 
hist(enc)