Skip to contents

count_codons tabulates the occurrences of all the 64 codons in input CDSs

Usage

count_codons(seqs, ...)

Arguments

seqs

CDS sequences, DNAStringSet.

...

additional arguments passed to Biostrings::trinucleotideFrequency.

Value

matrix of codon (column) frequencies of each CDS (row).

Examples

# count codon occurrences
cf_all <- count_codons(yeast_cds)
dim(cf_all)
#> [1] 6600   64
cf_all[1:5, 1:5]
#>         AAA AAC AAG AAT ACA
#> YPL071C  10   4   5  10   2
#> YLL050C   6   3   5   3   0
#> YMR172W  16  37  25  48  21
#> YOR185C   8   4  10   8   1
#> YLL032C  39  26  20  44  17
count_codons(yeast_cds[1])
#>         AAA AAC AAG AAT ACA ACC ACG ACT AGA AGC AGG AGT ATA ATC ATG ATT CAA CAC
#> YPL071C  10   4   5  10   2   1   0   3   5   1   2   3   6   2   5   6   2   1
#>         CAG CAT CCA CCC CCG CCT CGA CGC CGG CGT CTA CTC CTG CTT GAA GAC GAG GAT
#> YPL071C   0   4   2   2   0   0   0   1   1   1   3   0   1   1   4   5   3  15
#>         GCA GCC GCG GCT GGA GGC GGG GGT GTA GTC GTG GTT TAA TAC TAG TAT TCA TCC
#> YPL071C   3   0   1   3   3   2   1   0   2   1   2   1   1   1   0   5   0   3
#>         TCG TCT TGA TGC TGG TGT TTA TTC TTG TTT
#> YPL071C   1   1   0   0   5   1   3   2   2   2