count {seqinr}R Documentation

Composition of dimer/trimer/etc nucleotides

Description

Counts the number of times dimer/trimer/etc nucleotides occurs in a sequence. Note that the oligomers are overlapping.

Usage

count(seq,word,frame=0)

Arguments

seq a vector of chars
word an integer giving the size of word (n-mer) to count
frame an integer (0,1,2) giving the frame (starting position)

Details

count counts the occurence of all words by moving a window of length word. The window step is always an unit. frame controls the starting position in the sequence for the count.

Value

This function returns a factor whose levels are all the possible oligonucleotids. All oligomers are returned, even if absent from the sequence.

Author(s)

D. Charif

References

  To have an overview of the seqinR's functionnality, please consult this vignette: Charif, D., Lobry, J.R. (2005) SeqinR: a contributed package to the R project for statistical computing devoted to biological sequences retrieval and analysis. Springer Verlag, Biological and Medical Physics/Biomedical Series, in preparation.

See Also

table

Examples

a=s2c("acgggtacggtcccatcgaa")
##To count the occurences of dinucleotides of a:
count(a,2)
##To count the occurences of trinucleotides of a in frame 2:
count(a,3,2)

[Package seqinr version 1.0-2 Index]