rcspr2mat {spgs} | R Documentation |
Random Stochastic Matrices Complying with Chargaff's Second Parity Rule for Dinucleotides
Description
Randomly generate a 4 X 4 stochastic matrix that satisfies Chargaff's second parity rule for dinucleotides.
Usage
rcspr2mat(labels=c("a", "c", "g", "t"))
Arguments
labels |
a vector of labels for the rows and columns of the matrix. By default, this is set to the set of four nucleotides a, c, g and t. |
Details
This function randomly generates Stochastic matrices of the form
where , ...,
are values in the interval (0,1) and
is a positive number.
Such matrices characterize sequences of DNA that comply with Chargaff's second parity rule for dinucleotides. See the reference for further information.
Value
A 4 X 4 stochastic matrix satisfying Chargaff's second parity rule. The rows and columns are labelled according to labels.
Note
This function is only intended for obtaining samples of matrices complying with CSPR. It doe snot sample uniformly from the set of all such matrices and hence is not appropriate for simulation experiments requiring uniformly drawn samples.
Author(s)
Andrew Hart and Servet Martínez
References
Hart, A.G. and Martínez, S. (2011) Statistical testing of Chargaff's second parity rule in bacterial genome sequences. Stoch. Models 27(2), 1–46.