dna2codon: Convert DNA to 3-base codons

dna2codonR Documentation

Convert DNA to 3-base codons

Description

Convert DNA to 3-base codons

Usage

dna2codon(x, ...)

Arguments

x

character vector assumed to contain DNA or RNA nucleotides

...

additional arguments are ignored.

Details

This function takes character string input, either as one large string or vector of strings such as those read from a FASTA file, and returns a vector of 3-base codons. The final codon must contain all three character values otherwise it is removed.

Value

character vector where each element contains three characters, e.g. all(nchar(dna2codon(x)) == 3).

See Also

Other jam codon usage functions: codonUsage2df(), jamCai()

Examples

dna <- c("atgggattatag");
dna2codon(dna);

# example adding one extra base, which does not make a full codon
dnaext1 <- c("atgggattataga");
dna2codon(dnaext1);


jmw86069/splicejam documentation built on Nov. 4, 2024, 10:53 a.m.