Description Usage Arguments Examples
Uses neighbor SNPs from the clustering hierarchy to impute alleles to positions with missing values.
1 | imputeSnpMatrix(snp, snpClust, min.absCor = 0.1, mc.cores = 1)
|
snp |
an object of class snpMatrix. |
snpClust |
an object of class |
min.absCor |
a minimum value of correlation. If missing values still exist if this point in the hierarchy is reached, imputing is done via allele frequencies. |
mc.cores |
a number of cores for parallelising. Theoretical maximum is
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # file containing example data for SNP data
gfile <- system.file("extdata/snpdata.csv", package = "qtcat")
snp1 <- read.snpData(gfile, sep = ",")
# delete SNP information from Matrix, 33.33% NAs (-> 66.67% SNP info)
snp2 <- snp1
nainx <- sample(1:length(snp2@snpData), length(snp2@snpData) / 3)
snp2@snpData[nainx] <- as.raw(0)
# clustering
snp2clust <- qtcatClust(snp2)
# imputing
snp3 <- imputeSnpMatrix(snp2, snp2clust)
# comparison of the full and the imputed data set
snpmat1 <- as.matrix(snp1)
snpmat3 <- as.matrix(snp3)
(1 - sum(abs(snpmat1- snpmat3)) / length(snpmat1)) * 100
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.