This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Start Codon in Translate() in R

Hi all, I wanted to use function translate() in R to translate a DNA to a protein. what I wrote is this :

DNA <- DNAString(dna_temp)
protein <- translate(DNA)

but in this code start codon is not defined, so it will start from the first letter and doesn't check if it is start codon or not. what should I do for checking this?

Thanks

r gene

Please provide minimal dataset for reproducibility please.

1 answer

Try following, assuming that you know where start codon starts from @ khatami.mahshid

> library(Biostrings)
> seq.n=sample(DNA_BASES, 999, replace = TRUE, prob = c(0.4,0.1,0.1,0.4))
> test=DNAString("GATG")
> translate(test)
  1-letter "AAString" instance
seq: D
Warning message:
In .Call2("DNAStringSet_translate", x, skip_code, dna_codes[codon_alphabet],  :
  last base was ignored
> translate(subseq(test,2,))
  1-letter "AAString" instance
seq: M
>

in CATGstring, start codon ATG starts from 2nd letter, hence translate(subseq(test,2,))

Log in to answer this question.