Search
Question: dumb question: using Biostrings (or something else) to translate DNA bases to amino acid codes
0
gravatar for Paul Shannon
9.7 years ago by
Paul Shannon1.1k
Paul Shannon1.1k wrote:
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
ADD COMMENTlink modified 9.7 years ago by Lynn Amon280 • written 9.7 years ago by Paul Shannon1.1k
0
gravatar for Lynn Amon
9.7 years ago by
Lynn Amon280
Lynn Amon280 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 >
ADD COMMENTlink written 9.7 years ago by Lynn Amon280
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 REPLYlink written 9.7 years ago by rgentleman5.5k
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 REPLYlink written 9.7 years ago by Paul Shannon1.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 283 users visited in the last hour