Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dorado_trimming feedback from testing #149

Merged
merged 4 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 48 additions & 16 deletions tools/dorado/dorado_trimming.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="dorado_trimming" name="Dorado adapter and primer trimming" version="@VERSION@+galaxy0" python_template_version="3.5" profile="24.1">
<tool id="dorado_trimming" name="Dorado adapter and primer trimming" version="@VERSION@+galaxy1" python_template_version="3.5" profile="24.1">
<description>for Oxford Nanopore (ONT) DNA reads</description>
<macros>
<import>macros.xml</import>
Expand All @@ -14,11 +14,10 @@ ln -s '$reads' ./reads
dorado trim
--verbose
--threads "\${GALAXY_SLOTS}"
#if $no_trim_primers
#if $trim_primers.no_trim_primers == 'dont_trim'
--no-trim-primers
#end if
#if $primer_sequences
--primer-sequences '$primer_sequences'
#else if $trim_primers.primer_sequences
--primer-sequences '${trim_primers.primer_sequences}'
#end if
reads
> trimmed.bam
Expand All @@ -33,8 +32,16 @@ trimmed.bam
]]></command>
<inputs>
<param name="reads" type="data" format="bam,fastqsanger,unsorted.bam" label="Existing, basecalled DNA dataset" help="Note: this tool does not support trimming adaptors from RNA reads. These need to be removed during basecalling."/>
<param argument="--no-trim-primers" type="boolean" label="Don't trim primers" help="This option can be used to prevent the trimming of primer sequences. In this case only adapter sequences will be trimmed."/>
<param argument="--primer-sequences" type="data" format="fasta" optional="true" label="Custom primer sequences" help="You can specify an alternative set of primer sequences to search for when trimming by adding a FASTA file containing the primer sequences you want to search for. The record names of the sequences do not matter. Note that if you use this option the normal primer sequences built-in to the dorado software will not be searched for."/>
<conditional name="trim_primers">
<param argument="--no-trim-primers" type="select" label="Enable primer trimming" help="Selecting 'No' prevents the trimming of primer sequences. In this case only adapter sequences will be trimmed.">
<option value="trim" selected="true">Yes</option>
<option value="dont_trim">No</option>
</param>
<when value="trim">
<param argument="--primer-sequences" type="data" format="fasta" optional="true" label="Custom primer sequences" help="You can specify an alternative set of primer sequences to search for when trimming by adding a FASTA file containing the primer sequences you want to search for. The record names of the sequences do not matter. Note that if you use this option the normal primer sequences built-in to the dorado software will not be searched for."/>
</when>
<when value="dont_trim"/>
</conditional>
</inputs>
<outputs>
<data format="unsorted.bam" name="out_bam" label="Reads from ${on_string} trimmed by the ${tool.name} tool" from_work_dir="trimmed.bam"/>
Expand All @@ -43,20 +50,44 @@ trimmed.bam
<tests>
<test expect_num_outputs="2">
<param name="reads" value="FAL00375_473bf0ed_0.ten_reads.bam"/>
<output name="out_bam" ftype="unsorted.bam" file="dorado_trimming_test1.bam"/>
<output name="out_tsv" ftype="tsv" file="dorado_trimming_test1.tsv"/>
<output name="out_bam" ftype="unsorted.bam">
<assert_contents>
<has_size size="60725" delta="6000"/>
</assert_contents>
</output>
<output name="out_tsv" ftype="tsv">
<assert_contents>
<has_text text="002f231b-5d37-437f-a027-a2e8b872e73b"/>
</assert_contents>
</output>
</test>
<test expect_num_outputs="2">
<param name="reads" value="FAL00375_473bf0ed_0.ten_reads.bam"/>
<param name="no_trim_primers" value="True"/>
<output name="out_bam" ftype="unsorted.bam" file="dorado_trimming_test2.bam"/>
<output name="out_tsv" ftype="tsv" file="dorado_trimming_test2.tsv"/>
<param name="no_trim_primers" value="dont_trim"/>
<output name="out_bam" ftype="unsorted.bam">
<assert_contents>
<has_size size="60628" delta="6000"/>
</assert_contents>
</output>
<output name="out_tsv" ftype="tsv">
<assert_contents>
<has_text text="00777c4b-cbd6-4a79-8647-bbe5f5f3f3bf"/>
</assert_contents>
</output>
</test>
<test expect_num_outputs="2">
<param name="reads" value="lsk109_single_read.fastqsanger.gz" ftype="fastqsanger.gz"/>
<param name="primer_sequences" value="custom_primers.fasta.gz" ftype="fasta.gz"/>
<output name="out_bam" ftype="unsorted.bam" file="dorado_trimming_test3.bam"/>
<output name="out_tsv" ftype="tsv" file="dorado_trimming_test3.tsv"/>
<output name="out_bam" ftype="unsorted.bam">
<assert_contents>
<has_size size="798" delta="100"/>
</assert_contents>
</output>
<output name="out_tsv" ftype="tsv">
<assert_contents>
<has_text text="2f707b6e-0060-4f33-9c92-a1230d26cb21"/>
</assert_contents>
</output>
</test>
</tests>
<help><![CDATA[
Expand All @@ -75,8 +106,9 @@ adapters and primers may result in some portions of the flanking regions
of the barcodes being removed, which could interfere with correct
demultiplexing.

The **Don't trim primers** option can be used to prevent the trimming of
primer sequences. In this case only adapter sequences will be trimmed.
The **Enable primer trimming** option can be set to 'No' to prevent the
trimming of primer sequences. If you select 'No', only adapter sequences will
be trimmed.

The output of will always be unaligned records, regardless of whether
the input is aligned/sorted or not.
Expand Down
Binary file removed tools/dorado/test-data/dorado_trimming_test1.bam
Binary file not shown.
11 changes: 0 additions & 11 deletions tools/dorado/test-data/dorado_trimming_test1.tsv

This file was deleted.

Binary file removed tools/dorado/test-data/dorado_trimming_test2.bam
Binary file not shown.
11 changes: 0 additions & 11 deletions tools/dorado/test-data/dorado_trimming_test2.tsv

This file was deleted.

Binary file removed tools/dorado/test-data/dorado_trimming_test3.bam
Binary file not shown.
2 changes: 0 additions & 2 deletions tools/dorado/test-data/dorado_trimming_test3.tsv

This file was deleted.

Loading