genomicmatrix-class: Class 'genomicmatrix'

Description Usage Arguments Details See Also Examples

Description

Class representing a genomic matrix

Usage

1
2
3
4
5
6
## S3 method for class 'genomicmatrix'
print(x, ...)
## S3 method for class 'genomicmatrix'
str(object, ...)
## S3 method for class '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

1
2
3
4
5
6
7
8
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))

miraculix documentation built on Sept. 22, 2021, 5:07 p.m.