io.snp_phased_ancestry | R Documentation |
IO handler for SNP phased, ancestry matrix.
io.snp_phased_ancestry(filename, read_mode = "file")
filename |
File name. |
read_mode |
Reading mode. |
IO handler for SNP phased, ancestry data.
n <- 123
s <- 423
A <- 8
filename <- paste(tempdir(), "snp_phased_ancestry_dummy.snpdat", sep="/")
handle <- io.snp_phased_ancestry(filename)
calldata <- matrix(
as.integer(sample.int(
2, n * s * 2,
replace=TRUE,
prob=c(0.7, 0.3)
) - 1),
n, s * 2
)
ancestries <- matrix(
as.integer(sample.int(
A, n * s * 2,
replace=TRUE,
prob=rep_len(1/A, A)
) - 1),
n, s * 2
)
handle$write(calldata, ancestries, A, 1)
handle$read()
file.remove(filename)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.