Description Usage Arguments Value See Also Examples
copyGeno
copies a coded SNP matrix
zeroNthGeno
writes zeros into selected rows of a coded SNP matrix
fillGeno
allows to fill (or replace) colums of a compressed
(snps \times indiv) matrix.
1 2 3 4 | fillGeno(SNPxIndiv, indiv, values, IndividualsPerColumn=TRUE,
DoubledIndividuals=TRUE)
copyGeno(SNPxIndiv)
zeroNthGeno(SNPxIndiv, snps)
|
SNPxIndiv |
a compressed SNP (genotype) vector or matrix,
obtained from |
indiv |
integer vector. It gives
the columns of the (SNP \times Indiv) matrix
that has to be filled with |
values |
coded or uncoded vector or matrix of haplotype or genotypes. |
snps |
vector of integers, which gives the selected rows. If missing all rows are selected. |
IndividualsPerColumn |
\ipc |
DoubledIndividuals |
\dindiv |
All functions return a compressed SNP matrix of class genomicmatrix
.
vectorGeno
for multiplying a vector from the left
genoVector
for multiplying a vector from the right
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
require(RandomFieldsUtils)
set.seed(0)
indiv <- sample(1000, 1)
snps <- indiv * 2^sample(7,1)
M <- matrix(nrow = snps, sample(0:2, snps * indiv, replace=TRUE))
storage.mode(M) <- sample(c("integer", "double"), 1)
CM <- genomicmatrix(M)
str(CM)
Z <- as.matrix(CM)
Print(M, CM, Z)
stopifnot(all(M == Z))
N <- sample(snps, snps / 4)
Z1 <- as.matrix(CM, snps=N)
stopifnot(all(M[N, ] == Z1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.