changeset 3:82df5af2995f draft

Renamed from "ceasbw..." to "ceas...".
author pjbriggs
date Wed, 22 Apr 2015 05:34:06 -0400
parents 695d61decd06
children 4e2883bb058d
files README.markdown ceas_wrapper.sh ceas_wrapper.xml ceasbw_wrapper.sh ceasbw_wrapper.xml
diffstat 5 files changed, 176 insertions(+), 167 deletions(-) [+]
line wrap: on
line diff
--- a/README.markdown	Tue Apr 21 10:56:47 2015 -0400
+++ b/README.markdown	Wed Apr 22 05:34:06 2015 -0400
@@ -1,18 +1,22 @@
-CEASbw
-======
+CEAS
+====
 
-XML and wrapper script for the Cistrome version of the CEAS package, which can be
-used to annotate intervals and scores with genome features.
+XML and wrapper script for the CEAS package, which can be used to annotate intervals
+and scores with genome features.
 
-In addition to the `ceas` program, the Cistrome version of the package includes the
-`ceasBW` program which can handle
+This tool uses the Cistrome version of the package, which provides two versions of
+the `ceas` program: in addition to the `ceas` program (the same as that available
+from the main CEAS website), it also includes the `ceasBW` program (which can handle
+bigwig input).
 
 The tool assumes that the `ceas` and `ceasBW` programs are on the Galaxy user's
-path. The official CEAS website is at
+path.
+
+The official CEAS website is at:
 
 <http://liulab.dfci.harvard.edu/CEAS/index.html>
 
-the Cistrome version can be found via
+The Cistrome version can be found via
 
 <https://bitbucket.org/cistrome/cistrome-applications-harvard/overview>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ceas_wrapper.sh	Wed Apr 22 05:34:06 2015 -0400
@@ -0,0 +1,90 @@
+#!/bin/sh -e
+#
+# Wrapper script to run CEAS as a Galaxy tool
+#
+# This runs the Cistrome versions of CEAS, which provides two executables:
+# - ceas (same as the "official" version)
+# - ceasBW (modified version that accepts a bigwig file as input)
+#
+# Usage: ceas_wrapper.sh $BED_IN $GDB_IN $EXTRA_BED_IN $LOG_OUT $PDF_OUT $XLS_OUT $DBKEY
+#
+# Process command line
+echo $*
+BED_IN=$1
+GDB_IN=$2
+EXTRA_BED_IN=$3
+LOG_OUT=$4
+PDF_OUT=$5
+XLS_OUT=$6
+#
+# Collect remaining args
+CEAS=ceas
+OPTIONS=
+while [ ! -z "$7" ] ; do
+    if [ "$7" == "--bigwig" ] ; then
+	CEAS=ceasBW
+    fi
+    if [ "$7" == "--length" ] ; then
+	chrom_sizes=$8
+	if [ ! -f "$chrom_sizes" ] ; then
+	    echo "ERROR no file $chrom_sizes" >&2
+	    echo "Please update your Galaxy instance to include this file"
+	    exit 1
+	fi
+    fi
+    OPTIONS="$OPTIONS $7"
+    shift
+done
+#
+# Convenience variables for local files
+base_name="ceas"
+log_file=${base_name}.log
+r_script=${base_name}.R
+pdf_report=${base_name}.pdf
+xls_file=${base_name}.xls
+#
+# Get CEAS version
+echo Running $CEAS
+$CEAS --version >$log_file 2>/dev/null
+#
+# Construct and run CEAS command line
+ceas_cmd="$CEAS --name $base_name $OPTIONS -g $GDB_IN -b $BED_IN"
+if [ "$EXTRA_BED_IN" != "None" ] ; then
+    ceas_cmd="$ceas_cmd -e $EXTRA_BED_IN"
+fi
+echo "Running $ceas_cmd"
+$ceas_cmd >>$log_file 2>&1
+#
+# Move outputs to final destination
+if [ -e $log_file ] ; then
+    echo "Moving $log_file to $LOG_OUT"
+    /bin/mv $log_file $LOG_OUT
+else
+    echo ERROR failed to make log file >&2
+    exit 1
+fi
+if [ -e $xls_file ] ; then
+    echo "Moving $xls_file to $XLS_OUT"
+    /bin/mv $xls_file $XLS_OUT
+else
+    echo ERROR failed to generate XLS file >&2
+    exit 1
+fi
+#
+# Run the R script to generate the PDF report
+if [ -e $r_script ] ; then
+    echo "Running $r_script to generate $pdf_report"
+    R --vanilla < $r_script
+    if [ -e $pdf_report ] ; then
+	echo "Moving $xls_file to $XLS_OUT"
+	/bin/mv $pdf_report $PDF_OUT
+    else
+	echo ERROR failed to generate PDF report >&2
+	exit 1
+    fi
+else
+    echo ERROR no R script to generate PDF report >&2
+    exit 1
+fi
+#
+# Done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ceas_wrapper.xml	Wed Apr 22 05:34:06 2015 -0400
@@ -0,0 +1,74 @@
+<tool id="ceas" name="CEAS" version="1.0.2-1">
+  <requirements>
+    <requirement type="package" version="1.2.5">python_mysqldb</requirement>
+    <requirement type="package" version="0.7.1">bx_python</requirement>
+    <requirement type="package" version="1.0.2.d8c0751">cistrome_ceas</requirement>
+    <requirement type="package" version="3.1.2">R</requirement>
+  </requirements>
+  <description>Annotate intervals and scores with genome features</description>
+  <command interpreter="bash">ceas_wrapper.sh $bed_file $gdb_file $extra_bed_file $log_output $pdf_report $xls_output
+  #if (str($wig_file.ext) == 'bigwig')
+    --bigwig $wig_file
+    --length $GALAXY_DATA_INDEX_DIR/shared/ucsc/chrom/${bed_file.dbkey}.len
+  # else
+    --wig $wig_file
+  #end if
+  #if (str($span) and int(str($span)) > 0)
+    --span $span
+  #end if
+  --sizes $sizes_lower,$sizes_middle,$sizes_upper
+  --bisizes $bisizes_lower,$bisizes_upper
+  --pf-res $profiling_resolution
+  --rel-dist $relative_distance</command>
+  <inputs>
+    <param name="bed_file" type="data" format="bed" label="BED file with ChIP regions" />
+    <param name="wig_file" type="data" format="wig,bigwig" label="WIG or BIGWIG file for wig profiling or genome background annotation" optional="true" />
+    <param name="extra_bed_file" type="data" format="bed" label="BED file with extra regions of interest (e.g. non-coding regions)" optional="true" />
+    <param name="gdb_file" type="select" label="Gene annotation table">
+      <options from_data_table="ceas_annotations">
+	<filter name="dbkey" type="data_meta" ref="bed_file" key="dbkey" column="0" />
+        <validator type="no_options" message="No tables are available for the selected input"/>
+      </options>
+    </param>
+    <param name="span" type="integer" label="Span from TSS and TTS in the gene-centered annotation (bp)" help="ChIP regions within this range from TSS and TTS are considered when calculating the coverage rates of promoter and downstream by ChIP regions" value="3000" />
+    <param name="sizes_lower" type="integer" label="Lower interval for promoter/downstream sizes for ChIP region annotation (bp)" value="1000" />
+    <param name="sizes_middle" type="integer" label="Middle interval for promoter/downstream sizes (bp)" value="2000" help="Values > 10000bp are automatically fixed to 10000bp" />
+    <param name="sizes_upper" type="integer" label="Upper interval for promoter/downstream sizes (bp)" value="3000" help="Values > 10000bp are automatically fixed to 10000bp" />
+    <param name="bisizes_lower" type="integer" label="Lower interval for bidirectional-promoter sizes for ChIP region annotation (bp)" value="2500" />
+    <param name="bisizes_upper" type="integer" label="Upper interval for bidirectional-promoter sizes (bp)" value="5000" help="Values > 20000bp are automatically fixed to 20000bp" />
+    <param name="profiling_resolution" type="integer" label="Wig profiling resolution (bp)" value="50" help="Warning: a number smaller than the wig interval (resolution) may cause aliasing error" />
+    <param name="relative_distance" type="integer" label="Relative distance to TSS/TTS in wig profiling (bp)" value="3000" />
+  </inputs>
+  <outputs>
+    <data name="log_output" format="txt" label="CEAS on ${on_string} (log output)" />
+    <data name="pdf_report" format="pdf" label="CEAS on ${on_string} (PDF report)" />
+    <data name="xls_output" format="interval" label="CEAS on ${on_string} (XLS output)" />
+  </outputs>
+  <help>
+**What it does**
+
+CEAS (Cis-regulatory Element Annotation System) is a tool for characterizing genome-wide
+protein-DNA interaction patterns from ChIP-chip and ChIP-Seq of both sharp and broad
+binding factors. It provides statistics on ChIP enrichment at important genome features
+such as specific chromosome, promoters, gene bodies, or exons, and infers genes most
+likely to be regulated by a binding factor.
+
+CEAS also enables biologists to visualize the average ChIP enrichment signals over
+specific genomic features, allowing continuous and broad ChIP enrichment to be perceived
+which might be too subtle to detect from ChIP peaks alone.
+
+This tool is compatible with the ceasBW version of CEAS from the Cistrome package
+obtained from
+
+https://bitbucket.org/cistrome/cistrome-applications-harvard/overview
+
+(commit id d8c0751, datestamp 20140929). The CEAS code is under the
+published-packages/CEAS/ subdirectory.
+
+Cistrome data files and documentation can be found at
+
+http://liulab.dfci.harvard.edu/CEAS/index.html
+
+The CEAS user manual is available at http://liulab.dfci.harvard.edu/CEAS/usermanual.html
+  </help>
+</tool>
--- a/ceasbw_wrapper.sh	Tue Apr 21 10:56:47 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#!/bin/sh -e
-#
-# Wrapper script to run CEASbw as a Galaxy tool
-#
-# Usage: ceasbw_wrapper.sh $BED_IN $GDB_IN $EXTRA_BED_IN $LOG_OUT $PDF_OUT $XLS_OUT $DBKEY
-#
-# Process command line
-echo $*
-BED_IN=$1
-GDB_IN=$2
-EXTRA_BED_IN=$3
-LOG_OUT=$4
-PDF_OUT=$5
-XLS_OUT=$6
-#
-# Collect remaining args
-CEAS=ceas
-OPTIONS=
-while [ ! -z "$7" ] ; do
-    if [ "$7" == "--bigwig" ] ; then
-	CEAS=ceasBW
-    fi
-    if [ "$7" == "--length" ] ; then
-	chrom_sizes=$8
-	if [ ! -f "$chrom_sizes" ] ; then
-	    echo "ERROR no file $chrom_sizes, stopping" >&2
-	    exit 1
-	fi
-    fi
-    OPTIONS="$OPTIONS $7"
-    shift
-done
-#
-# Convenience variables for local files
-base_name="ceas"
-log_file=${base_name}.log
-r_script=${base_name}.R
-pdf_report=${base_name}.pdf
-xls_file=${base_name}.xls
-#
-# Get CEAS version
-echo Running $CEAS
-$CEAS --version >$log_file 2>/dev/null
-#
-# Construct and run CEAS command line
-ceas_cmd="$CEAS --name $base_name $OPTIONS -g $GDB_IN -b $BED_IN"
-if [ "$EXTRA_BED_IN" != "None" ] ; then
-    ceas_cmd="$ceas_cmd -e $EXTRA_BED_IN"
-fi
-echo "Running $ceas_cmd"
-$ceas_cmd >>$log_file 2>&1
-#
-# Move outputs to final destination
-if [ -e $log_file ] ; then
-    echo "Moving $log_file to $LOG_OUT"
-    /bin/mv $log_file $LOG_OUT
-else
-    echo ERROR failed to make log file >&2
-    exit 1
-fi
-if [ -e $xls_file ] ; then
-    echo "Moving $xls_file to $XLS_OUT"
-    /bin/mv $xls_file $XLS_OUT
-else
-    echo ERROR failed to generate XLS file >&2
-    exit 1
-fi
-#
-# Run the R script to generate the PDF report
-if [ -e $r_script ] ; then
-    echo "Running $r_script to generate $pdf_report"
-    R --vanilla < $r_script
-    if [ -e $pdf_report ] ; then
-	echo "Moving $xls_file to $XLS_OUT"
-	/bin/mv $pdf_report $PDF_OUT
-    else
-	echo ERROR failed to generate PDF report >&2
-	exit 1
-    fi
-else
-    echo ERROR no R script to generate PDF report >&2
-    exit 1
-fi
-#
-# Done
--- a/ceasbw_wrapper.xml	Tue Apr 21 10:56:47 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-<tool id="ceasbw" name="CEAS" version="1.0.2-0">
-  <requirements>
-    <requirement type="package" version="1.2.5">python_mysqldb</requirement>
-    <requirement type="package" version="0.7.1">bx_python</requirement>
-    <requirement type="package" version="1.0.2.d8c0751">cistrome_ceas</requirement>
-    <requirement type="package" version="3.1.2">R</requirement>
-  </requirements>
-  <description>Annotate intervals and scores with genome features (cistrome CEAS)</description>
-  <command interpreter="bash">ceasbw_wrapper.sh $bed_file $gdb_file $extra_bed_file $log_output $pdf_report $xls_output
-  #if (str($wig_file.ext) == 'bigwig')
-    --bigwig $wig_file
-    --length $GALAXY_DATA_INDEX_DIR/shared/ucsc/chrom/${bed_file.dbkey}.len
-  # else
-    --wig $wig_file
-  #end if
-  #if (str($span) and int(str($span)) > 0)
-    --span $span
-  #end if
-  --sizes $sizes_lower,$sizes_middle,$sizes_upper
-  --bisizes $bisizes_lower,$bisizes_upper
-  --pf-res $profiling_resolution
-  --rel-dist $relative_distance</command>
-  <inputs>
-    <param name="bed_file" type="data" format="bed" label="BED file with ChIP regions" />
-    <param name="wig_file" type="data" format="wig,bigwig" label="WIG or BIGWIG file for wig profiling or genome background annotation" optional="true" />
-    <param name="extra_bed_file" type="data" format="bed" label="BED file with extra regions of interest (e.g. non-coding regions)" optional="true" />
-    <param name="gdb_file" type="select" label="Gene annotation table">
-      <options from_data_table="ceas_annotations">
-	<filter name="dbkey" type="data_meta" ref="bed_file" key="dbkey" column="0" />
-        <validator type="no_options" message="No tables are available for the selected input"/>
-      </options>
-    </param>
-    <param name="span" type="integer" label="Span from TSS and TTS in the gene-centered annotation (bp)" help="ChIP regions within this range from TSS and TTS are considered when calculating the coverage rates of promoter and downstream by ChIP regions" value="3000" />
-    <param name="sizes_lower" type="integer" label="Lower interval for promoter/downstream sizes for ChIP region annotation (bp)" value="1000" />
-    <param name="sizes_middle" type="integer" label="Middle interval for promoter/downstream sizes (bp)" value="2000" help="Values > 10000bp are automatically fixed to 10000bp" />
-    <param name="sizes_upper" type="integer" label="Upper interval for promoter/downstream sizes (bp)" value="3000" help="Values > 10000bp are automatically fixed to 10000bp" />
-    <param name="bisizes_lower" type="integer" label="Lower interval for bidirectional-promoter sizes for ChIP region annotation (bp)" value="2500" />
-    <param name="bisizes_upper" type="integer" label="Upper interval for bidirectional-promoter sizes (bp)" value="5000" help="Values > 20000bp are automatically fixed to 20000bp" />
-    <param name="profiling_resolution" type="integer" label="Wig profiling resolution (bp)" value="50" help="Warning: a number smaller than the wig interval (resolution) may cause aliasing error" />
-    <param name="relative_distance" type="integer" label="Relative distance to TSS/TTS in wig profiling (bp)" value="3000" />
-  </inputs>
-  <outputs>
-    <data name="log_output" format="txt" label="CEAS on ${on_string} (log output)" />
-    <data name="pdf_report" format="pdf" label="CEAS on ${on_string} (PDF report)" />
-    <data name="xls_output" format="interval" label="CEAS on ${on_string} (XLS output)" />
-  </outputs>
-  <help>
-**What it does**
-
-CEAS (Cis-regulatory Element Annotation System) is a tool for characterizing genome-wide
-protein-DNA interaction patterns from ChIP-chip and ChIP-Seq of both sharp and broad
-binding factors. It provides statistics on ChIP enrichment at important genome features
-such as specific chromosome, promoters, gene bodies, or exons, and infers genes most
-likely to be regulated by a binding factor.
-
-CEAS also enables biologists to visualize the average ChIP enrichment signals over
-specific genomic features, allowing continuous and broad ChIP enrichment to be perceived
-which might be too subtle to detect from ChIP peaks alone.
-
-This tool is compatible with the ceasBW version of CEAS from the Cistrome package
-obtained from
-
-https://bitbucket.org/cistrome/cistrome-applications-harvard/overview
-
-(commit id d8c0751, datestamp 20140929). The CEAS code is under the
-published-packages/CEAS/ subdirectory.
-
-Cistrome data files and documentation can be found at
-
-http://liulab.dfci.harvard.edu/CEAS/index.html
-
-The CEAS user manual is available at http://liulab.dfci.harvard.edu/CEAS/usermanual.html
-  </help>
-</tool>