Skip to content

Commit f04670e

Browse files
authored
Merge pull request #6726 from RZ9082/porechop
Add log file output to Porechop
2 parents 89a1ecf + 51a1d5c commit f04670e

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

tools/porechop/porechop.xml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<tool id="porechop" name="Porechop" version="@WRAPPER_VERSION@+galaxy0" profile="20.01">
1+
<tool id="porechop" name="Porechop" version="@WRAPPER_VERSION@+galaxy1" profile="20.01">
22
<description>adapter trimmer for Oxford Nanopore reads</description>
33
<macros>
44
<token name="@WRAPPER_VERSION@">0.2.4</token>
@@ -8,8 +8,14 @@
88
</requirements>
99
<version_command>porechop --version</version_command>
1010
<command detect_errors="exit_code"><![CDATA[
11+
#import re
12+
13+
#set file_path = re.sub('[^\s\w\-.]', '_', str($input_file.element_identifier))
14+
15+
ln -s '$input_file' '$file_path' &&
16+
1117
porechop
12-
-i '$input_file'
18+
-i '$file_path'
1319
--format '$format'
1420
--barcode_threshold '$barcode_binning_settings.barcode_threshold'
1521
--barcode_diff '$barcode_binning_settings.barcode_diff'
@@ -29,6 +35,9 @@ porechop
2935
--extra_middle_trim_bad_side '$middle_adapter_settings.extra_middle_trim_bad_side'
3036
--min_split_read_size '$middle_adapter_settings.min_split_read_size'
3137
-o 'out.$format'
38+
#if $log_file
39+
> '$log_output'
40+
#end if
3241
3342
]]></command>
3443
<inputs>
@@ -83,6 +92,7 @@ porechop
8392
<param argument="--min_split_read_size" type="integer" min="0" value="1000" optional="True" label="Minimum length reads post-split"
8493
help="Post-split read pieces smaller than this many base pairs will not be outputted (default: 1000)"/>
8594
</section>
95+
<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"/>
8696
</inputs>
8797
<outputs>
8898
<data name="outfile" format="fasta" from_work_dir="out.*" label="${tool.name} on ${on_string}: Trimmed">
@@ -92,34 +102,46 @@ porechop
92102
<when input="format" value="fastq.gz" format="fastqsanger.gz"/>
93103
</change_format>
94104
</data>
105+
<data name="log_output" format="txt" label="Porechop log file">
106+
<filter>log_file</filter>
107+
</data>
95108
</outputs>
96109
<tests>
97-
<test>
110+
<test expect_num_outputs="2">
98111
<param name="input_file" ftype="fasta" value="test_format.fasta"/>
99112
<param name="format" value="fasta"/>
113+
<param name="log_file" value="true"/>
100114
<output name="outfile" ftype="fasta" file="out.fasta"/>
115+
<output name="log_output" ftype="txt">
116+
<assert_contents>
117+
<has_line line=" PCR adapters 2 66.7 63.6"/>
118+
<has_line line=" Barcode 1 (reverse) 59.4 66.7"/>
119+
<has_line line="4 / 9 reads had adapters trimmed from their start (74 bp removed)"/>
120+
<has_line line="3 / 9 reads had adapters trimmed from their end (49 bp removed)"/>
121+
</assert_contents>
122+
</output>
101123
</test>
102-
<test>
124+
<test expect_num_outputs="1">
103125
<param name="input_file" ftype="fastqsanger.gz" value="test_format.fastq.gz"/>
104126
<param name="format" value="fastq"/>
105127
<output name="outfile" ftype="fastqsanger" file="out.fastq"/>
106128
</test>
107-
<test>
129+
<test expect_num_outputs="1">
108130
<param name="input_file" ftype="fastq.gz" value="test_format.fastq.gz"/>
109131
<param name="format" value="fastq"/>
110132
<output name="outfile" ftype="fastqsanger" file="out.fastq"/>
111133
</test>
112-
<test>
134+
<test expect_num_outputs="1">
113135
<param name="input_file" ftype="fasta" value="test_format.fasta"/>
114136
<param name="format" value="fasta.gz"/>
115137
<output name="outfile" ftype="fasta.gz" file="out.fasta.gz" compare="sim_size"/>
116138
</test>
117-
<test>
139+
<test expect_num_outputs="1">
118140
<param name="input_file" ftype="fasta" value="test_format.fasta"/>
119141
<param name="format" value="fastq.gz"/>
120142
<output name="outfile" ftype="fastqsanger.gz" file="out.fastq.gz" compare="sim_size"/>
121143
</test>
122-
<test>
144+
<test expect_num_outputs="1">
123145
<param name="input_file" ftype="fasta" value="test_format.fasta"/>
124146
<param name="format" value="fasta"/>
125147
<param name="barcode_threshold" value="70"/>

0 commit comments

Comments
 (0)