basecontent {Biostrings} | R Documentation |
WARNING: Both basecontent
and countbases
are now defunct
and will be removed soon together with this man page.
See the examples at the bottom of the man page for how to use
alphabetFrequency
instead.
These functions accept a character vector representing the nucleotide sequences and compute the frequencies of each base (A, C, G, T).
basecontent(seq) countbases(seq, dna = TRUE)
seq |
Character vector. |
dna |
Logical value indicating whether the sequence is DNA
(TRUE ) or RNA (FALSE ) |
The base frequencies are calculated separately for
each element of x
.
The elements of x
can be in upper case, lower case
or mixed.
A matrix with 4 columns and length(x)
rows. The columns are
named A
, C
, T
, G
, and the values in each
column are the counts of the corresponding bases in the elements of
x
. When dna=FALSE
, the T
column is replaced with
a U
column.
R. Gentleman, W. Huber, S. Falcon
alphabetFrequency
, reverseComplement
v<-c("AAACT", "GGGTT", "ggAtT") ## You can't use these functions anymore (defunct): if (interactive()) { basecontent(v) countbases(v) } ## But you can do this instead: v <- DNAStringSet(v) alphabetFrequency(v, baseOnly=TRUE)