changeset 2:028fafca04fa draft default tip

"planemo upload commit 9e4d2776d6b3276e2849943439799b82d989bc3b"
author iuc
date Sun, 22 Dec 2019 12:11:33 -0500
parents 7e0a12282c7f
children
files .shed.yml macros.xml multigps.xml test-data/hg19_all_events_table1.tabular test-data/hg19_all_events_table2.tabular test-data/hg19_output_bed1.bed test-data/hg19_output_bed2.bed test-data/hg19_output_html1.html test-data/hg19_output_html2.html test-data/hg19_replicates_counts1.tabular test-data/hg19_replicates_counts2.tabular tool-data/hg19.len
diffstat 12 files changed, 171 insertions(+), 71 deletions(-) [+]
line wrap: on
line diff
--- a/.shed.yml	Tue Mar 28 12:24:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-name: multigps
-owner: iuc
-description: Analyzes collections of multi-condition ChIP-seq data.
-homepage_url: http://mahonylab.org/software/multigps/
-long_description: |
-  Contains a tool that runs MultiGPS, a framework for analyzing collections of multi-condition ChIP-seq
-  datasets and characterizing differential binding events between conditions.  MultiGPS encourages consistency
-  in the reported binding event locations across conditions and provides accurate estimation of ChIP enrichment
-  levels at each event.  MultiGPS loads all data to memory, so you will need a lot of available memory if you
-  are running analysis over many conditions or large datasets.
-type: unrestricted
-categories:
-- ChIP-seq
--- a/macros.xml	Tue Mar 28 12:24:56 2017 -0400
+++ b/macros.xml	Sun Dec 22 12:11:33 2019 -0500
@@ -1,8 +1,33 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <macros>
+    <xml name="cond_fixedreadcount">
+        <conditional name="fixedreadcount_cond">
+            <param  name="fixedreadcount_select" type="select" label="Set fixed per-base read count limit for this replicate?" help="Selecting No uses a global per-base limit that is estimated from a Poisson distribution.">
+                <option value="no" selected="True">No</option>
+                <option value="yes">Yes</option>
+            </param>
+            <when value="no"/>
+            <when value="yes">
+                <param name="fixedreadcount" type="integer" value="0" min="0" label="Fixed per-base read count limit"/>
+            </when>
+        </conditional>
+    </xml>
+    <xml name="param_experiment_type">
+        <param name="experiment_type" type="select" display="radio" label="Experiment type for this replicate">
+            <option value="chipseq" selected="True">ChIP-seq</option>
+            <option value="chipexo">ChIP-exo</option>
+        </param>
+    </xml>
     <xml name="motif_finding_params">
         <param name="memenmotifs" type="integer" min="0" value="3" label="Number of motifs MEME should find for each condition" />
         <param name="mememinw" type="integer" min="0" value="6" label="Minimum motif width for MEME" />
         <param name="mememaxw" type="integer" min="0" value="16" label="Maximum motif width for MEME" />
     </xml>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="1">fonts-conda-ecosystem</requirement>
+            <requirement type="package" version="0.74">multigps</requirement>
+            <yield/>
+        </requirements>
+    </xml>
 </macros>
--- a/multigps.xml	Tue Mar 28 12:24:56 2017 -0400
+++ b/multigps.xml	Sun Dec 22 12:11:33 2019 -0500
@@ -1,31 +1,28 @@
-<tool id="multigps" name="MultiGPS" version="0.73.0">
+<tool id="multigps" name="MultiGPS" version="0.74.0">
     <description>analyzes collections of multi-condition ChIP-seq data</description>
     <macros>
         <import>macros.xml</import>
     </macros>
-    <requirements>
-        <requirement type="package" version="0.73">multigps</requirement>
-    </requirements>
+    <expand macro="requirements" />
     <command detect_errors="aggressive">
         <![CDATA[
             #set output_dir = $output_html.files_path
             mkdir -p $output_dir &&
             multigps
             ## General options
+            --design '$build_design_file'
             ## Append .txt extensions to events hrefs
             ## in output dataset so files will render
             ## in the browser.
             --eventsaretxt
-            ## Do not run the parallel version of meme
-            ## since it is not yet available in conda.
+            ## Do not run the parallel version of meme.
             --meme1proc
-            --expt '$expt'
-            --format $expt.ext
-            #if str($ctrl) != 'None':
-                --ctrl '$ctrl'
+            --threads \${GALAXY_SLOTS:-4}
+            #if str($in_test_mode) == "no":
+                --geninfo '$chromInfo'
+            #else:
+                --geninfo '$__tool_directory__/tool-data/hg19.len'
             #end if
-            --threads \${GALAXY_SLOTS:-4}
-            --geninfo '$chromInfo'
             ## Advanced options
             #set aoc = $advanced_options_cond
             #if str($aoc.advanced_options) == 'display':
@@ -39,9 +36,9 @@
                     #set rgc = $umc.reference_genome_cond
                     --seq
                     #if str($rgc.reference_genome_source) == 'cached':
-		        '${rgc.reference_genome.fields.path}'
+                        '${rgc.reference_genome.fields.path}'
                     #else:
-		        '${rgc.reference_genome}'
+                        '${rgc.reference_genome}'
                     #end if
                 #end if
                 ## Limits on how many reads
@@ -80,9 +77,9 @@
                 #end if
                 ## Running MultiGPS
                 #if str($aoc.readdistributionfile) != 'None':
-                    --d '$aoc.readdistributionfile'
+                    --readdistributionfile '$aoc.readdistributionfile'
                 #end if
-                --r $aoc.maxtrainingrounds
+                --maxtrainingrounds $aoc.maxtrainingrounds
                 #if str($aoc.nomodelupdate) == 'no':
                     --nomodelupdate
                 #end if
@@ -127,20 +124,20 @@
                             --mememinw $bmc.mememinw
                             --mememaxw $bmc.mememaxw
                         #else:
-                            #set mfoc = $bmc.nomotifprior_cond
+                            #set nmpc = $bmc.nomotifprior_cond
                             --nomotifs
-                            --nomotifprior $mfoc.nomotifprior
-                            #if str($mfoc.nomotifprior) == 'yes':
-                                --memenmotifs $mfoc.memenmotifs
-                                --mememinw $mfoc.mememinw
-                                --mememaxw $mfoc.mememaxw
+                            #if str($nmpc.nomotifprior) == 'yes':
+                                --nomotifprior
+                                --memenmotifs $nmpc.memenmotifs
+                                --mememinw $nmpc.mememinw
+                                --mememaxw $nmpc.mememaxw
                             #end if
                         #end if
                     #end if
                 #end if
                 ## Reporting binding events
                 #if str($rbec.report_binding_events) == 'yes':
-                    --q $rbec.minqvalue
+                    --minqvalue $rbec.minqvalue
                     --minfold $rbec.minfold
                     #if str($rbec.nodifftests) == 'no':
                         --nodifftests
@@ -151,17 +148,76 @@
             #end if
             2>&1
             --out '$output_html.files_path'
-            && cp $output_dir/*.events.txt '$experiment_events'
+            #if str($save_design_file) == 'yes':
+                && cp '$build_design_file' '$output_design_file'
+            #end if
+            && mv $output_dir/*.counts '$replicates_counts'
+            && mv $output_dir/*.bed '$output_bed'
             && mv $output_dir/*.html '$output_html'
             && mv $output_dir/*.table.txt '$all_events_table'
-            && mv $output_dir/*.counts '$replicates_counts'
         ]]>
     </command>
+    <configfiles>
+        <configfile name="build_design_file"><![CDATA[#for $condition_items in $condition_repeat:
+    #for $signal_items in $condition_items.signal_repeat:
+        #if str($signal_items.fixedreadcount_cond.fixedreadcount_select) == 'yes':
+            #set $frc = $signal_items.fixedreadcount_cond.fixedreadcount
+        #else:
+            #set $frc = ''
+        #end if
+${signal_items.signal}	Signal	${signal_items.signal.ext.upper()}	${condition_items.condition_name}	${signal_items.replicate_name}	${condition_items.experiment_type}	${frc}
+    #end for
+    #for $control_items in $condition_items.control_repeat:
+        #if str($control_items.specify_replicate_name_cond.specify_replicate_name) == 'yes':
+            #set $rn = $control_items.specify_replicate_name_cond.replicate_name
+        #else:
+            #set $rn = ''
+        #end if
+        #if str($control_items.fixedreadcount_cond.fixedreadcount_select) == 'yes':
+            #set $frc = $control_items.fixedreadcount_cond.fixedreadcount
+        #else:
+            #set $frc = ''
+        #end if
+${control_items.control}	Control	${control_items.control.ext.upper()}	${condition_items.condition_name}	${rn}	${condition_items.experiment_type}	${frc}
+    #end for
+#end for ]]></configfile>
+    </configfiles>
     <inputs>
-        <param name="expt" type="data" format="bam,bed,scidx" label="Run MultiGPS on">
-            <validator type="unspecified_build" />
+        <repeat name="condition_repeat" title="Condition" min="1">
+            <param name="condition_name" type="text" value="cond" label="Condition name">
+                <validator type="empty_field" />
+            </param>
+            <expand macro="param_experiment_type" />
+            <repeat name="signal_repeat" title="Signal" min="1">
+                <param name="signal" type="data" format="bam,bed,scidx" label="Select signal" help="Supported formats are bam, bed and scidx">
+                    <validator type="unspecified_build" />
+                </param>
+                <param name="replicate_name" type="text" value="1" label="Replicate name">
+                    <validator type="empty_field" />
+                </param>
+                <expand macro="cond_fixedreadcount" />
+            </repeat>
+            <repeat name="control_repeat" title="Control" min="0">
+                <param name="control" type="data" format="bam,bed,scidx" label="Select control" help="Optional, supported formats are bam, bed and scidx">
+                    <validator type="unspecified_build" />
+                </param>
+                <conditional name="specify_replicate_name_cond">
+                    <param  name="specify_replicate_name" type="select" label="Specify replicate name?" help="Optional for control.  If used, the control will only be used for the corresponding named signal replicate">
+                        <option value="no" selected="True">No</option>
+                        <option value="yes">Yes</option>
+                    </param>
+                    <when value="yes">
+                        <param name="replicate_name" type="text" optional="true" label="Replicate name"/>
+                    </when>
+                    <when value="no" />
+                </conditional>
+                <expand macro="cond_fixedreadcount" />
+            </repeat>
+        </repeat>
+        <param name="save_design_file" type="select" display="radio" label="Output design file?">
+            <option value="no" selected="true">No</option>
+            <option value="yes">Yes</option>
         </param>
-        <param name="ctrl" type="data" format="bam,bed,scidx" optional="True" label="Optional file containing reads from a control experiment" help="Must be same forat as the input above" />
         <!-- Advanced options -->
         <conditional name="advanced_options_cond">
             <param name="advanced_options" type="select" label="Advanced options">
@@ -192,7 +248,7 @@
                 </conditional>
                 <!-- Scaling data -->
                 <conditional name="scale_data_cond">
-                    <param  name="scale_data" type="select" label="Set data scaling parameters?" help="Default behavior is to scale signal to corresponding controls using regression on the set of signal/control ratios in 10Kbp windows.">
+                    <param  name="scale_data" type="select" label="Set data scaling parameters?" help="Default behavior is to scale signal to corresponding controls using the Normalization of ChIP-seq (NCIS) method.[2]">
                         <option value="no" selected="True">No</option>
                         <option value="yes">Yes</option>
                     </param>
@@ -282,7 +338,7 @@
                             <when value="cached">
                                 <param name="reference_genome" type="select" label="Using reference genome">
                                     <options from_data_table="all_fasta">
-                                        <filter type="data_meta" key="dbkey" ref="expt" column="1"/>
+                                        <!-- <filter type="data_meta" key="dbkey" ref="expt" column="1"/> does not yet work in a repeat...-->
                                     </options>
                                     <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
                                 </param>
@@ -290,7 +346,7 @@
                             <when value="history">
                                 <param name="reference_genome" type="data" format="fasta" label="Using reference genome">
                                     <options>
-                                        <filter type="data_meta" key="dbkey" ref="expt"/>
+                                        <!-- <filter type="data_meta" key="dbkey" ref="expt"/> does not yet work in a repeat...-->
                                     </options>
                                     <validator type="no_options" message="The current history does not include a fasta dataset with the build associated with the selected input file"/>
                                 </param>
@@ -356,28 +412,45 @@
             </when>
             <when value="hide" />
         </conditional>
+        <!-- Functional testing -->
+        <param name="in_test_mode" type="hidden" value="no" />
     </inputs>
     <outputs>
-        <data name="replicates_counts" format="tabular" label="${tool.name} replicates counts on ${on_string}"/>
-        <data name="all_events_table" format="tabular" label="${tool.name} all events table on ${on_string}"/>
-        <data name="experiment_events" format="tabular" label="${tool.name} experiment events on ${on_string}"/>
-        <data name="output_html" format="html" label="${tool.name} on ${on_string}"/>
+        <data name="output_design_file" format="tabular" label="${tool.name} (design file) on ${on_string}">
+            <filter>save_design_file == 'yes'</filter>
+        </data>
+        <data name="output_bed" format="bed" label="${tool.name} (bed) on ${on_string}"/>
+        <data name="output_html" format="html" label="${tool.name} (html) on ${on_string}"/>
+        <data name="replicates_counts" format="tabular" label="${tool.name} (replicates counts) on ${on_string}"/>
+        <data name="all_events_table" format="tabular" label="${tool.name} (all events table) on ${on_string}"/>
     </outputs>
     <tests>
         <test>
-            <param name="expt" value="expt_hg19.scidx" ftype="scidx" dbkey="hg19" />
-            <param name="advanced_options_cond" value="hide" />
+            <repeat name="condition_repeat">
+                <repeat name="signal_repeat">
+                    <param name="signal" value="expt_hg19.scidx" ftype="scidx" dbkey="hg19" />
+                </repeat>
+            </repeat>
+            <param name="advanced_options" value="hide" />
+            <param name="in_test_mode" value="yes" />
             <output name="output_html" file="hg19_output_html1.html" ftype="html" compare="contains"/>
-            <output name="experiment_events" file="hg19_experiment_events1.tabular" ftype="tabular"/>
+            <output name="output_bed" file="hg19_output_bed1.bed" ftype="bed"/>
             <output name="all_events_table" file="hg19_all_events_table1.tabular" ftype="tabular"/>
             <output name="replicates_counts" file="hg19_replicates_counts1.tabular" ftype="tabular"/>
         </test>
         <test>
-            <param name="expt" value="expt_hg19.scidx" ftype="scidx" dbkey="hg19" />
-            <param name="ctrl" value="cntrl_hg19.scidx" ftype="scidx" dbkey="hg19" />
-            <param name="advanced_options_cond" value="display" />
+            <repeat name="condition_repeat">
+                <repeat name="signal_repeat">
+                    <param name="signal" value="expt_hg19.scidx" ftype="scidx" dbkey="hg19" />
+                </repeat>
+                <repeat name="control_repeat">
+                    <param name="control" value="cntrl_hg19.scidx" ftype="scidx" dbkey="hg19" />
+                </repeat>
+            </repeat>
+            <param name="advanced_options" value="display" />
+            <param name="in_test_mode" value="yes" />
             <output name="output_html" file="hg19_output_html2.html" ftype="html" compare="contains"/>
-            <output name="experiment_events" file="hg19_experiment_events2.tabular" ftype="tabular"/>
+            <output name="output_bed" file="hg19_output_bed2.bed" ftype="bed"/>
             <output name="all_events_table" file="hg19_all_events_table2.tabular" ftype="tabular"/>
             <output name="replicates_counts" file="hg19_replicates_counts2.tabular" ftype="tabular"/>
         </test>
@@ -399,7 +472,7 @@
 
 * **Loading data:**
 
- - **Optional file containing reads from a control experiment** - must be same format as input experiment
+ - **Optional file containing reads from a control experiment** - file containing reads from a control experiment
  - **Fixed per-base limit** - Fixed per-base limit (default: estimated from background model).
  - **Poisson threshold for filtering per base** - Look at neighboring positions to decide what the per-base limit should be.
  - **Use non-unique reads** - Use non-unique reads.
@@ -456,3 +529,4 @@
         <citation type="doi">10.1371/journal.pcbi.1003501</citation>
     </citations>
 </tool>
+
--- a/test-data/hg19_all_events_table1.tabular	Tue Mar 28 12:24:56 2017 -0400
+++ b/test-data/hg19_all_events_table1.tabular	Sun Dec 22 12:11:33 2019 -0500
@@ -1,10 +1,10 @@
 ### MultiGPS output
 #Condition	Name	Index	TotalSigCount	SignalFraction
-#Condition	experiment	0	99.0	0.555
+#Condition	cond	0	99.0	0.555
 #Replicate	ParentCond	Name	Index	SigCount	CtrlCount	SigCtrlScaling	SignalFraction
-#Replicate	experiment	experiment:rep1	0	99.0	0	1	0.56
+#Replicate	cond	cond:1	0	99.0	0	1	0.56
 #
-#Point	experiment_Sig	experiment_Ctrl	experiment_log2Fold	experiment_log2P	ActiveConds
+#Point	cond_Sig	cond_Ctrl	cond_log2Fold	cond_log2P	ActiveConds
 chr1:569927	14.3	0.0	3.838	-6.470	1
 chr1:536042	1.0	0.0	0.014	-1.474	1
 chr1:535151	1.0	0.0	0.014	-1.413	1
--- a/test-data/hg19_all_events_table2.tabular	Tue Mar 28 12:24:56 2017 -0400
+++ b/test-data/hg19_all_events_table2.tabular	Sun Dec 22 12:11:33 2019 -0500
@@ -1,10 +1,10 @@
 ### MultiGPS output
 #Condition	Name	Index	TotalSigCount	SignalFraction
-#Condition	experiment	0	99.0	0.555
+#Condition	cond	0	99.0	0.555
 #Replicate	ParentCond	Name	Index	SigCount	CtrlCount	SigCtrlScaling	SignalFraction
-#Replicate	experiment	experiment:rep1	0	99.0	18.0	4.00	0.555
+#Replicate	cond	cond:1	0	99.0	18.0	4.00	0.555
 #
-#Point	experiment_Sig	experiment_Ctrl	experiment_log2Fold	experiment_log2P	ActiveConds
+#Point	cond_Sig	cond_Ctrl	cond_log2Fold	cond_log2P	ActiveConds
 chr1:569927	14.3	0.0	3.838	-6.470	1
 chr1:536042	1.0	0.0	0.014	-1.281	1
 chr1:535151	1.0	0.0	0.014	-1.211	1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/hg19_output_bed1.bed	Sun Dec 22 12:11:33 2019 -0500
@@ -0,0 +1,1 @@
+track name=multiGPS-cond description=multiGPS events cond
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/hg19_output_bed2.bed	Sun Dec 22 12:11:33 2019 -0500
@@ -0,0 +1,1 @@
+track name=multiGPS-cond description=multiGPS events cond
--- a/test-data/hg19_output_html1.html	Tue Mar 28 12:24:56 2017 -0400
+++ b/test-data/hg19_output_html1.html	Sun Dec 22 12:11:33 2019 -0500
@@ -1,13 +1,12 @@
 <html>
 	<body>
-</p>
 	<h2>Binding events</h2>
 	<table>
 		<tr>		<th>Condition</th>
 		<th>Events</th>
 		<th>File</th>
 		</tr>
-		<tr>		<td>experiment</td>
+		<tr>		<td>cond</td>
 		<td>0</td>
 		</tr>
 	</table>
@@ -19,7 +18,7 @@
 		<th>SignalFraction</th>
 		<th>ReadDistributionModel</th>
 		</tr>
-		<tr>		<td>experiment rep1</td>
+		<tr>		<td>cond 1</td>
 		<td>99.0</td>
 		<td>NA</td>
 		<td>0.555</td>
--- a/test-data/hg19_output_html2.html	Tue Mar 28 12:24:56 2017 -0400
+++ b/test-data/hg19_output_html2.html	Sun Dec 22 12:11:33 2019 -0500
@@ -1,13 +1,11 @@
 <html>
-	<body>
-</p>
 	<h2>Binding events</h2>
 	<table>
 		<tr>		<th>Condition</th>
 		<th>Events</th>
 		<th>File</th>
 		</tr>
-		<tr>		<td>experiment</td>
+		<tr>		<td>cond</td>
 		<td>0</td>
 		</tr>
 	</table>
@@ -19,7 +17,7 @@
 		<th>SignalFraction</th>
 		<th>ReadDistributionModel</th>
 		</tr>
-		<tr>		<td>experiment rep1</td>
+		<tr>		<td>cond 1</td>
 		<td>99.0</td>
 		<td>4.000</td>
 		<td>0.555</td>
--- a/test-data/hg19_replicates_counts1.tabular	Tue Mar 28 12:24:56 2017 -0400
+++ b/test-data/hg19_replicates_counts1.tabular	Sun Dec 22 12:11:33 2019 -0500
@@ -1,4 +1,4 @@
-Point	experiment:rep1
+Point	cond:1
 chr1:569927	14
 chr1:536042	1
 chr1:535151	1
--- a/test-data/hg19_replicates_counts2.tabular	Tue Mar 28 12:24:56 2017 -0400
+++ b/test-data/hg19_replicates_counts2.tabular	Sun Dec 22 12:11:33 2019 -0500
@@ -1,4 +1,4 @@
-Point	experiment:rep1
+Point	cond:1
 chr1:569927	14
 chr1:536042	1
 chr1:535151	1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/hg19.len	Sun Dec 22 12:11:33 2019 -0500
@@ -0,0 +1,15 @@
+chr1	249250621
+chr1_jh636052_fix	7283150
+chr1_jh636053_fix	1676126
+chr1_jh636054_fix	758378
+chr1_gl000192_random	547496
+chr1_gl383520_alt	366579
+chr1_gl383518_alt	182439
+chr1_gl949741_fix	151551
+chr1_gl383519_alt	110268
+chr1_gl000191_random	106433
+chr1_gl383517_fix	49352
+chr1_gl383516_fix	49316
+chr1_jh806575_fix	47409
+chr1_jh806573_fix	24680
+chr1_jh806574_fix	22982