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@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.