Description Usage Arguments Value Author(s) See Also Examples
Set the states for a set of Site objects aggregated by a Sequence object. The value vector is recycled, which is useful when creating repeated patterns.
1 2 |
this |
A Sequence object. |
value |
A character vector containg the states (recycled if shorter than the index vector). The states must be compatible with the corresponding Alphabet object. |
index |
An integer vector specifying a set of positions. It is set to 1:seq$length if omitted. |
... |
Not used. |
The Sequence object (invisible).
Botond Sipos, Gregory Jordan
For more information see Sequence
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # create a sequence object of length 10
s<-Sequence(alphabets=list(NucleotideAlphabet()),length=10)
# set the states in some ranges
setStates(s,c("A","T","A"),index=1:5)
setStates(s,c("G","C"),index=6:10)
# display sequence
s
# set the states for the whole Sequence object
setStates(s,c("A","T","T","A"))
s
# set states via virtual field
s$states<-c("A","T")
s
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.