comparison chipseeker.R @ 4:90fe78a19b55 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/chipseeker commit 6f594126ac7369cc80c30a02a6df57e785dfb45a
author rnateam
date Mon, 26 Nov 2018 06:21:37 -0500
parents 535321abf9a4
children b418a1d3585d
comparison
equal deleted inserted replaced
3:535321abf9a4 4:90fe78a19b55
51 #Extract metadata cols, 1st is geneId, rest should be from col 7 to end 51 #Extract metadata cols, 1st is geneId, rest should be from col 7 to end
52 metacols <- res[, c(7:ncol(res), 1)] 52 metacols <- res[, c(7:ncol(res), 1)]
53 # Convert from 1-based to 0-based format 53 # Convert from 1-based to 0-based format
54 if (format == "interval") { 54 if (format == "interval") {
55 metacols <- apply(as.data.frame(metacols), 1, function(col) paste(col, collapse="|")) 55 metacols <- apply(as.data.frame(metacols), 1, function(col) paste(col, collapse="|"))
56 resout <- data.frame(Chrom=res$seqnames, 56 resout <- data.frame(res$seqnames,
57 Start=res$start - 1, 57 res$start - 1,
58 End=res$end, 58 res$end,
59 Comment=metacols) 59 metacols)
60 colnames(resout)[1:4] <- c("Chrom", "Start", "End", "Comment")
60 } else { 61 } else {
61 resout <- data.frame(Chrom=res$seqnames, 62 resout <- data.frame(res$seqnames,
62 Start=res$start - 1, 63 res$start - 1,
63 End=res$end, 64 res$end,
64 metacols) 65 metacols)
66 colnames(resout)[1:3] <- c("Chrom", "Start", "End")
65 } 67 }
66
67 write.table(resout, file="out.tab", sep="\t", row.names=FALSE, quote=FALSE) 68 write.table(resout, file="out.tab", sep="\t", row.names=FALSE, quote=FALSE)
68 69
69 if (!is.null(args$plots)) { 70 if (!is.null(args$plots)) {
70 pdf("out.pdf", width=14) 71 pdf("out.pdf", width=14)
71 plotAnnoPie(peakAnno) 72 plotAnnoPie(peakAnno)