# Convert a dataframe to GRanges object
data(sites)
alldata.rd <- makeGRanges(sites,soloStart=TRUE)
data(genes)
genes.rd <- makeGRanges(genes)
doAnnotation(annotType="within",alldata.rd,genes.rd,"InGene",asBool=TRUE)
doAnnotation(annotType="counts",alldata.rd,genes.rd,"NumOfGene")
doAnnotation(annotType="nearest",alldata.rd,genes.rd,"NearestGene")
doAnnotation(annotType="countsBig",alldata.rd,genes.rd,"ChipSeqCounts")
geneCheck <- function(x,wanted) { x$isWantedGene <- x$InGene %in% wanted;
return(x) }
doAnnotation(annotType="within",alldata.rd,genes.rd,"InGene",
postProcessFun=geneCheck,
postProcessFunArgs=list("wanted"=c("FOXJ3","SEPT9","RPTOR")) )
Run the code above in your browser using DataLab