diff --git a/DESCRIPTION b/DESCRIPTION index d98f204..5e1be5b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -15,7 +15,7 @@ Authors@R: c(person(given="Sheng", family="Li", role=c("aut","cre", "cph"), emai person(family="Melnick", given="Ari", role="ctb"), person(family="Mason", given="Chris", role=c("ctb","ths"))) Maintainer: Sheng Li -Depends: R (>= 3.4.0) +Depends: R (>= 3.2.0) Imports: GenomicRanges, IRanges, data.table, mixtools, S4Vectors License: Artistic-2.0 URL: https://github.com/ShengLi/edmr diff --git a/R/annotation.R b/R/annotation.R index 5b67ac0..4d66b42 100644 --- a/R/annotation.R +++ b/R/annotation.R @@ -58,7 +58,7 @@ plotdmrdistr=function(myDMR, subject){ # countOverlapDMRs countOverlapDMRs=function(dmr,anno){ x=findOverlaps(dmr,anno) - unique(x@from) + unique(x@queryHits) } col.list=c("#E41A1C","#377EB8","#984EA3","#4DAF4A","#FF7F00","#FFFF33", "#A65628", "#8DD3C7" ) #int=lapply(subject, function(x)intersect(myDMR,x))G @@ -82,7 +82,7 @@ plotdmrdistr=function(myDMR, subject){ #' @importFrom IRanges values get.dmr.genes=function(myDMR, subject, id.type="gene.symbol"){ ind=findOverlaps(subject,myDMR) - unique(values(subject)[unique(ind@to), id.type]) + unique(values(subject)[unique(ind@subjectHits), id.type]) } #' get hyper-methylated DMRs diff --git a/R/getDMR.R b/R/getDMR.R index 8597ee8..b73fd6c 100644 --- a/R/getDMR.R +++ b/R/getDMR.R @@ -42,7 +42,8 @@ getDMR=function(peaks, allMyDiff, pcutoff=0.1,step=100, DMC.qvalue=0.01, DMC.met myDiff.gr=GRanges(seqnames=Rle(myDiff$pchr), IRanges(start=as.integer(myDiff$pstart), end=as.integer(myDiff$pend)), strand=myDiff$pstrand, pval=myDiff$ppvalue, padj=myDiff$pqvalue, methDiff=myDiff$pmethdiff) peaks.gr=GRanges(seqnames=Rle(peaks$rchr), IRanges(start=as.integer(peaks$rstart), end=as.integer(peaks$rend))) overlap.idx=findOverlaps(myDiff.gr, peaks.gr) - dt.pk.myD=data.table(cbind(peaks[overlap.idx@to,], myDiff[overlap.idx@from,])) + #dt.pk.myD=data.table(cbind(peaks[overlap.idx@to,], myDiff[overlap.idx@from,])) + dt.pk.myD=data.table(cbind(peaks[overlap.idx@subjectHits,], myDiff[overlap.idx@queryHits,])) #print(head(dt.pk.myD)) refine.pk.myD=dt.pk.myD[, list(medianmethdiff=median(pmethdiff), meanmethdiff=mean(pmethdiff), diff --git a/README.md b/README.md index 9f3db87..c7bcd06 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ source("http://bioconductor.org/biocLite.R") biocLite(c("GenomicRanges","IRanges")) # install from github library(devtools) -install_github("edmr", username = "ShengLi",build_vignettes=FALSE) +install_github("ShengLi/edmr", build_vignettes=FALSE) ``` Usage