Skip to content

Commit

Permalink
Update cutadapt from version 4.8 to 4.9 (galaxyproject#6136)
Browse files Browse the repository at this point in the history
* Updating tools/cutadapt from version 4.8 to 4.9

* Add crop action and -L option support

* Fix length2 tests

* Fix R2 adapters use in tests

* Remove test sections that were ill-specified & never used

---------

Co-authored-by: planemo-autoupdate <[email protected]>
Co-authored-by: Björn Grüning <[email protected]>
  • Loading branch information
3 people authored Jul 8, 2024
1 parent f874a23 commit 8bdd212
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 19 deletions.
118 changes: 101 additions & 17 deletions tools/cutadapt/cutadapt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ $other_trimming_options.poly_a
--length=-$other_trimming_options.shorten_options.length
#end if
#end if
#if $paired and str($other_trimming_options.shorten_options_r2.shorten_values_r2) == 'True':
#if str($other_trimming_options.shorten_options_r2.shorten_end_r2) == '3prime'
-L $other_trimming_options.shorten_options_r2.length2
#else
-L -$other_trimming_options.shorten_options_r2.length2
#end if
#end if
$filter_options.discard_trimmed
$filter_options.discard_untrimmed
Expand Down Expand Up @@ -278,6 +285,7 @@ $read_mod_options.zero_cap
<option value="retain">Retain: the read is trimmed, but the adapter sequence is not removed</option>
<option value="mask">Mask: mask adapters with 'N' characters instead of trimming them</option>
<option value="lowercase">Lowercase: convert to lowercase</option>
<option value="crop">Crop: trim upstream and downstream sequences, i.e. retain adapter sequences only</option>
<option value="none">None: leave unchanged</option>
</param>
<param argument="--error-rate" type="float" min="0" max="1" value="0.1" label="Maximum error rate" help="Maximum allowed error rate (no. of errors divided by the length of the matching region)." />
Expand Down Expand Up @@ -321,6 +329,21 @@ $read_mod_options.zero_cap
<when value="False">
</when>
</conditional>
<conditional name="shorten_options_r2">
<param name="shorten_values_r2" type="select" label="Separate shortening of R2 reads to a fixed length?" help="For paired-end data, shortening of R2 reads can be handled separately. Ignored for single-end data.">
<option value="True">Separate shortening of R2 reads</option>
<option value="False" selected="true">Treat R2 reads the same as R1 reads</option>
</param>
<when value="True">
<param argument="-L" name="length2" type="integer" value="0" label="Length" help="Shorten R2 reads to this length. This modification is applied after adapter trimming." />
<param name="shorten_end_r2" type="select" label="End at which to apply the slice">
<option value="3prime">3' ends</option>
<option value="5prime">5' ends</option>
</param>
</when>
<when value="False">
</when>
</conditional>
</section>
<!-- Filter Options -->
<section name="filter_options" title="Read Filtering Options">
Expand Down Expand Up @@ -874,6 +897,22 @@ $read_mod_options.zero_cap
</section>
<output name="out1" file="cutadapt_action_lowercase.out" ftype="fastq"/>
</test>
<test expect_num_outputs="1">
<param name="type" value="single" />
<param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
<section name="r1">
<repeat name="adapters">
<conditional name="adapter_source">
<param name="adapter_source_list" value="user"/>
<param name="adapter" value="CGTCCGAANTAG"/>
</conditional>
</repeat>
</section>
<section name="adapter_options">
<param name="action" value="crop"/>
</section>
<output name="out1" file="cutadapt_action_crop.out" ftype="fastq"/>
</test>
<test expect_num_outputs="1">
<param name="type" value="single" />
<param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
Expand Down Expand Up @@ -907,7 +946,7 @@ $read_mod_options.zero_cap
</section>
<output name="out1" file="cutadapt_revcomp.out" ftype="fastq"/>
</test>
<!-- Test minimum lenghth paired-reads -->
<!-- Test minimum length paired-reads -->
<test expect_num_outputs="2">
<param name="type" value="paired" />
<param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1_assimetric.fq.gz" />
Expand Down Expand Up @@ -986,14 +1025,6 @@ $read_mod_options.zero_cap
</conditional>
</repeat>
</section>
<section name="r2">
<repeat name="adapters2">
<conditional name="adapter_source2">
<param name="adapter_source_list2" value="user"/>
<param name="adapter2" value="AGATCGGAAGAGC"/>
</conditional>
</repeat>
</section>
<section name="filter_options">
<param name="pair_filter" value="both"/>
<param name="minimum_length" value="10"/>
Expand All @@ -1020,14 +1051,6 @@ $read_mod_options.zero_cap
</conditional>
</repeat>
</section>
<section name="r2">
<repeat name="adapters2">
<conditional name="adapter_source2">
<param name="adapter_source_list2" value="user"/>
<param name="adapter2" value="AGATCGGAAGAGC"/>
</conditional>
</repeat>
</section>
<section name="filter_options">
<param name="pair_filter" value="both"/>
<param name="minimum_length" value="10"/>
Expand Down Expand Up @@ -1089,6 +1112,67 @@ $read_mod_options.zero_cap
</section>
<output name="out1" file="cutadapt_shorten_5prime.out" ftype="fastq"/>
</test>
<test expect_num_outputs="2">
<param name="type" value="paired" />
<param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
<section name="r1">
<repeat name="adapters">
<conditional name="adapter_source">
<param name="adapter_source_list" value="user"/>
<param name="adapter" value="AGCCGCTANGACG"/>
</conditional>
</repeat>
</section>
<section name="r2">
<repeat name="adapters2">
<conditional name="adapter_source">
<param name="adapter_source_list" value="user"/>
<param name="adapter" value="AGCCGCTANGACG"/>
</conditional>
</repeat>
</section>
<section name="other_trimming_options">
<conditional name="shorten_options">
<param name="shorten_values" value="True"/>
<param name="shorten_end" value="3prime"/>
<param name="length" value="10"/>
</conditional>
<conditional name="shorten_options_r2">
<param name="shorten_values_r2" value="True"/>
<param name="shorten_end_r2" value="5prime"/>
<param name="length2" value="10"/>
</conditional>
</section>
<section name="filter_options">
<param name="minimum_length" value="0"/>
</section>
<output name="out1" file="cutadapt_shorten_3prime.out" ftype="fastq"/>
<output name="out2" file="cutadapt_shorten_5prime.out" ftype="fastq"/>
</test>
<test expect_num_outputs="2">
<param name="type" value="paired" />
<param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
<section name="r2">
<repeat name="adapters2">
<conditional name="adapter_source">
<param name="adapter_source_list" value="user"/>
<param name="adapter" value="AGCCGCTANGACG"/>
</conditional>
</repeat>
</section>
<section name="other_trimming_options">
<conditional name="shorten_options_r2">
<param name="shorten_values_r2" value="True"/>
<param name="shorten_end_r2" value="3prime"/>
<param name="length2" value="10"/>
</conditional>
</section>
<section name="filter_options">
<param name="minimum_length" value="0"/>
</section>
<output name="out1" file="cutadapt_small.fastq" ftype="fastq"/>
<output name="out2" file="cutadapt_shorten_3prime.out" ftype="fastq"/>
</test>
<!-- Test max expected errors options -->
<test expect_num_outputs="1">
<param name="type" value="single" />
Expand Down
4 changes: 2 additions & 2 deletions tools/cutadapt/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<macros>
<token name="@TOOL_VERSION@">4.8</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@TOOL_VERSION@">4.9</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@FASTQ_TYPES@">fastq.bz2,fastq.gz,fastq,fasta.bz2,fasta.gz,fasta</token>
<xml name="edam_ontology">
<edam_topics>
Expand Down
12 changes: 12 additions & 0 deletions tools/cutadapt/test-data/cutadapt_action_crop.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@prefix:1_13_573/1
CGTCCGAANTAG
+
)3%)&&&&!.1&
@prefix:1_13_1259/1
AGCCGCTANGACGGGTTGGCCCTTAGACGTATCT
+
;<:&:A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
@prefix:1_13_1440/1
CAAGATCTNCCCTGCCACATTGCCCTAGTTAAAC
+
<=A:A=57!7<';<6?5;;6:+:=)71>70<,=:

0 comments on commit 8bdd212

Please sign in to comment.