
Translate coding sequences into amino acid sequences
Source:R/translate_cds_to_protein.R
translate_cds_to_protein.RdA helper function that takes a fasta file storing coding sequences
as input and translates these coding sequences into amino acid sequences
storing them as fasta output file.
Arguments
- input_file
file path to
fastafile storing coding sequences (DNA).- output_file
name or file path in which translated amino acid sequences (AA) shall be stored as
fastafile.- delete_corrupt_cds
delete_corrupt_cds a logical value indicating whether sequences with corrupt base triplets should be removed from the input
file. This is the case when the length of coding sequences cannot be divided by 3 and thus the coding sequence contains at least one corrupt base triplet.
Examples
if (FALSE) { # \dontrun{
# install.packages("biomartr")
# download coding sequences of Arabidopsis thaliana
Ath_file_path <- biomartr::getCDS(db = "refseq",
organism = "Arabidopsis thaliana",
gunzip = TRUE)
# translate coding sequences into amino acid sequences
translate_cds_to_protein(Ath_file_path, "Ath_aa_seqs.fasta")
} # }