################################################### ### chunk number 1: doini ################################################### library(GGtools) data(hmceuB36.2021) hmceuB36.2021 ################################################### ### chunk number 2: lkex ################################################### exprs(hmceuB36.2021)[1:5,1:5] ################################################### ### chunk number 3: lksn ################################################### names(smList(hmceuB36.2021)) smList(hmceuB36.2021)[1:2] class(smList(hmceuB36.2021)[["20"]]) ################################################### ### chunk number 4: lkr ################################################### schunk = smList(hmceuB36.2021)[["20"]] schunk@.Data[1:4,1:4] ################################################### ### chunk number 5: lkr2 ################################################### as(schunk[1:4,1:4], "character") ################################################### ### chunk number 6: dod ################################################### pd = pData(hmceuB36.2021) hmFou = hmceuB36.2021[, which(pd$mothid == 0 & pd$fathid == 0)] library(illuminaHumanv1.db) pc = get("CPNE1", revmap(illuminaHumanv1SYMBOL)) hmFouc = hmFou[probeId(pc),] hmFouc system("rm -rf foo") f1 = eqtlTests(hmFouc[chrnum("20"),], ~male) f1 ################################################### ### chunk number 7: lkd ################################################### dir("foo") ################################################### ### chunk number 8: getd ################################################### nn = getNamedLocs(slpack= "SNPlocs.Hsapiens.dbSNP.20100427", chr="ch20") library(GenomicRanges) gg = getGRanges( f1, 1, 1, "ch20", nn ) gg[1:3,] ################################################### ### chunk number 9: lkb eval=FALSE ################################################### ## if (interactive()) { ## s1 = browserSession() ## rd = RangedData(gg) ## genome(rd) = "hg18" ## s1[["CPNE1"]] = rd ## v1 = browserView(s1, GenomicRanges(33.5e6,34.5e6, "chr20"), track=ucscTrackModes(hide="knownGene", full=c("refGene", "CPNE1"))) ## } ################################################### ### chunk number 10: getr eval=FALSE ################################################### ## data(imphm3_1KG_20_mA2) ## imphm3_1KG_20_mA2[1:10] ################################################### ### chunk number 11: doi eval=FALSE ################################################### ## try(system("rm -rf icpne1")) ## if1 = ieqtlTests(hmFouc[chrnum("chr20"),], ~male, targdir="icpne1", ## runname="icpne1", ## rules=imphm3_1KG_20_mA2) ################################################### ### chunk number 12: lkn1 eval=FALSE ################################################### ## length(GGtools:::snpIdList(f1)[[1]]) ################################################### ### chunk number 13: lki1 eval=FALSE ################################################### ## length(GGtools:::snpIdList(if1)[[1]]) ################################################### ### chunk number 14: getnm eval=FALSE ################################################### ## library(ceu1kg) ## data(ceu1kgMeta_20) ## inn = start(ceu1kgMeta_20) ## names(inn) = names(ceu1kgMeta_20) ## igg = getGRanges( if1, 1, 1, "chr20", inn) ################################################### ### chunk number 15: lkd eval=FALSE ################################################### ## library(rtracklayer) ## s1 = browserSession() ## genome(rd) = "hg18" ## s1[["CPNE1"]] = rd ## ird = RangedData(igg) ## genome(ird) = "hg18" ## s1[["ICPNE1"]] = ird ## v1 = browserView(s1, GenomicRanges(33.5e6,34.5e6, "chr20"), ## track=ucscTrackModes(hide="knownGene", ## full=c("refGene", "CPNE1", "ICPNE1"))) ################################################### ### chunk number 16: lkmach eval=FALSE ################################################### ## data(m20) ## as(m20, "numeric")[1:10,1:8] ################################################### ### chunk number 17: getcc eval=FALSE ################################################### ## c20obs = smList(hmFouc)[[20]] ## c20obs ################################################### ### chunk number 18: geti eval=FALSE ################################################### ## unix.time(c20imp <- impute.snps( imphm3_1KG_20_mA2, c20obs )) ## c20imp[1:5,1:5] ################################################### ### chunk number 19: lkcom eval=FALSE ################################################### ## C20D = m20[, intersect(colnames(m20), colnames(c20imp))] ## R20D = c20imp[, intersect(colnames(m20), colnames(c20imp))] ## oksnp = intersect(rownames(C20D), rownames(R20D)) ## length(oksnp) ## C20D = C20D[oksnp,] ## R20D = R20D[oksnp,] ################################################### ### chunk number 20: lkim eval=FALSE ################################################### ## length(mimp <- setdiff(colnames(m20), colnames(c20obs))) ################################################### ### chunk number 21: domon eval=FALSE ################################################### ## news = m20[, mimp ] ## vn = apply(news, 2, var) ## sum(vn==0) ## sum(vn < 0.01) ################################################### ### chunk number 22: ex eval=FALSE ################################################### ## table(as(news[ ,vn > 0 & vn < 0.01 ][,1], "character")) ################################################### ### chunk number 23: lkn eval=FALSE ################################################### ## if (.Platform$OS.type != "windows" ) { ## notreg = colnames(c20imp)[ which(apply(c20imp,2,function(x)all(is.na(x)))) ] ## inmachNR = intersect( mimp, notreg ) ## length(inmachNR) ## m20[1:10,inmachNR[1:5]] ## table(as(m20[,inmachNR[1]],"character")) ## table(as(m20[,inmachNR[2]],"character")) ## library(ceu1kg) ## if (!exists("ceu1kg.sml")) data(ceu1kg.sml) ## rawc20 = ceu1kg.sml[[20]] ## table(as(rawc20[,"chr20:35790"], "character")) ## table(as(rawc20[,"chr20:36155"], "character")) ## } ################################################### ### chunk number 24: lkm eval=FALSE ################################################### ## if (.Platform$OS.type != "windows" ) { ## MbutNR = c("chr20:35790", "chr20:36155") ## Y = rawc20[, MbutNR, drop=FALSE] ## X = rawc20[, -match(MbutNR, colnames(rawc20)), drop=FALSE] ## data(ceu1kgMeta_20) ## NL = start(ceu1kgMeta_20) ## names(NL) = names(ceu1kgMeta_20) ## LOCX = NL[ colnames(X) ] ## length(LOCX) ## LOCY = NL[ colnames(Y) ] ## imm = snp.imputation( X, Y, LOCX, LOCY, minA=2 ) ## imm ## imm1 = snp.imputation( X, Y, LOCX, LOCY, minA=1 ) ## imm1 ## } ################################################### ### chunk number 25: lkimm1 eval=FALSE ################################################### ## if (.Platform$OS.type != "windows" ) { ## ii = impute.snps(imm1, rawc20) ## apply(ii,2,table) ## }