Previous changeset 0:88964c4b12a0 (2017-02-06) Next changeset 2:a23d604eb17b (2017-02-28) |
Commit message:
Uploaded |
modified:
annoPeakFigure/annoPeakFigure.R annoPeakFigure/annoPeakFigure.xml |
added:
annoPeakFigure/.RData annoPeakFigure/.Rhistory annoPeakFigure/test-data/annoPeakAnnoBar.png annoPeakFigure/test-data/annoPeakUpset.png |
removed:
annoPeakFigure/._annoPeakFigure.png annoPeakFigure/annoPeakFigure.png |
b |
diff -r 88964c4b12a0 -r 6278004aa9b2 annoPeakFigure/.RData |
b |
Binary file annoPeakFigure/.RData has changed |
b |
diff -r 88964c4b12a0 -r 6278004aa9b2 annoPeakFigure/.Rhistory --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/annoPeakFigure/.Rhistory Tue Feb 28 05:42:05 2017 -0500 |
[ |
b'@@ -0,0 +1,265 @@\n+TAB <- read.csv("input.csv")\n+mysamples <- lapply(TAB$ID,function(x)getGEO(x))\n+input <- function(TAB) { if(is(TAB, "csv")){\n+TAB <- read.csv("input.csv")}\n+else{\n+print("error in data file")\n+}}\n+input()\n+TAB <- read.csv("input.csv")}\n+TAB <- read.csv("input.csv")\n+test_func <- function(\n+clusterSize=2,\n+cutoff=0.2,\n+platform_id=\'HM450\',\n+genome_id=\'hg19\')\n+{\n+args = commandArgs(trailingOnly=TRUE)\n+methyl_file = args[1]\n+ChiPseq_file = args[2]\n+output_file = args[3]\n+options(warn=-1)\n+TAB=read.csv(methyl_file)\n+ChiPseq=import(ChiPseq_file)\n+if(is.null(TAB)){\n+stop("Must specify input files")\n+}else{\n+mysamples <- lapply(TAB$ID,function(x) getGEO(x))\n+}\n+wrappedFunction <- function(test_func)\n+s0 <- lapply(mysamples,Table)\n+id_ref<-lapply(s0,function(x)x$ID_REF)\n+if(length(unique(id_ref)) != 1) {\n+stop("Error different ID_REF for samples")\n+} else if (is.null((unlist(unique(id_ref))))) {\n+stop("NO GSM data avaliable")\n+} else {\n+values<-do.call("cbind",lapply(s0,function(x)x$VALUE))\n+colnames(values)=TAB$ID\n+rownames(values)=id_ref[[1]]\n+cg <- rownames(values)\n+probe <- c(cg)\n+hm450.hg19 <- getPlatform(platform=platform_id, genome=genome_id)\n+probe.info <- hm450.hg19[probe]\n+f <- data.table(probe=names(probe.info),CHR=as.data.frame(probe.info@seqnames)$value,\n+BP=as.numeric(probe.info@elementMetadata$probeStart))\n+designMatrix <- model.matrix(~ TAB$Phenotype)\n+DMR <- bumphunter(values, design = designMatrix,\n+pos=f$BP,cutoff=cutoff,chr=f$CHR)\n+MAT <- DMR$table[which(DMR$table$L>=clusterSize),]\n+METH <- GRanges(seqnames=MAT$chr,\n+ranges=IRanges\n+(start=MAT$start,\n+end=MAT$end),\n+value_pos=MAT$value)\n+peaks<-findOverlapsOfPeaks(probe.info,ChiPseq,maxgap=5000)\n+p <- peaks$peaklist$`probe.info///ChiPseq`\n+peakAnno <- annotatePeak(p, file=peakAnno)\n+output_file <- annotatePeak(p, file=output_file)\n+}}\n+test_func <- function(\n+clusterSize=2,\n+cutoff=0.2,\n+platform_id=\'HM450\',\n+genome_id=\'hg19\')\n+{\n+args = commandArgs(trailingOnly=TRUE)\n+methyl_file = args[1]\n+ChiPseq_file = args[2]\n+output_file = args[3]\n+options(warn=-1)\n+TAB=read.csv(methyl_file)\n+ChiPseq=import(ChiPseq_file)\n+if(is.null(TAB)){\n+stop("Must specify input files")\n+}else{\n+mysamples <- lapply(TAB$ID,function(x) getGEO(x))\n+}\n+wrappedFunction <- function(test_func)\n+s0 <- lapply(mysamples,Table)\n+id_ref<-lapply(s0,function(x)x$ID_REF)\n+if(length(unique(id_ref)) != 1) {\n+stop("Error different ID_REF for samples")\n+} else if (is.null((unlist(unique(id_ref))))) {\n+stop("NO GSM data avaliable")\n+} else {\n+values<-do.call("cbind",lapply(s0,function(x)x$VALUE))\n+colnames(values)=TAB$ID\n+rownames(values)=id_ref[[1]]\n+cg <- rownames(values)\n+probe <- c(cg)\n+hm450.hg19 <- getPlatform(platform=platform_id, genome=genome_id)\n+probe.info <- hm450.hg19[probe]\n+f <- data.table(probe=names(probe.info),CHR=as.data.frame(probe.info@seqnames)$value,\n+BP=as.numeric(probe.info@elementMetadata$probeStart))\n+designMatrix <- model.matrix(~ TAB$Phenotype)\n+DMR <- bumphunter(values, design = designMatrix,\n+pos=f$BP,cutoff=cutoff,chr=f$CHR)\n+MAT <- DMR$table[which(DMR$table$L>=clusterSize),]\n+METH <- GRanges(seqnames=MAT$chr,\n+ranges=IRanges\n+(start=MAT$start,\n+end=MAT$end),\n+value_pos=MAT$value)\n+peaks<-findOverlapsOfPeaks(probe.info,ChiPseq,maxgap=5000)\n+p <- peaks$peaklist$`probe.info///ChiPseq`\n+peakAnno <- annotatePeak(p, file=peakAnno)\n+output_file <- annotatePeak(p, file=output_file)\n+}}\n+)\n+a<-c(3.2,3.7,3.6,3.9,3.7,3.5,3.8,4,3.5)\n+a<-c(3.2,3.7,3.6,3.9,3.7,3.5,3.8,4,3.5)\n+b<-c(2.9,2.7,2,6,2.7,2.5,2.5,3.2,3.1,3.3,2.8)\n+a-b\n+file<-read.csv("~/Documents/SS2.csv")\n+head(file)\n+e\n+file\n+t.test(file$WBT,file$WBA)\n+t.test(file$WBT,file$WBA,paired=TRUE)\n+mysamples <- lapply(TAB$ID,function(x) TablegetGEO(x))\n+require("GEOquery",quietly = TRUE)\n+require("BiocGenerics",quietly = TRUE)\n+args <- commandArgs(trailingOnly = TRUE)\n+csv_file = args[1]\n+#csv_file <- ("test-data/input.csv")\n+TAB=read.csv(csv_file)\n+if(is.null(TAB)){\n+stop("Must specify input files")\n+}else{\n+mysampl'..b'csv(csv_file)\n+TAB\n+??bumphunter\n+require("ChIPseeker", quietly = TRUE)\n+require("ChIPpeakAnno", quietly = TRUE)\n+options(warn = -1)\n+#args <- commandArgs(trailingOnly = TRUE)\n+#DMR = args[1]\n+#annoPeakFigure = args[2]\n+setwd(\'/Users/katarzynamurat/Desktop/galaxy/test-data\')\n+DMR <- ("DMR.bed")\n+DMRInfo = read.table(\n+DMR,\n+header = FALSE,\n+sep = "\\t",\n+stringsAsFactors = FALSE,\n+quote = ""\n+)\n+DMRPeaks <- GRanges(seqnames = DMRInfo[, 1],\n+ranges = IRanges\n+(start = DMRInfo[, 2], end = DMRInfo[, 3]))\n+annotatePeak <- (annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))\n+annoPeakFigure <- (\'annoPeakFigure.png\')\n+png(file = annoPeakFigure, width = 1500,height = 700, units = "px", bg = "white")\n+genes= lapply(annotatePeak, function(i) as.data.frame(i)$geneId)\n+vennplot(genes)\n+dev.off()\n+genes= lapply(as.list(annotatePeak), function(i) as.data.frame(i)$geneId)\n+vennplot(genes)\n+peakAnnoList <- lapply(DMRPeaks, annotatePeak)\n+peakAnnoList\n+annotatePeak <- (annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))\n+peakAnnoList <- lapply(DMRPeaks, annotatePeak)\n+peakAnnoList\n+annoPeakFigure <- (\'annoPeakFigure.png\')\n+png(file = annoPeakFigure, width = 1500,height = 700, units = "px", bg = "white")\n+plotAnnoBar(peakAnno)\n+dev.off()\n+annotatePeak <- (annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))\n+annoPeakFigure <- (\'annoPeakFigure.png\')\n+png(file = annoPeakFigure, width = 1500,height = 700, units = "px", bg = "white")\n+plotAnnoBar(annotatePeak)\n+dev.off()\n+png(file = annoPeakFigure, width = 800,height = 400, units = "px", bg = "white")\n+plotAnnoBar(annotatePeak)\n+dev.off()\n+png(file = annoPeakFigure, width = 800,height = 400, units = "px", bg = "white", pointsize = 12)\n+plotAnnoBar(annotatePeak)\n+dev.off()\n+annoPeakFigure <- (\'annoPeakFigure.png\')\n+png(file = annoPeakFigure, width = 800,height = 400, units = "px", bg = "white", pointsize = 12)\n+plotAnnoBar(annotatePeak)\n+dev.off()\n+options(warn = -1)\n+args <- commandArgs(trailingOnly = TRUE)\n+DMR = args[1]\n+annoPeakFigure = args[2]\n+DMR <- ("test-data/DMR.bed")\n+DMRInfo = read.table(\n+DMR,\n+header = FALSE,\n+sep = "\\t",\n+stringsAsFactors = FALSE,\n+quote = ""\n+)\n+DMRPeaks <- GRanges(seqnames = DMRInfo[, 1],\n+ranges = IRanges\n+(start = DMRInfo[, 2], end = DMRInfo[, 3]))\n+annotatePeak <- (annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))\n+annoPeakFigure <- (\'test-data/annoPeakFigure.png\')\n+png(file = annoPeakFigure,\n+width = 1200,\n+height = 600)\n+plotAnnoBar(annotatePeak)\n+upsetplot(annotatePeak, vennpie = TRUE)\n+dev.off()\n+annoPeakFigure1 <- (\'test-data/annoPeakUpset.png\')\n+annoPeakFigure2 <- (\'test-data/annoPeakAnnoBar.png\')\n+png(file = annoPeakFigure1,\n+width = 1200,\n+height = 600)\n+plotAnnoBar(annotatePeak)\n+dev.off()\n+png(file = annoPeakFigure2,\n+width = 1200,\n+height = 600)\n+upsetplot(annotatePeak, vennpie = TRUE)\n+dev.off()\n+getwd()\n+setwd("/Users/katarzynamurat/Desktop/annoPeakFigure")\n+annoPeakFigure1 <- (\'test-data/annoPeakUpset.png\')\n+annoPeakFigure2 <- (\'test-data/annoPeakAnnoBar.png\')\n+png(file = annoPeakFigure1,\n+width = 1200,\n+height = 600)\n+plotAnnoBar(annotatePeak)\n+dev.off()\n+png(file = annoPeakFigure2,\n+width = 1200,\n+height = 600)\n+upsetplot(annotatePeak, vennpie = TRUE)\n+dev.off()\n+require("ChIPseeker", quietly = TRUE)\n+require("ChIPpeakAnno", quietly = TRUE)\n+options(warn = -1)\n+DMR <- ("test-data/DMR.bed")\n+DMRInfo = read.table(\n+DMR,\n+header = FALSE,\n+sep = "\\t",\n+stringsAsFactors = FALSE,\n+quote = ""\n+)\n+DMRPeaks <- GRanges(seqnames = DMRInfo[, 1],\n+ranges = IRanges\n+(start = DMRInfo[, 2], end = DMRInfo[, 3]))\n+annotatePeak <- (annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))\n+annoPeakFigure1 <- (\'test-data/annoPeakUpset.png\')\n+annoPeakFigure2 <- (\'test-data/annoPeakAnnoBar.png\')\n+png(file = annoPeakFigure1,\n+width = 1200,\n+height = 600)\n+plotAnnoBar(annotatePeak)\n+dev.off()\n+png(file = annoPeakFigure2,\n+width = 1200,\n+height = 600)\n+upsetplot(annotatePeak, vennpie = TRUE)\n+dev.off()\n+getwd()\n' |
b |
diff -r 88964c4b12a0 -r 6278004aa9b2 annoPeakFigure/._annoPeakFigure.png |
b |
Binary file annoPeakFigure/._annoPeakFigure.png has changed |
b |
diff -r 88964c4b12a0 -r 6278004aa9b2 annoPeakFigure/annoPeakFigure.R --- a/annoPeakFigure/annoPeakFigure.R Mon Feb 06 10:58:35 2017 -0500 +++ b/annoPeakFigure/annoPeakFigure.R Tue Feb 28 05:42:05 2017 -0500 |
[ |
@@ -5,7 +5,8 @@ args <- commandArgs(trailingOnly = TRUE) DMR = args[1] -annoPeakFigure = args[2] +annoPeakFigure1 = args[2] +annoPeakFigure2 = args[3] #DMR <- ("test-data/DMR.bed") DMRInfo = read.table( @@ -22,12 +23,22 @@ annotatePeak <- (annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db")) -#annoPeakFigure <- ('test-data/annoPeakFigure.png') +#annoPeakFigure1 <- ('test-data/annoPeakUpset.png') +#annoPeakFigure2 <- ('test-data/annoPeakAnnoBar.png') -png(file = annoPeakFigure, +png(file = annoPeakFigure1, + width = 1200, + height = 600) + +plotAnnoBar(annotatePeak) + +dev.off() + +png(file = annoPeakFigure2, width = 1200, height = 600) upsetplot(annotatePeak, vennpie = TRUE) dev.off() + |
b |
diff -r 88964c4b12a0 -r 6278004aa9b2 annoPeakFigure/annoPeakFigure.png |
b |
Binary file annoPeakFigure/annoPeakFigure.png has changed |
b |
diff -r 88964c4b12a0 -r 6278004aa9b2 annoPeakFigure/annoPeakFigure.xml --- a/annoPeakFigure/annoPeakFigure.xml Mon Feb 06 10:58:35 2017 -0500 +++ b/annoPeakFigure/annoPeakFigure.xml Tue Feb 28 05:42:05 2017 -0500 |
[ |
@@ -5,14 +5,15 @@ <stdio> <exit_code range="1:" /> </stdio> - <command> Rscript $__tool_directory__/annoPeakFigure.R "$DMR" "$annoPeakFigure"</command> + <command> Rscript $__tool_directory__/annoPeakFigure.R "$DMR" "$annoPeakFigure1" "$annoPeakFigure2"</command> <inputs> <param optional="false" format="bed" name="DMR" type="data" value="" help="Bumphunter peaks." label="[required] file"> <validator type="empty_field" message="This field is required."/> </param> </inputs> <outputs> - <data format="png" name="annoPeakFigure" label="annoPeakFigure.png"/> + <data format="png" name="annoPeakFigure1" label="annoPeakUpset.png"/> + <data format="png" name="annoPeakFigure2" label="annoPeakAnnoBar.png"/> </outputs> <tests> <test> @@ -23,7 +24,8 @@ </collection> </element> </param> - <output format="png" name="annoPeakFigure" label="test-data/annoPeakFigure.png"/> + <output format="png" name="annoPeakFigure" label="test-data/annoPeakUpset.png"/> + <output format="png" name="annoPeakFigure" label="test-data/annoPeakAnnoBar.png"/> </test> </tests> <help> |
b |
diff -r 88964c4b12a0 -r 6278004aa9b2 annoPeakFigure/test-data/annoPeakAnnoBar.png |
b |
Binary file annoPeakFigure/test-data/annoPeakAnnoBar.png has changed |
b |
diff -r 88964c4b12a0 -r 6278004aa9b2 annoPeakFigure/test-data/annoPeakUpset.png |
b |
Binary file annoPeakFigure/test-data/annoPeakUpset.png has changed |