changeset 6:986b6cbd0f59 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/cufflinks/cuffdiff commit 6b66cbbde16c35593fe95066ea2b91623bf35140"
author iuc
date Mon, 06 Jul 2020 18:19:14 +0000
parents 3d8071386667
children 456797205473
files cuff_macros.xml cuffdiff_wrapper.xml
diffstat 2 files changed, 198 insertions(+), 169 deletions(-) [+]
line wrap: on
line diff
--- a/cuff_macros.xml	Tue Jun 16 16:57:20 2020 +0000
+++ b/cuff_macros.xml	Mon Jul 06 18:19:14 2020 +0000
@@ -1,91 +1,95 @@
 <macros>
-  <token name="@VERSION@">2.2.1</token>
+    <token name="@VERSION@">2.2.1</token>
+
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="2.2.1">cufflinks</requirement>
+            <yield />
+        </requirements>
+    </xml>
 
-  <xml name="requirements">
-    <requirements>
-      <requirement type="package" version="2.2.1">cufflinks</requirement>
-      <yield />
-    </requirements>
-  </xml>
+    <xml name="conditions_repeat" token_format="">
+        <repeat name="conditions" title="Condition" min="2">
+            <param name="name" label="Condition name" type="text">
+                <validator type="empty_field" message="You must provide a condition name" />
+                <validator type="expression" message="Commas are not allowed in condition names">value and "," not in value</validator>
+            </param>
+            <param name="samples" label="Replicates" type="data" format="@FORMAT@" multiple="true"/>
+        </repeat>
+    </xml>
 
-  <xml name="condition_inputs">
-    <!-- DEFAULT : use BAM/SAM files -->
-    <conditional name="in_type">
-        <param name="set_in_type" type="select" label="Input data type"
-            help="CuffNorm supports either CXB (from cuffquant) or SAM/BAM input files. Mixing is not supported. Default: SAM/BAM">
-            <option value="BAM">SAM/BAM</option>
-            <option value="CXB">Cuffquant (CXB)</option>
-            <option value="CONDITION_LIST">List of single replicate conditions</option>
-            <option value="CONDITION_REPLICATE_LIST">List of multiple replicate conditions</option>
-        </param>
-        <when value="BAM">
-            <repeat name="conditions" title="Condition" min="2">
-                <param name="name" label="Condition name" type="text"/>
-                <param name="samples" label="Replicates" type="data" format="sam,bam" multiple="true"/>
-            </repeat>
-        </when>
-        <when value="CXB">
-            <repeat name="conditions" title="Condition" min="2">
-                <param name="name" label="Condition name" type="text"/>
-                <param name="samples" label="Replicates" type="data" format="cxb" multiple="true"/>
-            </repeat>
-        </when>
-        <when value="CONDITION_LIST">
-            <param name="conditions" label="List of Conditions" type="data_collection" collection_type="list" />
-        </when>
-        <when value="CONDITION_REPLICATE_LIST">
-            <param name="conditions" label="List of Conditions" type="data_collection" collection_type="list:list" />
-        </when>
-    </conditional>
-  </xml>
-  <token name="@CONDITION_SAMPLES@">
-            #if $in_type.set_in_type in ['BAM', 'CXB']
-                #for $condition in $in_type.conditions:
-                    #set samples = ','.join( [ str( $sample ) for $sample in $condition.samples ] )
-                    '$samples'
-                #end for
-            #elif $in_type.set_in_type == 'CONDITION_LIST'
-                #for $sample in $in_type.conditions:
-                    '$sample'
-                #end for
-            #elif $in_type.set_in_type == 'CONDITION_REPLICATE_LIST'
-                #for $condition_list in $in_type.conditions:
-                    #set samples = ','.join( [ str( $sample ) for $sample in $condition_list ] )
-                    '$samples'
-                #end for
-            #end if
-  </token>
-  <token name="@CONDITION_LABELS@">
-            #import re
-            #if $in_type.set_in_type in ['BAM', 'CXB']
-                #set labels = '\'' + '\',\''.join( [ str( $condition.name ) for $condition in $in_type.conditions ] ) + '\''
-            #elif $in_type.set_in_type in ['CONDITION_LIST', 'CONDITION_REPLICATE_LIST']
-                #set labels = '\'' + '\',\''.join( map(lambda x: re.sub('[^\w\-_]', '_', x), $in_type.conditions.keys() ) ) + '\''
-            #end if
-            --labels $labels
-  </token>
-  <xml name="cufflinks_gtf_inputs">
-    <param format="gtf" name="inputs" type="data" label="GTF file(s) produced by Cufflinks" help="" multiple="true" />
-  </xml>
-  <token name="@CUFFLINKS_LINK_GTF_INPUTS@"><![CDATA[
-            ## Inputs.
-            #for $i, $input_file in enumerate($inputs):
-                ln -s '${input_file}' input_$i &&
-            #end for
-  ]]></token>
-  <token name="@CUFFLINKS_GTF_INPUTS@">
-            ## Inputs.
-            #for $i, $input_file in enumerate($inputs):
-                'input_$i'
-            #end for
-  </token>
-  <token name="@HAS_MULTIPLE_INPUTS@">getattr(inputs, "__len__", [].__len__)() >= 2</token>
+    <xml name="condition_inputs">
+        <!-- DEFAULT : use BAM/SAM files -->
+        <conditional name="in_type">
+            <param name="set_in_type" type="select" label="Input data type"
+                help="CuffNorm supports either CXB (from cuffquant) or SAM/BAM input files. Mixing is not supported. Default: SAM/BAM">
+                <option value="BAM">SAM/BAM</option>
+                <option value="CXB">Cuffquant (CXB)</option>
+                <option value="CONDITION_LIST">List of single replicate conditions</option>
+                <option value="CONDITION_REPLICATE_LIST">List of multiple replicate conditions</option>
+            </param>
+            <when value="BAM">
+                <expand macro="conditions_repeat" format="sam,bam" />
+            </when>
+            <when value="CXB">
+                <expand macro="conditions_repeat" format="cxb" />
+            </when>
+            <when value="CONDITION_LIST">
+                <param name="conditions" label="List of Conditions" type="data_collection" collection_type="list" />
+            </when>
+            <when value="CONDITION_REPLICATE_LIST">
+                <param name="conditions" label="List of Conditions" type="data_collection" collection_type="list:list" />
+            </when>
+        </conditional>
+    </xml>
+    <token name="@CONDITION_SAMPLES@"><![CDATA[
+#if $in_type.set_in_type in ['BAM', 'CXB']
+    #for $condition in $in_type.conditions:
+        #set samples = ','.join([str($sample) for $sample in $condition.samples])
+        '$samples'
+    #end for
+#elif $in_type.set_in_type == 'CONDITION_LIST'
+    #for $sample in $in_type.conditions:
+        '$sample'
+    #end for
+#elif $in_type.set_in_type == 'CONDITION_REPLICATE_LIST'
+    #for $condition_list in $in_type.conditions:
+        #set samples = ','.join([str($sample) for $sample in $condition_list])
+        '$samples'
+    #end for
+#end if
+    ]]></token>
+    <token name="@CONDITION_LABELS@"><![CDATA[
+#import re
+#if $in_type.set_in_type in ['BAM', 'CXB']
+    #set labels = "','".join([str($condition.name) for $condition in $in_type.conditions])
+#elif $in_type.set_in_type in ['CONDITION_LIST', 'CONDITION_REPLICATE_LIST']
+    #set labels = "','".join([str($condition).replace(',', '_') for $condition in $in_type.conditions.keys()])
+#end if
+--labels '$labels'
+    ]]></token>
+    <xml name="cufflinks_gtf_inputs">
+        <param format="gtf" name="inputs" type="data" label="GTF file(s) produced by Cufflinks" help="" multiple="true" />
+    </xml>
+    <token name="@CUFFLINKS_LINK_GTF_INPUTS@"><![CDATA[
+## Inputs.
+#for $i, $input_file in enumerate($inputs):
+    ln -s '${input_file}' input_$i &&
+#end for
+    ]]></token>
+    <token name="@CUFFLINKS_GTF_INPUTS@"><![CDATA[
+## Inputs.
+#for $i, $input_file in enumerate($inputs):
+    'input_$i'
+#end for
+    ]]></token>
+    <token name="@HAS_MULTIPLE_INPUTS@">getattr(inputs, "__len__", [].__len__)() >= 2</token>
 
-  <xml name="citations">
-    <citations>
-        <citation type="doi">10.1038/nbt.1621</citation>
-        <yield/>
-    </citations>
-  </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.1038/nbt.1621</citation>
+            <yield/>
+        </citations>
+    </xml>
 
 </macros>
--- a/cuffdiff_wrapper.xml	Tue Jun 16 16:57:20 2020 +0000
+++ b/cuffdiff_wrapper.xml	Mon Jul 06 18:19:14 2020 +0000
@@ -1,4 +1,4 @@
-<tool id="cuffdiff" name="Cuffdiff" version="@VERSION@.5">
+<tool id="cuffdiff" name="Cuffdiff" version="@VERSION@.6">
     <description>find significant changes in transcript expression, splicing, and promoter use</description>
     <macros>
         <import>cuff_macros.xml</import>
@@ -68,7 +68,7 @@
             @CONDITION_SAMPLES@
             #if $generate_sqlite:
                 &&
-                Rscript '$__tool_directory__/cummeRbund.R' && mv cummeRbund.sqlite '${output_cummerbund}'
+                Rscript '$__tool_directory__/cummeRbund.R'
             #end if
             ]]>
     </command>
@@ -104,21 +104,21 @@
             </param>
             <when value="Yes">
                 <conditional name="seq_source">
-                  <param name="index_source" type="select" label="Reference sequence data">
-                    <option value="cached">Locally cached</option>
-                    <option value="history">History</option>
-                  </param>
-                  <when value="cached">
-                    <param name="index" type="select" label="Using reference genome">
-                      <options from_data_table="fasta_indexes">
-                        <filter type="data_meta" ref="gtf_input" key="dbkey" column="1" />
-                        <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
-                      </options>
+                    <param name="index_source" type="select" label="Reference sequence data">
+                        <option value="cached">Locally cached</option>
+                        <option value="history">History</option>
                     </param>
-                  </when>
-                  <when value="history">
-                      <param name="ref_file" type="data" format="fasta" label="Using reference file" />
-                  </when>
+                    <when value="cached">
+                        <param name="index" type="select" label="Using reference genome">
+                        <options from_data_table="fasta_indexes">
+                            <filter type="data_meta" ref="gtf_input" key="dbkey" column="1" />
+                            <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+                        </options>
+                        </param>
+                    </when>
+                    <when value="history">
+                        <param name="ref_file" type="data" format="fasta" label="Using reference file" />
+                    </when>
                 </conditional>
             </when>
             <when value="No"></when>
@@ -209,36 +209,36 @@
         </data>
         <!-- Standard datasets. -->
         <data format="tabular" name="splicing_diff" label="${tool.name} on ${on_string}: splicing differential expression testing" from_work_dir="splicing.diff">
-                <filter>not omit_tabular_output</filter>
+            <filter>not omit_tabular_output</filter>
         </data>
         <data format="tabular" name="promoters_diff" label="${tool.name} on ${on_string}: promoters differential expression testing" from_work_dir="promoters.diff">
-                <filter>not omit_tabular_output</filter>
+            <filter>not omit_tabular_output</filter>
         </data>
         <data format="tabular" name="cds_diff" label="${tool.name} on ${on_string}: CDS overloading diffential expression testing" from_work_dir="cds.diff">
-                <filter>not omit_tabular_output</filter>
+            <filter>not omit_tabular_output</filter>
         </data>
         <data format="tabular" name="cds_exp_fpkm_tracking" label="${tool.name} on ${on_string}: CDS FPKM differential expression testing" from_work_dir="cds_exp.diff">
-                <filter>not omit_tabular_output</filter>
+            <filter>not omit_tabular_output</filter>
         </data>
         <data format="tabular" name="cds_fpkm_tracking" label="${tool.name} on ${on_string}: CDS FPKM tracking" from_work_dir="cds.fpkm_tracking">
-                <filter>not omit_tabular_output</filter>
+            <filter>not omit_tabular_output</filter>
         </data>
         <data format="tabular" name="cds_count_tracking" label="${tool.name} on ${on_string}: CDS count tracking" from_work_dir="cds.count_tracking" >
-                <filter>(include_count_files == 'Yes') and not omit_tabular_output</filter>
+            <filter>(include_count_files == 'Yes') and not omit_tabular_output</filter>
         </data>
 
         <data format="tabular" name="tss_groups_exp" label="${tool.name} on ${on_string}: TSS groups differential expression testing" from_work_dir="tss_group_exp.diff">
-                <filter>not omit_tabular_output</filter>
+            <filter>not omit_tabular_output</filter>
         </data>
         <data format="tabular" name="tss_groups_fpkm_tracking" label="${tool.name} on ${on_string}: TSS groups FPKM tracking" from_work_dir="tss_groups.fpkm_tracking">
-                <filter>not omit_tabular_output</filter>
+            <filter>not omit_tabular_output</filter>
         </data>
         <data format="tabular" name="tss_groups_count_tracking" label="${tool.name} on ${on_string}: TSS count FPKM tracking" from_work_dir="tss_groups.count_tracking" >
-                <filter>(include_count_files == 'Yes') and not omit_tabular_output</filter>
+            <filter>(include_count_files == 'Yes') and not omit_tabular_output</filter>
         </data>
 
         <data format="tabular" name="genes_exp" label="${tool.name} on ${on_string}: gene differential expression testing" from_work_dir="gene_exp.diff">
-                <filter>not omit_tabular_output</filter>
+            <filter>not omit_tabular_output</filter>
         </data>
         <data format="tabular" name="genes_fpkm_tracking" label="${tool.name} on ${on_string}: gene FPKM tracking" from_work_dir="genes.fpkm_tracking">
             <filter>not omit_tabular_output</filter>
@@ -256,72 +256,97 @@
         <data format="tabular" name="isoforms_count_tracking" label="${tool.name} on ${on_string}: transcript count tracking" from_work_dir="isoforms.count_tracking">
             <filter>(include_count_files == 'Yes') and not omit_tabular_output</filter>
         </data>
-        <data format="sqlite" name="output_cummerbund" label="${tool.name} on ${on_string}: cummeRbund SQLite database">
+        <data format="sqlite" name="output_cummerbund" label="${tool.name} on ${on_string}: cummeRbund SQLite database" from_work_dir="cummeRbund.sqlite">
             <filter>generate_sqlite</filter>
         </data>
     </outputs>
 
     <tests>
         <test>
-                <!--
-                    cuffdiff cuffcompare_out5.gtf cuffdiff_in1.sam cuffdiff_in2.sam
-                -->
-                <param name="gtf_input" value="cuffdiff_in1.gtf" ftype="gtf" />
-                <param name="generate_sqlite" value="yes" />
-                <param name="omit_tabular_output" value="yes" />
-                <conditional name="in_type">
-                    <param name="set_in_type" value="BAM" />
-                    <repeat name="conditions">
-                        <param name="name" value="q1" />
-                        <param name="samples" value="cuffdiff_in1.sam" ftype="sam" />
-                    </repeat>
-                    <repeat name="conditions">
-                        <param name="name" value="q2" />
-                        <param name="samples" value="cuffdiff_in2.sam" ftype="sam" />
-                    </repeat>
-                </conditional>
-                <param name="fdr" value="0.05" />
-                <param name="min_alignment_count" value="0" />
-                <param name="do_bias_correction" value="No" />
-                <param name="do_normalization" value="No" />
-                <param name="multiread_correct" value="No"/>
-                <param name="sAdditional" value="No"/>
-                <output name="output_cummerbund" ftype="sqlite" file="cuffdiff_out.sqlite" compare="sim_size" />
+            <!--
+                cuffdiff cuffcompare_out5.gtf cuffdiff_in1.sam cuffdiff_in2.sam
+            -->
+            <param name="gtf_input" value="cuffdiff_in1.gtf" ftype="gtf" />
+            <param name="generate_sqlite" value="yes" />
+            <param name="omit_tabular_output" value="yes" />
+            <conditional name="in_type">
+                <param name="set_in_type" value="BAM" />
+                <repeat name="conditions">
+                    <param name="name" value="q1" />
+                    <param name="samples" value="cuffdiff_in1.sam" ftype="sam" />
+                </repeat>
+                <repeat name="conditions">
+                    <param name="name" value="q2" />
+                    <param name="samples" value="cuffdiff_in2.sam" ftype="sam" />
+                </repeat>
+            </conditional>
+            <param name="fdr" value="0.05" />
+            <param name="min_alignment_count" value="0" />
+            <param name="do_bias_correction" value="No" />
+            <param name="do_normalization" value="No" />
+            <param name="multiread_correct" value="No"/>
+            <param name="sAdditional" value="No"/>
+            <output name="output_cummerbund" ftype="sqlite" file="cuffdiff_out.sqlite" compare="sim_size" />
         </test>
         <test>
-                <!--
-                    cuffdiff cuffcompare_out5.gtf cuffdiff_in1.sam cuffdiff_in2.sam
-                -->
-                <param name="gtf_input" value="cuffdiff_in1.gtf" ftype="gtf" />
-                <param name="omit_tabular_output" value="no" />
-                <conditional name="in_type">
-                    <param name="set_in_type" value="BAM" />
-                    <repeat name="conditions">
-                        <param name="name" value="q1" />
-                        <param name="samples" value="cuffdiff_in1.sam" ftype="sam" />
-                    </repeat>
-                    <repeat name="conditions">
-                        <param name="name" value="q2" />
-                        <param name="samples" value="cuffdiff_in2.sam" ftype="sam" />
-                    </repeat>
-                </conditional>
-                <param name="fdr" value="0.05" />
-                <param name="min_alignment_count" value="0" />
-                <param name="do_bias_correction" value="No" />
-                <param name="do_normalization" value="No" />
-                <param name="multiread_correct" value="No"/>
-                <param name="sAdditional" value="No"/>
-                <output name="splicing_diff" file="splicing.diff"/>
-                <output name="promoters_diff" file="promoters.diff"/>
-                <output name="cds_diff" file="cds.diff"/>
-                <output name="cds_exp_fpkm_tracking" file="cds.exp_fpkm_tracking"/>
-                <output name="cds_fpkm_tracking" file="cds.fpkm_tracking"/>
-                <output name="tss_groups_exp" file="tss.groups_exp" lines_diff="200"/>
-                <output name="tss_groups_fpkm_tracking" file="tss.groups_fpkm_tracking"/>
-                <output name="genes_exp" file="genes.exp" lines_diff="200"/>
-                <output name="genes_fpkm_tracking" file="genes.fpkm_tracking" lines_diff="200"/>
-                <output name="isoforms_exp" file="isoforms.exp" lines_diff="200"/>
-                <output name="isoforms_fpkm_tracking" file="isoforms.fpkm_tracking" lines_diff="200"/>
+            <!--
+                Use a list collection as conditions input
+                cuffdiff cuffcompare_out5.gtf cuffdiff_in1.sam cuffdiff_in2.sam
+            -->
+            <param name="gtf_input" value="cuffdiff_in1.gtf" ftype="gtf" />
+            <param name="generate_sqlite" value="yes" />
+            <param name="omit_tabular_output" value="yes" />
+            <conditional name="in_type">
+                <param name="set_in_type" value="CONDITION_LIST" />
+                <param name="conditions">
+                    <collection type="list">
+                        <element name="q1" value="cuffdiff_in1.sam" />
+                        <element name="q2" value="cuffdiff_in2.sam" />
+                    </collection>
+                </param>
+            </conditional>
+            <param name="fdr" value="0.05" />
+            <param name="min_alignment_count" value="0" />
+            <param name="do_bias_correction" value="No" />
+            <param name="do_normalization" value="No" />
+            <param name="multiread_correct" value="No"/>
+            <param name="sAdditional" value="No"/>
+            <output name="output_cummerbund" ftype="sqlite" file="cuffdiff_out.sqlite" compare="sim_size" />
+        </test>
+        <test>
+            <!--
+                cuffdiff cuffcompare_out5.gtf cuffdiff_in1.sam cuffdiff_in2.sam
+            -->
+            <param name="gtf_input" value="cuffdiff_in1.gtf" ftype="gtf" />
+            <param name="omit_tabular_output" value="no" />
+            <conditional name="in_type">
+                <param name="set_in_type" value="BAM" />
+                <repeat name="conditions">
+                    <param name="name" value="q1" />
+                    <param name="samples" value="cuffdiff_in1.sam" ftype="sam" />
+                </repeat>
+                <repeat name="conditions">
+                    <param name="name" value="q2" />
+                    <param name="samples" value="cuffdiff_in2.sam" ftype="sam" />
+                </repeat>
+            </conditional>
+            <param name="fdr" value="0.05" />
+            <param name="min_alignment_count" value="0" />
+            <param name="do_bias_correction" value="No" />
+            <param name="do_normalization" value="No" />
+            <param name="multiread_correct" value="No"/>
+            <param name="sAdditional" value="No"/>
+            <output name="splicing_diff" file="splicing.diff"/>
+            <output name="promoters_diff" file="promoters.diff"/>
+            <output name="cds_diff" file="cds.diff"/>
+            <output name="cds_exp_fpkm_tracking" file="cds.exp_fpkm_tracking"/>
+            <output name="cds_fpkm_tracking" file="cds.fpkm_tracking"/>
+            <output name="tss_groups_exp" file="tss.groups_exp" lines_diff="200"/>
+            <output name="tss_groups_fpkm_tracking" file="tss.groups_fpkm_tracking"/>
+            <output name="genes_exp" file="genes.exp" lines_diff="200"/>
+            <output name="genes_fpkm_tracking" file="genes.fpkm_tracking" lines_diff="200"/>
+            <output name="isoforms_exp" file="isoforms.exp" lines_diff="200"/>
+            <output name="isoforms_fpkm_tracking" file="isoforms.fpkm_tracking" lines_diff="200"/>
         </test>
     </tests>
     <help>