view annoPeakFigure/annoPeakFigure.R @ 0:88964c4b12a0 draft

Uploaded
author testtool
date Mon, 06 Feb 2017 10:58:35 -0500
parents
children 6278004aa9b2
line wrap: on
line source

require("ChIPseeker", quietly = TRUE)
require("ChIPpeakAnno", quietly = TRUE)

options(warn = -1)

args <- commandArgs(trailingOnly = TRUE)
DMR = args[1]
annoPeakFigure = args[2]

#DMR <- ("test-data/DMR.bed")
DMRInfo = read.table(
  DMR,
  header = FALSE,
  sep = "\t",
  stringsAsFactors = FALSE,
  quote = ""
)

DMRPeaks <- GRanges(seqnames = DMRInfo[, 1],
                    ranges = IRanges
                    (start = DMRInfo[, 2], end = DMRInfo[, 3]))

annotatePeak <- (annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))

#annoPeakFigure <- ('test-data/annoPeakFigure.png')

png(file = annoPeakFigure,
    width = 1200,
    height = 600)

upsetplot(annotatePeak, vennpie = TRUE)

dev.off()