cc = new("CisConfig")
chrnames(cc) = "21"
genome(cc) = "hg19"
lkp = try(library(parallel))
if (!inherits(lkp, "try-error")) {
nc = min(10, detectCores())
options(mc.cores=nc)
geneApply(cc) = mclapply
}
estimates(cc) = FALSE
set.seed(1234)
unix.time(f1 <- cisScores( cc ))
#
# demonstrate adding annotation on chromatin state and gwas status
#
eprops = function(ans) {
#
# only adds fields to values() of the input
#
data(hmm878)
ac = as.character
eqr = GRanges(ac(seqnames(ans)), IRanges(ans$snplocs, width=1))
fo = findOverlaps(eqr, hmm878)
chromcat878 = factor(rep("none", length(ans)), levels=c(unique(hmm878$name), "none"))
chromcat878[ queryHits(fo) ] = factor(hmm878$name[subjectHits(fo)])
ans$chromcat878 = chromcat878
if (require(gwascat)) {
data(gwastagger)
isgwashit = 1*(overlapsAny(eqr, gwastagger) | ans$snp ans$isgwashit = isgwashit
}
ans
}
extraProps(cc) = eprops
set.seed(1234)
unix.time(f2 <- cisScores( cc ))
#
#
inflammFilter # to make more restrictive predicate for prediction
Run the code above in your browser using DataLab