sequences2transmatrix {localScore} | R Documentation |
Transition matrix from sequence(s)
Description
Calculates the transition matrix by counting occurrences of tuples in given vector list
Usage
sequences2transmatrix(sequences)
Arguments
sequences |
Sequences to be analyzed, can be a list of vectors, or a vector |
Details
In output, score_value is coerced as integer if possible. Else, it is a character vector containing the states of the Markov chain.
Value
A list object containing
transition_matrix |
Transition Matrix with row names and column names are the associated score/state |
score_value |
a vector containing the score/state, ordered in the same way as the matrix columns and rows |
Examples
myseq <- sample(LETTERS[1:2], size=20,replace=TRUE)
sequences2transmatrix(myseq)
[Package localScore version 2.0.3 Index]