diff macs2_callpeak.xml @ 14:c16dbe4e2db2 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/macs2 commit c9c5c4dd15aed950ed9b43a294ce6c41f5732a23
author iuc
date Mon, 06 Aug 2018 10:41:57 -0400
parents 01cded2297b7
children c33686854b19
line wrap: on
line diff
--- a/macs2_callpeak.xml	Fri May 04 21:39:56 2018 -0400
+++ b/macs2_callpeak.xml	Mon Aug 06 10:41:57 2018 -0400
@@ -1,4 +1,4 @@
-<tool id="macs2_callpeak" name="MACS2 callpeak" version="@VERSION_STRING@.3" profile="17.09">
+<tool id="macs2_callpeak" name="MACS2 callpeak" version="@VERSION_STRING@.4" profile="17.09">
     <description>Call peaks from alignment results</description>
     <macros>
         <import>macs2_macros.xml</import>
@@ -8,21 +8,25 @@
     <expand macro="stdio" />
     <expand macro="version_command" />
     <command><![CDATA[
+        #import re
+
         @home_dir@
-
         #set $temp_stderr = 'macs2_stderr'
+
         (macs2 callpeak
 
-            --name 'MACS2'
-
             ## Treatment File(s)
 
             #if str($treatment.t_multi_select) == "Yes":
                 -t ${ ' '.join( [ "'%s'" %  $x for $x in $treatment.input_treatment_file] ) }
+                #set identifier = re.sub('[^\w\-]', '_', str($treatment.input_treatment_file[0].element_identifier))
             #else
                 -t '$treatment.input_treatment_file'
+                #set identifier = re.sub('[^\w\-]', '_', str($treatment.input_treatment_file.element_identifier))
             #end if
 
+            --name $identifier
+
             ## Control File(s)
 
             #if str($control.c_select) == "Yes":
@@ -98,24 +102,24 @@
         2>&1 > $temp_stderr)
         #if "peaks_tabular" in str($outputs).split(','):
             &&
-            cp MACS2_peaks.xls '${ output_tabular }'
+            cp ${identifier}_peaks.xls '${ output_tabular }'
         #end if
 
         ## run R to create pdf from model script
         #if $nomodel_type.nomodel_type_selector == "create_model" and "pdf" in str($outputs).split(',') and $format != "BAMPE":
             &&
-            Rscript MACS2_model.r > MACS2_model.r.log
+            Rscript ${identifier}_model.r > ${identifier}_model.r.log
         #end if
 
         #if 'html' in str($outputs).split(','):
             ## if output files exists, move them to the files_path and create a html result page linking to them
             &&
             (
-            count=`ls -1 MACS2* 2>/dev/null | wc -l`;
+            count=`ls -1 ${identifier}* 2>/dev/null | wc -l`;
             if [ \$count != 0 ];
             then
                 mkdir '${ output_extra_files.files_path }' &&
-                cp -r MACS2* '${ output_extra_files.files_path }' &&
+                cp -r ${identifier}* '${ output_extra_files.files_path }' &&
                 python '$__tool_directory__/dir2html.py'
                     '${ output_extra_files.files_path }' $temp_stderr > '${ output_extra_files }';
             fi;
@@ -202,7 +206,7 @@
         </conditional>
 
         <param name="outputs" type="select" display="checkboxes" multiple="True" optional="True" label="Additional Outputs" help="PDF is only created when the model is built">
-            <option value="peaks_tabular">Peaks as tabular file</option>
+            <option value="peaks_tabular">Peaks as tabular file (compatible wih MultiQC)</option>
             <option value="summits">Peak summits</option>
             <option value="bdg" >Scores in bedGraph files (--bdg)</option>
             <option value="html">Summary page (html)</option>
@@ -246,31 +250,31 @@
         <data name="output_tabular" format="tabular" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (Peaks in tabular format)">
             <filter> outputs and 'peaks_tabular' in outputs</filter>
         </data>
-        <data name="output_broadpeaks" format="bed" from_work_dir="MACS2_peaks.broadPeak" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (broad Peaks)">
+        <data name="output_broadpeaks" format="bed" from_work_dir="*_peaks.broadPeak" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (broad Peaks)">
             <filter>
             ((
               advanced_options['broad_options']['broad_options_selector'] == "broad"
             ))
             </filter>
         </data>
-        <data name="output_gappedpeaks" format="bed" from_work_dir="MACS2_peaks.gappedPeak" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (gapped Peaks)">
+        <data name="output_gappedpeaks" format="bed" from_work_dir="*_peaks.gappedPeak" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (gapped Peaks)">
             <filter>
             ((
               advanced_options['broad_options']['broad_options_selector'] == "broad"
             ))
             </filter>
         </data>
-        <data name="output_narrowpeaks" format="bed" from_work_dir="MACS2_peaks.narrowPeak" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (narrow Peaks)">
+        <data name="output_narrowpeaks" format="bed" from_work_dir="*_peaks.narrowPeak" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (narrow Peaks)">
             <filter>
             ((
               advanced_options['broad_options']['broad_options_selector'] == "nobroad"
             ))
             </filter>
         </data>
-        <data name="output_summits" format="bed" from_work_dir="MACS2_summits.bed" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (summits in BED)">
+        <data name="output_summits" format="bed" from_work_dir="*_summits.bed" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (summits in BED)">
             <filter>outputs and 'summits' in outputs</filter>
         </data>
-        <data name="output_plot" format="pdf" from_work_dir="MACS2_model.pdf" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (plot)">
+        <data name="output_plot" format="pdf" from_work_dir="*_model.pdf" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (plot)">
             <filter>
             ((
               outputs and 'pdf' in outputs and
@@ -279,10 +283,10 @@
             ))
             </filter>
         </data>
-        <data name="output_treat_pileup" format="bedgraph" from_work_dir="MACS2_treat_pileup.bdg" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (Bedgraph Treatment)">
+        <data name="output_treat_pileup" format="bedgraph" from_work_dir="*_treat_pileup.bdg" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (Bedgraph Treatment)">
             <filter>outputs and 'bdg' in outputs</filter>
         </data>
-        <data name="output_control_lambda" format="bedgraph" from_work_dir="MACS2_control_lambda.bdg" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (Bedgraph Control)">
+        <data name="output_control_lambda" format="bedgraph" from_work_dir="*_control_lambda.bdg" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (Bedgraph Control)">
             <filter>outputs and 'bdg' in outputs</filter>
         </data>
         <data name="output_extra_files" format="html" default_identifier_source="treatment|input_treatment_file" label="${tool.name} on ${on_string} (html report)">
@@ -305,7 +309,7 @@
             <param name="upper" value="50" />
             <output name="output_control_lambda" compare="contains" file="callpeak_control_part.bdg" lines_diff="1"/>
             <output name="output_treat_pileup" compare="contains" file="callpeak_treatment_part.bdg" lines_diff="1"/>
-            <output name="output_tabular" compare="contains" file="callpeak_part.tabular" lines_diff="1"/>
+            <output name="output_tabular" compare="contains" file="callpeak_part.tabular" lines_diff="3"/>
             <output name="output_extra_files">
                 <assert_contents>
                     <has_text text="Additional output created by MACS2" />
@@ -379,7 +383,7 @@
 This tool produces a BED file of narrowPeaks as default output. It can also produce additional outputs, which can be selected under the **Additional Outputs** option above.
 
     * **a BED file of peaks** (default)
-    * a tabular file of peaks
+    * a tabular file of peaks (compatible wih MultiQC)
     * a BED file of peak summits
     * two bedGraph files of scores, for treatment pileup and control lambda
     * a HTML summary page
@@ -396,9 +400,9 @@
     ======= ========= ======= ============ ==== === ======= ======== ======= =======
     1          2        3          4        5    6     7       8         9   **10**
     ======= ========= ======= ============ ==== === ======= ======== ======= =======
-    chr1    840081    840400  MACS2_peak_1  69   .  4.89872 10.50944 6.91052 158
-    chr1    919419    919785  MACS2_peak_2  87   .  5.85158 12.44148 8.70936 130
-    chr1    937220    937483  MACS2_peak_3  66   .  4.87632 10.06728 6.61759 154
+    chr1    840081    840400  treat1_peak_1  69   .  4.89872 10.50944 6.91052 158
+    chr1    919419    919785  treat1_peak_2  87   .  5.85158 12.44148 8.70936 130
+    chr1    937220    937483  treat1_peak_3  66   .  4.87632 10.06728 6.61759 154
     ======= ========= ======= ============ ==== === ======= ======== ======= =======
 
     Columns contain the following data:
@@ -417,16 +421,16 @@
 
 **Peaks tabular File**
 
-A tabular file which contains information about called peaks. You can open it in Excel and sort/filter using Excel functions.
+A tabular file which contains information about called peaks. You can open it in Excel and sort/filter using Excel functions. This file is compatible with **MultiQC**.
 
     Example:
 
     ======= ========= ======= ========== ============== ========== ==================  =================== ================== =============
     **chr** **start** **end** **length** **abs_summit** **pileup** **-log10(pvalue)**  **fold_enrichment** **-log10(qvalue)**  **name**
     ======= ========= ======= ========== ============== ========== ==================  =================== ================== =============
-    chr1    840082    840400  319        840240         4.00       10.50944            4.89872             6.91052             MACS2_peak_1
-    chr1    919420    919785  366        919550         5.00       12.44148            5.85158             8.70936             MACS2_peak_2
-    chr1    937221    937483  263        937375         4.00       10.06728            4.87632             6.61759             MACS2_peak_3
+    chr1    840082    840400  319        840240         4.00       10.50944            4.89872             6.91052             treat1_peak_1
+    chr1    919420    919785  366        919550         5.00       12.44148            5.85158             8.70936             treat1_peak_2
+    chr1    937221    937483  263        937375         4.00       10.06728            4.87632             6.61759             treat1_peak_3
     ======= ========= ======= ========== ============== ========== ==================  =================== ================== =============
 
     Columns contain the following data:
@@ -454,9 +458,9 @@
     ======= ========= ======= ============ =======
     1          2        3          4        **5**
     ======= ========= ======= ============ =======
-    chr1    840239    840240  MACS2_peak_1 6.91052
-    chr1    919549    919550  MACS2_peak_2 8.70936
-    chr1    937374    937375  MACS2_peak_3 6.61759
+    chr1    840239    840240  treat1_peak_1 6.91052
+    chr1    919549    919550  treat1_peak_2 8.70936
+    chr1    937374    937375  treat1_peak_3 6.61759
     ======= ========= ======= ============ =======
 
     Columns contain the following data:
@@ -513,9 +517,9 @@
     ======= ========= ======= ============ ==== === ======= ======= =======
     1        2         3       4            5    6   7       8       9
     ======= ========= ======= ============ ==== === ======= ======= =======
-    chr1    840081    840400  MACS2_peak_1  52   .  4.08790 8.57605 5.21506
-    chr1    919419    919785  MACS2_peak_2  56   .  4.37270 8.90436 5.60462
-    chr1    937220    937483  MACS2_peak_3  48   .  4.02343 8.06676 4.86861
+    chr1    840081    840400  treat1_peak_1  52   .  4.08790 8.57605 5.21506
+    chr1    919419    919785  treat1_peak_2  56   .  4.37270 8.90436 5.60462
+    chr1    937220    937483  treat1_peak_3  48   .  4.02343 8.06676 4.86861
     ======= ========= ======= ============ ==== === ======= ======= =======
 
 
@@ -541,9 +545,9 @@
     ======= ========= ======= ============ ==== === ======= ======= === === === === ======= ======= =======
     1       2         3       4            5    6    7       8       9   10  11  12  13      14     15
     ======= ========= ======= ============ ==== === ======= ======= === === === === ======= ======= =======
-    chr1    840081    840400  MACS2_peak_1  52   .  840081  840400   0   1  319  0  4.08790 8.57605 5.21506
-    chr1    919419    919785  MACS2_peak_2  56   .  919419  919785   0   1  366  0  4.37270 8.90436 5.60462
-    chr1    937220    937483  MACS2_peak_3  48   .  937220  937483   0   1  263  0  4.02343 8.06676 4.86861
+    chr1    840081    840400  treat1_peak_1  52   .  840081  840400   0   1  319  0  4.08790 8.57605 5.21506
+    chr1    919419    919785  treat1_peak_2  56   .  919419  919785   0   1  366  0  4.37270 8.90436 5.60462
+    chr1    937220    937483  treat1_peak_3  48   .  937220  937483   0   1  263  0  4.02343 8.06676 4.86861
     ======= ========= ======= ============ ==== === ======= ======= === === === === ======= ======= =======
 
 Columns contain the following data: