Learn R Programming

miraculix (version 0.9.23)

genomicmatrix-class: Class genomicmatrix

Description

Class representing a genomic matrix

Usage

# S3 method for genomicmatrix
print(x, …)
# S3 method for genomicmatrix
str(object, …)
# S3 method for genomicmatrix
as.matrix(x, …)

Arguments

x,object

a compressed (SNP x Individuals) matrix

see print, str for options; see section ‘Details’ for as.matrix.

Details

Since the genomic matrix has only the values 0,1,2, genomicmatrix uses a two bit compressed storing mode in case RFoptions(snpcoding = TwoBit) or snpcoding = Shuffle, for instance, see RFoptions for more information and further options.

The options for as.matrix are

N

vector of integers, which gives the selected rows. If missing all rows are selected.

do.centering

logical. If TRUE the value of RFoptions()$genetics$centering is considered.

TRUE

centering by rowMeans.

FALSE

no centering is performed (although do.centering = TRUE!)

is.numeric

the values given by the user are substracted.

See Also

genomicmatrix haplomatrix-class

Examples

Run this code
# NOT RUN {
set.seed(0)
snps <- 100
indiv <- 10
M <- matrix(sample(0:2, snps * indiv, replace=TRUE), nrow = snps)
GM <- genomicmatrix(M)
print(GM)
str(GM)
stopifnot(all(as.matrix(GM) == M))
# }

Run the code above in your browser using DataLab