Mercurial > repos > testtool > annotate_peak
changeset 18:6a9b9694acbf draft
Uploaded
author | testtool |
---|---|
date | Mon, 20 Mar 2017 06:51:22 -0400 |
parents | 982a01524118 |
children | 741b192da59c |
files | annotate_peak/.RData annotate_peak/.Rhistory annotate_peak/annotatePeak.R annotate_peak/annotatePeak.xml |
diffstat | 4 files changed, 91 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/annotate_peak/.Rhistory Thu Mar 16 16:13:45 2017 -0400 +++ b/annotate_peak/.Rhistory Mon Mar 20 06:51:22 2017 -0400 @@ -136,3 +136,69 @@ TAB = read.csv(csv_file) TAB ??bumphunter +??toGranges +require("ChIPseeker", quietly = TRUE) +require("ChIPpeakAnno", quietly = TRUE) +options(warn = -1) +args <- commandArgs(trailingOnly = TRUE) +DMR = args[1] +annoPeakTable = args[2] +DMRInfo = read.table( +DMR, +header = FALSE, +sep = "\t", +stringsAsFactors = FALSE, +quote = "" +) +peaks <- GRanges(seqnames = DMRInfo[, 1], +ranges = IRanges +(start = DMRInfo[, 2], end = DMRInfo[, 3])) +peaks[1:2] +DMR <- ("test-data/DMR.bed") +DMRInfo = read.table( +DMR, +header = FALSE, +sep = "\t", +stringsAsFactors = FALSE, +quote = "" +) +peaks <- GRanges(seqnames = DMRInfo[, 1], +ranges = IRanges +(start = DMRInfo[, 2], end = DMRInfo[, 3])) +source("https://bioconductor.org/biocLite.R") +biocLite("EnsDb.Hsapiens.v75") +peaks <- toGRanges(seqnames = DMRInfo[, 1], +ranges = IRanges +(start = DMRInfo[, 2], end = DMRInfo[, 3])) +peaks <- toGRanges(DMRInfo) +peaks <- toGRanges(seqnames = DMRInfo[, 1], +ranges = IRanges +(start = DMRInfo[, 2], end = DMRInfo[, 3])) +DMR <- ("test-data/DMR.bed") +DMRInfo = read.table( +DMR, +header = FALSE, +sep = "\t", +stringsAsFactors = FALSE, +quote = "" +) +peaks <- toGRanges(seqnames = DMRInfo[, 1], +ranges = IRanges +(start = DMRInfo[, 2], end = DMRInfo[, 3])) +peaks <- toGRanges(seqnames = DMRInfo[, 1], format=c("BED"), feature=c("gene"), header=FALSE, +(start = DMRInfo[, 2], end = DMRInfo[, 3])) +peaks <- toGRanges(seqnames = DMRInfo[, 1], format=c("BED") +feature=c("gene") header=FALSE,(start = DMRInfo[, 2], end = DMRInfo[, 3])) +peaks <- toGRanges(seqnames = DMRInfo[, 1], format=c("BED"(start = DMRInfo[, 2], end = DMRInfo[, 3])) +peaks <- toGRanges(seqnames = DMRInfo[, 1], format=c("BED"(start = DMRInfo[, 2], end = DMRInfo[, 3])) +class(DMRInfo) +toGRanges(DMRInfo, seqnames = DMRInfo[, 1],(start = DMRInfo[, 2], end = DMRInfo[, 3])) +toGRanges(DMRInfo, seqnames = DMRInfo[, 1],(start = DMRInfo[, 2] end = DMRInfo[, 3])) +toGRanges(DMRInfo, seqnames = DMRInfo[, 1],start = DMRInfo[, 2], end = DMRInfo[, 3]) +toGRanges(DMRInfo, seqnames = DMRInfo[, 1](start = DMRInfo[, 2], end = DMRInfo[, 3])) +toGRanges(DMRInfo, colNames = DMRInfo[, 1](start = DMRInfo[, 2], end = DMRInfo[, 3])) +peaks <- toGRanges(DMRInfo) +peaks <- GRanges(seqnames = DMRInfo[, 1], +ranges = IRanges +(start = DMRInfo[, 2], end = DMRInfo[, 3])) +??fread
--- a/annotate_peak/annotatePeak.R Thu Mar 16 16:13:45 2017 -0400 +++ b/annotate_peak/annotatePeak.R Mon Mar 20 06:51:22 2017 -0400 @@ -1,6 +1,7 @@ require("ChIPseeker", quietly = TRUE) require("ChIPpeakAnno", quietly = TRUE) require("EnsDb.Hsapiens.v75", quietly = TRUE) +require("data.table", quietly = TRUE) options(warn = -1) options("download.file.method"="wget") @@ -9,8 +10,7 @@ DMR = args[1] annoPeakTable = args[2] -#DMR <- ("test-data/DMR.bed") -DMRInfo = read.table( +DMRInfo = fread( DMR, header = FALSE, sep = "\t", @@ -27,5 +27,4 @@ anno <- annoPeaks(peaks, annoData=annoData,bindingType ="startSite") -#annoPeakTable <- ('test-data/ChIPPeak.csv') -write.csv(anno, annoPeakTable, row.names = FALSE) \ No newline at end of file +write.table(anno, annoPeakTable, row.names = FALSE) \ No newline at end of file
--- a/annotate_peak/annotatePeak.xml Thu Mar 16 16:13:45 2017 -0400 +++ b/annotate_peak/annotatePeak.xml Mon Mar 20 06:51:22 2017 -0400 @@ -5,11 +5,32 @@ <stdio> <exit_code range="1:" /> </stdio> - <command> Rscript $__tool_directory__/annotatePeak.R "$DMR" "$annoPeakTable"</command> +<command> Rscript $__tool_directory__/annotatePeak.R "$DMR" "$annoData" "$bindingType" "$upstream" "$downstream" "$ignore.peak.strand" "$annoPeakTable"</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> + <param name="annoData" type="select" display="radio" label="annoData" help="choose your annoData human or mice"> + <option name="human" type="text" value="EnsDb.Hsapiens.v75">Human</option> + <option name="mice" type="float" value="">Mice</option> + </param> + <param name="bindingType" type="select" display="radio" label="bindingType" help="choose bindingType"> + <option name="sS" type="text" value="startSite">startSite</option> + <option name="eS" type="text" value="endSite">endSite</option> + <option name="fR" type="text" value="fullRange">fullRange</option> + </param> + <param name="ignore.peak.strand" type="select" display="radio" label="ignore.peak.strand" help="choose TRUE or FALSE"> + <option name="T" type="text" value="TRUE">true</option> + <option name="F" type="text" value="FALSE">false</option> + </param> + <param name="upstream" type="float" value="" + label="upstream - number no bigger than 0" + help="e.g. '-5000'" > + </param> + <param name="downstream" type="float" value="" + label="downstream - number no less than 1" + help="e.g. '5000'" > + </param> </inputs> <outputs> <data format="csv" name="annoPeakTable" label="peakAnno.csv"/>