Re: [R] counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"

From: Patrick Aboyoun <paboyoun_at_fhcrc.org>
Date: Tue, 15 Jul 2008 09:29:30 -0700

Henrik,
As Wolfgang mentioned, the Biostrings package in Bioconductor has a number of sequence manipulation functions. The alphabetFrequency function would get you what you need.

 > library(Biostrings)
 > alphabetFrequency(DNAString("TCGGGGGACAATCGGTAACCCGTCT")) A C G T M R W S Y K V H D B N - +
5 7 8 5 0 0 0 0 0 0 0 0 0 0 0 0 0
 > alphabetFrequency(DNAString("TCGGGGGACAATCGGTAACCCGTCT"), baseOnly = TRUE)

    A     C     G     T other
    5     7     8     5     0


Patrick

Wolfgang Huber wrote:
> Hi,
>
> And the Bioconductor package "Biostrings" is the place to go for any
> serious work with sequences.
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 15 Jul 2008 - 16:33:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Jul 2008 - 17:31:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive