changeset 4:a2899db6bd6e draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/porechop commit f04670edc196c683e09beb1fc1d8bc731162d47f
author iuc
date Sun, 09 Feb 2025 20:38:35 +0000
parents 543cbeef3949
children
files porechop.xml
diffstat 1 files changed, 32 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/porechop.xml	Thu Feb 24 20:08:33 2022 +0000
+++ b/porechop.xml	Sun Feb 09 20:38:35 2025 +0000
@@ -1,4 +1,4 @@
-<tool id="porechop" name="Porechop" version="@WRAPPER_VERSION@+galaxy0" profile="20.01">
+<tool id="porechop" name="Porechop" version="@WRAPPER_VERSION@+galaxy1" profile="20.01">
     <description>adapter trimmer for Oxford Nanopore reads</description>
     <macros>
         <token name="@WRAPPER_VERSION@">0.2.4</token>
@@ -8,8 +8,14 @@
     </requirements>
     <version_command>porechop --version</version_command>
     <command detect_errors="exit_code"><![CDATA[
+#import re
+
+#set file_path = re.sub('[^\s\w\-.]', '_', str($input_file.element_identifier))
+
+ln -s '$input_file' '$file_path' &&
+
 porechop
-    -i '$input_file'
+    -i '$file_path'
     --format '$format'
     --barcode_threshold '$barcode_binning_settings.barcode_threshold'
     --barcode_diff '$barcode_binning_settings.barcode_diff'
@@ -29,6 +35,9 @@
     --extra_middle_trim_bad_side '$middle_adapter_settings.extra_middle_trim_bad_side'
     --min_split_read_size '$middle_adapter_settings.min_split_read_size'
     -o 'out.$format'
+    #if $log_file
+        > '$log_output'
+    #end if
 
     ]]></command>
     <inputs>
@@ -83,6 +92,7 @@
             <param argument="--min_split_read_size" type="integer" min="0" value="1000" optional="True" label="Minimum length reads post-split"
                    help="Post-split read pieces smaller than this many base pairs will not be outputted (default: 1000)"/>
         </section>
+        <param name="log_file" type="boolean" label="Generate log file" help="Generates a log file out of stdout, which can be used as MultiQC input"/>
     </inputs>
     <outputs>
         <data name="outfile" format="fasta" from_work_dir="out.*" label="${tool.name} on ${on_string}: Trimmed">
@@ -92,34 +102,46 @@
                 <when input="format" value="fastq.gz" format="fastqsanger.gz"/>
             </change_format>
         </data>
+        <data name="log_output" format="txt" label="Porechop log file">
+            <filter>log_file</filter>
+        </data>
     </outputs>
     <tests>
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_file" ftype="fasta" value="test_format.fasta"/>
             <param name="format" value="fasta"/>
+            <param name="log_file" value="true"/>
             <output name="outfile" ftype="fasta" file="out.fasta"/>
+            <output name="log_output" ftype="txt">
+                <assert_contents>
+                    <has_line line="  PCR adapters 2                            66.7       63.6"/>
+                    <has_line line="  Barcode 1 (reverse)                       59.4       66.7"/>
+                    <has_line line="4 / 9 reads had adapters trimmed from their start (74 bp removed)"/>
+                    <has_line line="3 / 9 reads had adapters trimmed from their end (49 bp removed)"/>
+                </assert_contents>
+            </output>
         </test>
-        <test>
+        <test expect_num_outputs="1">
             <param name="input_file" ftype="fastqsanger.gz" value="test_format.fastq.gz"/>
             <param name="format" value="fastq"/>
             <output name="outfile" ftype="fastqsanger" file="out.fastq"/>
         </test>
-        <test>
+        <test expect_num_outputs="1">
             <param name="input_file" ftype="fastq.gz" value="test_format.fastq.gz"/>
             <param name="format" value="fastq"/>
             <output name="outfile" ftype="fastqsanger" file="out.fastq"/>
         </test>
-        <test>
+        <test expect_num_outputs="1">
             <param name="input_file" ftype="fasta" value="test_format.fasta"/>
             <param name="format" value="fasta.gz"/>
             <output name="outfile" ftype="fasta.gz" file="out.fasta.gz" compare="sim_size"/>
         </test>
-        <test>
+        <test expect_num_outputs="1">
             <param name="input_file" ftype="fasta" value="test_format.fasta"/>
             <param name="format" value="fastq.gz"/>
             <output name="outfile" ftype="fastqsanger.gz" file="out.fastq.gz" compare="sim_size"/>
         </test>
-        <test>
+        <test expect_num_outputs="1">
             <param name="input_file" ftype="fasta" value="test_format.fasta"/>
             <param name="format" value="fasta"/>
             <param name="barcode_threshold" value="70"/>
@@ -132,8 +154,8 @@
             <param name="end_threshold" value="80"/>
             <param name="discard_middle" value="True"/>
             <param name="middle_threshold" value="90"/>
-            <param name="extra_middle_trim_good_size" value="3"/>
-            <param name="extra_middle_trim_bad_size" value="30"/>
+            <param name="extra_middle_trim_good_side" value="3"/>
+            <param name="extra_middle_trim_bad_side" value="30"/>
             <param name="min_split_read_size" value="1500"/>
             <output name="outfile" ftype="fasta" file="out_advanced.fasta"/>
         </test>