matrix.snp_unphased | R Documentation |
Creates a SNP unphased matrix.
matrix.snp_unphased(io, n_threads = 1)
io |
IO handler. |
n_threads |
Number of threads. |
SNP unphased matrix.
n <- 123
s <- 423
filename <- paste(tempdir(), "snp_unphased_dummy.snpdat", sep="/")
handle <- io.snp_unphased(filename)
mat <- matrix(
as.integer(sample.int(
3, n * s,
replace=TRUE,
prob=c(0.7, 0.2, 0.1)
) - 1),
n, s
)
impute <- double(s)
handle$write(mat, "mean", impute, 1)
out <- matrix.snp_unphased(handle)
file.remove(filename)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.