as.haplo: Transform a Haplotype Vector to a Compressed Haplotype Vector

Description Usage Arguments Value See Also Examples

Description

Coerce a matrix to a compressed haplotype matrix

Usage

1
2
3
haplomatrix(M, IndividualsPerColumn=TRUE, DoubledIndividuals=TRUE)
## S3 method for class 'haplomatrix'
as(object, ...)

Arguments

M,object

matrix of two rows containing only the values 0 and 1

IndividualsPerColumn \ipc
DoubledIndividuals \dindiv
...

All arguments of haplomatrix except M

Value

an object of class genomicmatrix

See Also

Note that a haplotype file can be read in by genomicmatrix.

as.matrix transforms a genomicmatrix to a human readable matrix.

Examples

1
2
3
4
5
6
7
set.seed(0)
snps <- 100
cols <- 2
M <- matrix(sample(0:1, snps * cols, replace=TRUE), ncol = snps)
Print(M)
print(GM <- haplomatrix(M))
stopifnot(all(as.matrix(GM) == M))

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