Learn R Programming

cubar (version 1.2.0)

count_codons: Count codon frequencies in coding sequences

Description

count_codons tabulates the frequency of all 64 possible codons across input coding sequences. This function provides the foundation for most codon usage bias analyses in the cubar package.

Usage

count_codons(seqs, ...)

Value

A matrix where rows represent individual CDS sequences and columns represent the 64 possible codons. Each cell contains the frequency count of the corresponding codon in the respective sequence.

Arguments

seqs

Coding sequences as a DNAStringSet object, or compatible input that can be coerced to DNAStringSet.

...

Additional arguments passed to Biostrings::trinucleotideFrequency.

Examples

Run this code
# Count codon frequencies across all yeast CDS sequences
cf_all <- count_codons(yeast_cds)
dim(cf_all)
cf_all[1:5, 1:5]

# Count codons for a single sequence
count_codons(yeast_cds[1])

Run the code above in your browser using DataLab