diff spp_wrapper.xml @ 0:d4236b60701f draft default tip

planemo upload for repository https://github.com/eba2016/spp_tool commit 2fb169b136aea9887da7ab9fdccc442443f8efa3-dirty
author gandres
date Wed, 25 May 2016 11:52:21 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spp_wrapper.xml	Wed May 25 11:52:21 2016 -0400
@@ -0,0 +1,256 @@
+<tool id="modencode_peakcalling_spp" name="SPP" version="1.13.0">
+  <description>SPP cross-correlation analysis package</description>
+  <requirements>
+    <requirement type="set_environment">SCRIPT_PATH</requirement>
+    <requirement type="package" version="1.13">spp</requirement>
+  </requirements>
+  <command>python $__tool_directory__/spp_wrapper.py $options_file $output_narrow_peak $output_region_peak $output_peakshift_file $output_rdata_file $output_plot_file $output_default_file \$SCRIPT_PATH</command>
+  <configfiles>
+    <configfile name="options_file">&lt;%
+import simplejson
+%&gt;
+#set $__options ={ 'experiment_name':str($experiment_name), 'chip_file':str($major_command.input_chipseq_file1) }
+
+#if str( $major_command.input_control_file1 ) != 'None':
+	#set $__options['input_file'] = str( $major_command.input_control_file1 )
+#end if
+
+##=============================================================================
+#if str($major_command.major_command_selector) == 'cross_correlation':
+	#set $__options['action'] = str( "cross_correlation" )
+
+	#set $__options['out'] = str( $major_command.save_peakshift_file )
+	#set $__options['savp'] = str( $major_command.save_plot_file ) 
+#end if
+##=============================================================================
+#if str($major_command.major_command_selector) == 'peak_calling':
+	#set $__options['action'] = str( "peak_calling" )
+	#set $__options['fdr'] = str( $major_command.fdr )
+	#set $__options['npeak'] = str( $major_command.num_peaks )	
+
+	#set $__options['savr'] = str( $major_command.save_regionpeak_file )
+	#set $__options['savd'] = str( $major_command.save_rdata_file )
+	#set $__options['savn'] = str( $major_command.save_narrowpeak_file )
+	#set $__options['savp'] = str( $major_command.save_plot_file )
+#end if
+##=============================================================================
+#if str($major_command.major_command_selector) == 'idr':
+	#set $__options['action'] = str( "idr" ) 
+	#set $__options['npeak'] = int( $major_command.num_peaks  )
+
+	#set $__options['savr'] = str( $major_command.save_regionpeak_file )
+	#set $__options['out'] = str( $major_command.save_peakshift_file )
+	#set $__options['savp'] = str( $major_command.save_plot_file )
+#end if
+##=============================================================================
+#if str($major_command.major_command_selector) == 'custom':
+	#set $__options['action'] = str( "custom" )
+        #set $__options['s'] = str( $major_command.strand_shift )
+        #set $__options['x'] = str( $major_command.excluded_strand_shift  )
+        #set $__options['npeak'] = int( $major_command.num_peaks )
+        #set $__options['fdr'] = int( $major_command.fdr  )
+
+	#if str($major_command.user_defined_strpeak) == '':
+        	#set $__options['speak'] = str( $major_command.user_defined_strpeak )
+	#else:
+	       	#set $__options['speak'] = "-speak=$major_command.user_defined_strpeak"
+	#end if 
+
+	#if str($major_command.filter_char) == '':
+ 	       #set $__options['filtchr'] = str( $major_command.filter_char )
+	#else:
+ 	       #set $__options['filtchr'] = "-filtchr=$major_command.filter_char"
+	#end if	
+
+	#set $__options['out'] = str( $major_command.save_peakshift_file )
+        #set $__options['savr'] = str( $major_command.save_regionpeak_file )
+        #set $__options['savd'] = str( $major_command.save_rdata_file )
+        #set $__options['savn'] = str( $major_command.save_narrowpeak_file )
+        #set $__options['savp'] = str( $major_command.save_plot_file ) 
+#end if
+
+${ simplejson.dumps( __options ) }
+    </configfile>
+  </configfiles>
+
+  <inputs>
+    <!--experiment name and inputs-->
+    <param name="experiment_name" type="text" value="SPP in Galaxy" size="50" label="Experiment Name"/>
+    
+    <!--select function to perform-->
+    <conditional name="major_command">
+      <param name="major_command_selector" type="select" label="Select action to be performed">
+	<option value="cross_correlation">Determine strand cross-correlation peak</option>
+	<option value="peak_calling">Peak calling</option>
+	<option value="idr">IDR analysis</option>
+	<option value="custom">Custom settings</option>
+      </param>
+      <when value="cross_correlation">
+	<!--cross correlation options-->
+    	<param name="input_chipseq_file1" type="data" format="bam" label="ChIP-Seq Tag File" />
+    	<param name="input_control_file1" type="data" format="bam" optional="True" label="ChIP-Seq Control File" />
+
+
+	<param name="save_peakshift_file" truevalue="-out=peakshift.txt" falsevalue="" type="boolean" checked="True" label="Save peakshift file" help="(-out)"/>
+	<param name="save_plot_file" truevalue="-savp" falsevalue="" type="boolean" checked="True" label="Save plot file" help="(-savp)"/>
+      </when>
+      <when value="peak_calling">
+	<!--peak calling options-->
+	<param name="input_chipseq_file1" type="data" format="bam" label="ChIP-Seq Tag File" />
+	<param name="input_control_file1" type="data" format="bam" label="ChIP-Seq Control File" />
+
+	<param name="fdr" type="text" label="False discovery rate threshold" value="0" help="default=0 (-fdr)"/>
+	<param name="num_peaks" type="text" label="Threshold on number of peaks to call" value="0" help="default=0 (-npeak)"/>
+
+	<param name="save_regionpeak_file" truevalue="-savr" falsevalue="" type="boolean" checked="True" label="Save regionpeak file " help="(-savr)"/>   
+	<param name="save_rdata_file" truevalue="-savd" falsevalue="" type="boolean" checked="True" label="Save Rdata file" help="(-savd)"/>
+	<param name="save_narrowpeak_file" truevalue="-savn" falsevalue="" type="boolean" checked="True" label="Save narrowpeak file" help="(-savn)"/>
+	<param name="save_plot_file" truevalue="-savp" falsevalue="" type="boolean" checked="True" label="Save plot file" help="(-savp)"/>
+      </when>
+      <when value="idr">
+	<!--idr options-->
+    	<param name="input_chipseq_file1" type="data" format="bam" label="ChIP-Seq Tag File" />
+    	<param name="input_control_file1" type="data" format="bam" label="ChIP-Seq Control File" />
+	
+	<param name="num_peaks" type="integer" label="Threshold on number of peaks to call" value="300000" help="default=300000 (-npeak)"/>
+
+	<param name="save_regionpeak_file" truevalue="-savr" falsevalue="" type="boolean" checked="True" label="Save regionpeak file" help="(-savr)"/>   
+	<param name="save_peakshift_file" truevalue="-out=peakshift.txt" falsevalue="" type="boolean" checked="True" label="Save peakshift file" help="(-out)"/>
+	<param name="save_plot_file" truevalue="-savp" falsevalue="" type="boolean" checked="True" label="Save plot file" help="(-savp)"/>
+      </when> 
+      <when value="custom">
+	<!--custom settings, includes all relevant options here-->
+    	<param name="input_chipseq_file1" type="data" format="bam" label="ChIP-Seq Tag File" />
+    	<param name="input_control_file1" type="data" format="bam" optional="True" label="ChIP-Seq Control File" />
+
+	<param name="strand_shift" type="text" label="Strand shifts at which cross-correlation is evaluated" size="30" value="-100:5:600" help="default=-100:5:600 (-s)"/>
+	<param name="excluded_strand_shift" type="text" label="Strand shifts to exclude" value="10:10" help="default=10:(readlen+10) (-x)"/>
+	<param name="user_defined_strpeak" type="text" label="User defined cross-correlation peak strand shift" help="(-speak)"/>
+	<param name="num_peaks" type="integer" label="Threshold on number of peaks to call" value="0" help="default=0 (-npeak)"/>
+	<param name="fdr" type="integer" label="False discovery rate threshold" value="0" help="default=0 (-fdr)"/>
+	<param name="filter_char" type="text" label="Pattern to use to remove tags that map to specific chromosomes" help="(-filtchr)"/>
+
+	<param name="save_regionpeak_file" truevalue="-savr" falsevalue="" type="boolean" checked="False" label="Save regionpeak file" help="(-savr)"/>   
+	<param name="save_peakshift_file" truevalue="-out=peakshift.txt" falsevalue="" type="boolean" checked="False" label="Save peakshift file" help="(-out)"/>
+	<param name="save_rdata_file" truevalue="-savd" falsevalue="" type="boolean" checked="False" label="Save Rdata file" help="(-savd)"/>
+	<param name="save_narrowpeak_file" truevalue="-savn" falsevalue="" type="boolean" checked="False" label="Save narrowpeak file" help="(-savn)"/>
+	<param name="save_plot_file" truevalue="-savp" falsevalue="" type="boolean" checked="False" label="Save plot file" help="(-savp)"/>
+      </when>
+    </conditional>
+  </inputs>
+
+  <outputs>
+    <data name="output_default_file" format="txt" label="${tool.name}-${major_command.major_command_selector} on ${on_string}"/>
+    <data name="output_narrow_peak" format="txt" label="${tool.name}-${major_command.major_command_selector} on ${on_string} (narrowpeaks)">
+	<filter>major_command['save_narrowpeak_file'] is True</filter>
+	<filter>major_command['major_command_selector'] == 'peak_calling' or major_command['major_command_selector'] == 'custom'</filter> 
+    </data>
+    <data name="output_plot_file" format="pdf" label="${tool.name}-${major_command.major_command_selector} on ${on_string} (plot)">
+	<filter>major_command['save_plot_file'] is True</filter>
+    </data>
+    <data name="output_region_peak" format="txt" label="${tool.name}-${major_command.major_command_selector} on ${on_string} (regionpeaks)">
+	<filter>major_command['save_regionpeak_file'] is True</filter>
+    	<filter>major_command['major_command_selector'] == 'peak_calling' or major_command['major_command_selector'] == 'custom' or major_command['major_command_selector'] == 'idr' </filter> 
+    </data>
+    <data name="output_peakshift_file" format="txt" label="${tool.name}-${major_command.major_command_selector} on ${on_string} (peakshift/phantompeak)">
+	<filter>major_command['save_peakshift_file'] is True</filter>
+    	<filter>major_command['major_command_selector'] == 'cross_correlation' or major_command['major_command_selector'] == 'custom' or major_command['major_command_selector'] == 'idr' </filter> 
+    </data>
+    <data name="output_rdata_file" format="txt" label="${tool.name}-${major_command.major_command_selector} on ${on_string} (Rdata)">
+	<filter>major_command['save_rdata_file'] is True</filter>
+	<filter>major_command['major_command_selector'] == 'peak_calling' or major_command['major_command_selector'] == 'custom' </filter> 
+    </data>
+  </outputs>
+
+  <tests>
+	<!--none yet for spp-->
+	<test>
+		<param name="major_command_selector" value="cross_correlation"/>
+		<param name="input_chipseq_file1" value="tag_file.bam"/>
+		<param name="input_control_file1" value="control_file.bam"/>
+		<output name="output_peakshift_file">
+			<assert_contents>
+				<has_line_matching expression="^.*\t192996\t100\t0.552186886771392\t45\t0.4766414\t600\t0.1428672\t3.865035\t1.226337\t1$" />
+				<has_n_columns n="11" />
+			</assert_contents>
+		</output>
+		<output name="output_default_file">
+			<assert_contents>
+				<has_line line="done. read 192996 fragments" />
+				<has_line line="ChIP data read length 37 " />
+				<has_line line="Minimum cross-correlation value 0.1428672 " />
+				<has_line line="Peak cross-correlation value 0.552186886771392 " />
+				<has_line line="Peak strand shift 100 " />
+				<has_line line="Window half size 260 " />
+				<has_line line="Phantom peak location 45 " />
+				<has_line line="Phantom peak Correlation 0.4766414 " />
+				<has_line line="Normalized cross-correlation coefficient (NCCC) 3.865035 " />
+				<has_line line="Relative Cross correlation Coefficient (RCCC) 1.226337 " />
+				<has_line line="Phantom Peak Quality Tag 1 " />
+			</assert_contents>
+		</output>
+	</test>
+	<test>
+                <param name="major_command_selector" value="cross_correlation"/>
+                <param name="input_chipseq_file1" value="tag_file.bam"/>
+                <output name="output_peakshift_file">
+	                <assert_contents>
+		                <has_line_matching expression="^.*\t192996\t100\t0.552186886771392\t45\t0.4766414\t600\t0.1428672\t3.865035\t1.226337\t1$" />
+	                        <has_n_columns n="11" />
+	                </assert_contents>
+	        </output>
+	</test>
+  </tests>
+  <help>
+**What it does**
+
+This tool allows ChIP-seq peak calling using SPP
+
+This set of programs operate on mapped Illumina single-end read datasets in tagAlign or BAM format.
+
+View the modified SPP documentation: http://code.google.com/p/phantompeakqualtools/
+
+------
+
+**Usage**
+
+**Determine strand cross-correlation peak**: Compute the predominant insert-size (fragment length) based on strand cross-correlation peak.
+
+**Peak calling**: Call Peaks and regions for punctate binding datasets.
+
+**IDR analysis**: Compute Data quality measures based on relative phantom peak.
+
+**Custom settings**: Enables all options available to SPP for custom analysis. 
+
+------
+
+**Output**
+
+
+The column names of narrow- and region-peaks datasets (produced by **Peak calling**) are provided below:
+
+- col 1: chrom
+- col 2: start
+- col 3: end
+- col 4: name
+- col 5: score
+- col 6: strand
+- col 7: signalValue
+- col 8 : -1
+- col 9: -log10(fdr)
+- col 10: Point-source called for this peak.
+
+------
+
+
+**Citation**
+
+Anshul Kundaje, Computer Science Dept., Stanford University, ENCODE Consortium, Personal Communication, Oct 2010
+Kharchenko PK, Tolstorukov MY, Park PJ, Design and analysis of ChIP-seq experiments for DNA-binding proteins Nat Biotechnol. 2008 Dec;26(12):1351-9
+
+Integration of SPP with Galaxy performed by Ziru Zhou ( ziruzhou@gmail.com ). Please send your comments/questions to help@modencode.org.
+  </help>
+  <citations>
+  	<citation type="doi">doi:10.1038/nbt.1508</citation>
+  </citations>
+</tool>