Skip to contents

Calculate GC content at synonymous position of codons (using four-fold degenerate sites only).

Usage

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

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 GC contents at 4-fold degenerate sites.

Value

a named vector of GC4d values.

Examples

# estimate GC4d of yeast genes
cf_all <- count_codons(yeast_cds)
gc4d <- get_gc4d(cf_all)
head(gc4d)
#>   YPL071C   YLL050C   YMR172W   YOR185C   YLL032C   YBR225W 
#> 0.4047619 0.3114754 0.3652482 0.3372093 0.3259259 0.3304348 
hist(gc4d)