changeset 15:a626e8c0e1ba draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/fastp commit 17a0a67dfbc7541a7fe3618cfbbb71d814042889
author iuc
date Fri, 15 Nov 2024 15:31:53 +0000
parents ecb9f4854617
children
files fastp.xml macros.xml
diffstat 2 files changed, 35 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/fastp.xml	Mon Nov 11 14:53:41 2024 +0000
+++ b/fastp.xml	Fri Nov 15 15:31:53 2024 +0000
@@ -1,4 +1,4 @@
-<tool id="fastp" name="fastp" version="@TOOL_VERSION@+galaxy0" profile="23.1">
+<tool id="fastp" name="fastp" version="@TOOL_VERSION@+galaxy3" profile="23.1">
     <description>fast all-in-one preprocessing for FASTQ files</description>
     <macros>
         <import>macros.xml</import>
@@ -18,8 +18,6 @@
 #if $single_paired.single_paired_selector == 'paired_collection'
     #if $single_paired.paired_input.forward.is_of_type('fastqsanger.gz')
         #set ext = '.fastqsanger.gz'
-    #elif $single_paired.paired_input.forward.is_of_type('fastqillumina.gz')
-        #set ext = '.fastqillumina.gz'
     #end if
     #set $in1 = $single_paired.paired_input.forward
     #set $in2 = $single_paired.paired_input.reverse
@@ -32,8 +30,6 @@
 #else
     #if $in1.is_of_type('fastqsanger.gz')
         #set ext = '.fastqsanger.gz'
-    #elif $in1.is_of_type('fastqillumina.gz')
-        #set ext = '.fastqillumina.gz'
     #end if
 
     #set $in1_name = re.sub('[^\w\-\s]', '_', str($in1.element_identifier)) + $ext
@@ -45,8 +41,6 @@
     #end if
 #end if
 
-cp '$c1' galaxy.json &&
-
 ## Run fastp
 
 fastp
@@ -54,10 +48,6 @@
 --thread \${GALAXY_SLOTS:-1}
 --report_title 'fastp report for $in1_name'
 
-#if $in1.is_of_type('fastqillumina', 'fastqsolexa', 'fastqillumina.gz', 'fastqsolexa.gz'):
-    --phred64
-#end if
-
 -i '$in1_name'
 
 ## Merge reads
@@ -231,40 +221,6 @@
     mv second${ext} '${out2}'
 #end if
 ]]></command>
-    <configfiles>
-        <configfile name="c1">
-            #set $ext1 = "fastqsanger"
-            #set $ext2 = "fastqsanger"
-            #if str($single_paired.single_paired_selector) == "single"
-                #if $in1.ext.endswith("gz")
-                    #set $ext1 = "fastqsanger.gz"
-                #end if
-            #elif str($single_paired.single_paired_selector) == "paired"
-                #if $in1.ext.endswith("gz")
-                    #set $ext1 = "fastqsanger.gz"
-                #end if
-                #if $in2.ext.endswith("gz")
-                    #set $ext2 = "fastqsanger.gz"
-                #end if
-            #else
-                #if $paired_input.forward.ext.endswith("gz")
-                    #set $ext1 = "fastqsanger.gz"
-                #end if
-                #if $paired_input.reverse.ext.endswith("gz")
-                    #set $ext2 = "fastqsanger.gz"
-                #end if
-            #end if
-            {
-                "out1": {"ext": "$ext1"},
-                "out2": {"ext": "$ext2"},
-                "merged_reads": {"ext": "$ext1"},
-                "unmerged_out1": {"ext": "$ext1"},
-                "unmerged_out2": {"ext": "$ext2"},
-                "unpaired1": {"ext": "$ext1"},
-                "unpaired2": {"ext": "$ext2"}
-            }
-        </configfile>
-    </configfiles>
     <inputs>
         <conditional name="single_paired">
             <param name="single_paired_selector" type="select" label="Single-end or paired reads">
@@ -288,7 +244,7 @@
                 <expand macro="global_trimming_options_paired" />
             </when>
             <when value="paired_collection">
-                <param name="paired_input" type="data_collection" format="fastqsanger,fastqsanger.gz,fastqillumina,fastqillumina.gz" label="Select paired collection(s)" collection_type="paired"/>
+                <param name="paired_input" type="data_collection" format="fastqsanger,fastqsanger.gz" label="Select paired collection(s)" collection_type="paired"/>
                 <expand macro="merge_reads" />
                 <expand macro="adapter_trimming_options">
                     <expand macro="adapter_sequence" read_number="2"/>
@@ -379,10 +335,10 @@
     </inputs>
 
     <outputs>
-        <data name="out1" format="auto" label="${tool.name} on ${on_string}: Read 1 output">
+        <data name="out1" format_source="in1" label="${tool.name} on ${on_string}: Read 1 output">
             <filter>single_paired['single_paired_selector'] in ["single", "paired"] and not single_paired['merge_reads']['merge']</filter>
         </data>
-        <data name="out2" format="auto" label="${tool.name} on ${on_string}: Read 2 output">
+        <data name="out2" format_source="in2" label="${tool.name} on ${on_string}: Read 2 output">
             <filter>single_paired['single_paired_selector'] == "paired" and not single_paired['merge_reads']['merge']</filter>
         </data>
         <collection name="output_paired_coll" type="paired" format_source="paired_input['forward']" label="${tool.name} on ${on_string}: Paired-end output">
@@ -394,20 +350,25 @@
         <data name="report_json" format="json" from_work_dir="fastp.json" label="${tool.name} on ${on_string}: JSON report">
             <filter>output_options['report_json'] is True</filter>
         </data>
-        <data name="merged_reads" format="auto" label="${tool.name} on ${on_string}: Merged reads">
+        <data name="merged_reads" format_source="in1" label="${tool.name} on ${on_string}: Merged reads">
             <filter>single_paired['single_paired_selector'] in ["paired", "paired_collection"] and single_paired['merge_reads']['merge']</filter>
+            <expand macro="format_actions" read_number="1" forward_reverse="forward" />
         </data>
-        <data name="unmerged_out1" format="auto" label="${tool.name} on ${on_string}: Unmerged filtered reads1">
+        <data name="unmerged_out1" format_source="in1" label="${tool.name} on ${on_string}: Unmerged filtered reads1">
             <filter>single_paired['single_paired_selector'] in ["paired", "paired_collection"] and single_paired['merge_reads']['merge'] and not single_paired['merge_reads']['include_unmerged']</filter>
+            <expand macro="format_actions" read_number="1" forward_reverse="forward" />
         </data>
-        <data name="unmerged_out2" format="auto" label="${tool.name} on ${on_string}: Unmerged filtered reads2">
+        <data name="unmerged_out2" format_source="in2" label="${tool.name} on ${on_string}: Unmerged filtered reads2">
             <filter>single_paired['single_paired_selector'] in ["paired", "paired_collection"] and single_paired['merge_reads']['merge'] and not single_paired['merge_reads']['include_unmerged']</filter>
+            <expand macro="format_actions" read_number="2" forward_reverse="reverse" />
         </data>
-        <data name="unpaired1" format="auto" label="${tool.name} on ${on_string}: Unmerged unfiltered reads1">
+        <data name="unpaired1" format_source="in1" label="${tool.name} on ${on_string}: Unmerged unfiltered reads1">
             <filter>single_paired['single_paired_selector'] in ["paired", "paired_collection"] and single_paired['merge_reads']['merge'] and not single_paired['merge_reads']['include_unmerged']</filter>
+            <expand macro="format_actions" read_number="1" forward_reverse="forward" />
         </data>
-        <data name="unpaired2" format="auto" label="${tool.name} on ${on_string}: Unmerged unfiltered reads2">
+        <data name="unpaired2" format_source="in2" label="${tool.name} on ${on_string}: Unmerged unfiltered reads2">
             <filter>single_paired['single_paired_selector'] in ["paired", "paired_collection"] and single_paired['merge_reads']['merge'] and not single_paired['merge_reads']['include_unmerged']</filter>
+            <expand macro="format_actions" read_number="2" forward_reverse="reverse" />
         </data>
     </outputs>
 
@@ -664,7 +625,7 @@
 
 **Inputs**
 
-Single-end or Paired-end (compressed) fastqsagnger or fastqillumina files
+Single-end or Paired-end (compressed) fastqsanger files
 
 -----
 
@@ -688,4 +649,4 @@
     <citations>
         <citation type="doi">10.1101/274100</citation>
     </citations>
-</tool>
+</tool>
\ No newline at end of file
--- a/macros.xml	Mon Nov 11 14:53:41 2024 +0000
+++ b/macros.xml	Fri Nov 15 15:31:53 2024 +0000
@@ -61,11 +61,28 @@
     </xml>
 
     <xml name="in" token_read_number="1" token_argument="-i">
-        <param name="in@READ_NUMBER@" argument="@ARGUMENT@" type="data" format="fastqsanger,fastqsanger.gz,fastqillumina,fastqillumina.gz" label="Input @READ_NUMBER@" help="Input FASTQ file #@READ_NUMBER@"/>
+        <param name="in@READ_NUMBER@" argument="@ARGUMENT@" type="data" format="fastqsanger,fastqsanger.gz" label="Input @READ_NUMBER@" help="Input FASTQ file #@READ_NUMBER@"/>
     </xml>
 
     <xml name="poly_g_min_len">
         <param argument="--poly_g_min_len" type="integer" optional="true" label="PolyG minimum length"
             help="The minimum length to detect polyG in the read tail. 10 by default."/>
     </xml>
-</macros>
+
+    <xml name="format_actions" token_read_number="1" token_forward_reverse="forward">
+        <actions>
+            <conditional name="single_paired.single_paired_selector">
+                <when value="paired">
+                    <action type="format">
+                        <option type="from_param" name="single_paired.in@READ_NUMBER@" param_attribute="ext" />
+                    </action>
+                </when>
+                <when value="paired_collection">
+                    <action type="format">
+                        <option type="from_param" name="single_paired.paired_input" param_attribute="@FORWARD_REVERSE@.ext" />
+                    </action>
+                </when>
+            </conditional>
+        </actions>
+    </xml>
+</macros>
\ No newline at end of file