dumb question: using Biostrings (or something else) to translate DNA bases to amino acid codes
1
0
Entering edit mode
Paul Shannon ★ 1.1k
@paul-shannon-578
Last seen 10.3 years ago
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
Biostrings Biostrings • 1.1k views
ADD COMMENT
0
Entering edit mode
Lynn Amon ▴ 280
@lynn-amon-2429
Last seen 10.3 years ago
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 >
ADD COMMENT
0
Entering edit mode
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
ADD REPLY
0
Entering edit mode
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
ADD REPLY

Login before adding your answer.

Traffic: 519 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6