sequences2transmatrix: Transition matrix from sequence(s)

View source: R/rMethods.R

sequences2transmatrixR 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)

localScore documentation built on April 3, 2025, 5:26 p.m.