[BioC] dumb question: using Biostrings (or something else) to translate DNA bases to amino acid codes
Paul Shannon
pshannon at systemsbiology.org
Mon Jan 28 18:44:00 CET 2008
Hi Robert,
Your function works nicely. Thank you!
- Paul
On Jan 25, 2008, at 9:27 PM, Robert Gentleman wrote:
> for reasonably short sequences (like most genes)
>
> library(Biostrings)
> DNA2AA = function(DNAseq) {
> if(length(DNAseq) > 1 ) stop("only length one sequences, please")
> nc = nchar(DNAseq)
> Dtriples = substring(DNAseq, seq(1, nc, by=3), seq(3, nc, 3))
> paste(GENETIC_CODE[Dtriples], collapse="")
> }
>
> will do it. The restriction to length one sequences is due to the
> semantics of substring
>
> best wishes
> Robert
>
>
>
> lamon at fhcrc.org wrote:
>> Try the seqinr package.
>> Lynn
>> Quoting Paul Shannon <pshannon at systemsbiology.org>:
>>> I was so sure I could find this capability in Biostrings. It may
>>> be there, or
>>> elsewhere, but lots of looking has not revealed it to me. Is
>>> there a package
>>> which implements the genetic code?
>>>
>>> Sheepishly,
>>>
>>> - Paul
>>>
>>> _______________________________________________
>>> Bioconductor mailing list
>>> Bioconductor at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>> Search the archives:
>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: http://news.gmane.org/
>> gmane.science.biology.informatics.conductor
>
> --
> Robert Gentleman, PhD
> Program in Computational Biology
> Division of Public Health Sciences
> Fred Hutchinson Cancer Research Center
> 1100 Fairview Ave. N, M2-B876
> PO Box 19024
> Seattle, Washington 98109-1024
> 206-667-7700
> rgentlem at fhcrc.org
More information about the Bioconductor
mailing list