changeset 6:b418a1d3585d draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/chipseeker commit d83142dbe2432fcb0f56dcd6311a05c061628ecc
author rnateam
date Wed, 13 Mar 2019 03:05:16 -0400
parents 4c2dbe4dbb4e
children 1b9a9409831d
files chipseeker.R chipseeker.xml
diffstat 2 files changed, 47 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/chipseeker.R	Tue Dec 04 10:01:20 2018 -0500
+++ b/chipseeker.R	Wed Mar 13 03:05:16 2019 -0400
@@ -17,6 +17,8 @@
     make_option(c("-d","--downstream"), type="integer", help="TSS downstream region"),
     make_option(c("-F","--flankgeneinfo"), type="logical", help="Add flanking gene info"),
     make_option(c("-D","--flankgenedist"), type="integer", help="Flanking gene distance"),
+    make_option(c("-j","--ignoreUpstream"), type="logical", help="Ignore upstream"),
+    make_option(c("-k","--ignoreDownstream"), type="logical", help="Ignore downstream"),
     make_option(c("-f","--format"), type="character", help="Output format (interval or tabular)."),
     make_option(c("-p","--plots"), type="logical", help="PDF of plots."),
     make_option(c("-r","--rdata"), type="logical", help="Output RData file.")
@@ -31,15 +33,36 @@
 down = args$downstream
 format = args$format
 
+if (!is.null(args$flankgeneinfo)) {
+    flankgeneinfo <- TRUE
+} else {
+    flankgeneinfo <- FALSE
+}
+
+if (!is.null(args$ignoreUpstream)) {
+    ignoreUpstream <- TRUE
+} else {
+    ignoreUpstream <- FALSE
+}
+
+if (!is.null(args$ignoreDownstream)) {
+    ignoreDownstream <- TRUE
+} else {
+    ignoreDownstream <- FALSE
+}
+
 peaks <- readPeakFile(peaks)
 
 # Make TxDb from GTF
 txdb <- makeTxDbFromGFF(gtf, format="gtf")
-if (!is.null(args$flankgeneinfo)) {
-    peakAnno <-  annotatePeak(peaks, TxDb=txdb, tssRegion=c(-up, down), addFlankGeneInfo=args$flankgeneinfo, flankDistance=args$flankgenedist)
-} else {
-    peakAnno <-  annotatePeak(peaks, TxDb=txdb, tssRegion=c(-up, down))
-}
+
+# Annotate peaks
+peakAnno <-  annotatePeak(peaks, TxDb=txdb,
+    tssRegion=c(-up, down),
+    addFlankGeneInfo=flankgeneinfo,
+    flankDistance=args$flankgenedist,
+    ignoreUpstream=ignoreUpstream,
+    ignoreDownstream=ignoreDownstream)
 
 # Add gene name
 features <- import(gtf, format="gtf")
--- a/chipseeker.xml	Tue Dec 04 10:01:20 2018 -0500
+++ b/chipseeker.xml	Wed Mar 13 03:05:16 2019 -0400
@@ -1,8 +1,8 @@
-<tool id="chipseeker" name="ChIPseeker" version="1.16.2">
+<tool id="chipseeker" name="ChIPseeker" version="1.18.0">
     <description>for ChIP peak annotation and visualization</description>
     <requirements>
-        <requirement type="package" version="1.16.1">bioconductor-chipseeker</requirement>
-        <requirement type="package" version="1.4.4">r-optparse</requirement>
+        <requirement type="package" version="1.18.0">bioconductor-chipseeker</requirement>
+        <requirement type="package" version="1.6.1">r-optparse</requirement>
     </requirements>
     <version_command><![CDATA[
 echo $(R --version | grep version | grep -v GNU)", ChIPseeker version" $(R --vanilla --slave -e "library(ChIPseeker); cat(sessionInfo()\$otherPkgs\$ChIPseeker\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", optparse version" $(R --vanilla --slave -e "library(optparse); cat(sessionInfo()\$otherPkgs\$optparse\$Version)" 2> /dev/null | grep -v -i "WARNING: ")
@@ -25,14 +25,27 @@
         -G '$gtf'
         -u $adv.upstream
         -d $adv.downstream
+
         #if $adv.flankgeneinfo:
             -F $adv.flankgeneinfo
-            -D $adv.flankgenedist
+        #end if
+
+        -D $adv.flankgenedist
+
+        #if $adv.ignoreUpstream:
+            -j $adv.ignoreUpstream
         #end if
+
+        #if $adv.ignoreDownstream:
+            -k $adv.ignoreDownstream
+        #end if
+
         -f $format
+
         #if $pdf:
             -p $pdf
         #end if
+
         -r $rdata
     ]]>
     </command>
@@ -70,6 +83,8 @@
             <param name="downstream" type="integer" min="0" value="3000" label="TSS downstream region" help="User can define TSS (transcription start site) region, by default TSS is defined from -3kb to +3kb."/>
             <param name="flankgeneinfo" type="boolean" truevalue="True" falsevalue="False" checked="False" label="Add flanking gene information?" help="If specified all genes within the flanking gene distance are reported for each peak. Default: No."/>
             <param name="flankgenedist" type="integer" min="0" value="5000" label="Flanking gene distance" help="If flanking gene info is turned on the flanking distance can be specified. Default: 5000."/>
+            <param name="ignoreUpstream" type="boolean" truevalue="True" falsevalue="False" checked="False" label="Ignore upstream?" help="If Yes only annotate gene at the 3’ of the peak. Default: No."/>
+            <param name="ignoreDownstream" type="boolean" truevalue="True" falsevalue="False" checked="False" label="Ignore downstream?" help="If Yes only annotate gene at the 5’ of the peak. Default: No."/>
         </section>
     </inputs>