Skip to content

Commit

Permalink
cutadapt: make no_match_adapter_wildcards independent
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Nov 6, 2023
1 parent 439c877 commit b708043
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 5 deletions.
54 changes: 49 additions & 5 deletions tools/cutadapt/cutadapt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ cutadapt
--overlap=$adapter_options.overlap
$adapter_options.no_indels
$adapter_options.match_read_wildcards
$adapter_options.no_match_adapter_wildcards
--action=$adapter_options.action
$adapter_options.revcomp
Expand Down Expand Up @@ -224,11 +225,8 @@ $read_mod_options.zero_cap
<param argument="--no-indels" type="boolean" checked="false" truevalue="--no-indels" falsevalue="" label="Do not allow indels (Use ONLY with anchored 5' (front) adapters)." help="Do not allow indels in the alignments. That is, allow only mismatches. This option is currently only supported for anchored 5' adapters ('^ADAPTER') (default: both mismatches and indels are allowed)." />
<param argument="--times" type="integer" min="1" value="1" label="Match times" help="Try to remove adapters at most COUNT times. Useful when an adapter gets appended multiple times." />
<param argument="--overlap" type="integer" min="1" value="3" label="Minimum overlap length" help="Minimum overlap length. If the overlap between the adapter and the sequence is shorter than LENGTH, the read is not modified. This reduces the number of bases trimmed purely due to short random adapter matches." />
<param name="match_read_wildcards" type="select" label="Match wildcards" help="Allow 'N's as matches. Default: in the adapters but not in the reads">
<option value=" " selected="true">In the adapters but not in the reads</option>
<option value="--match-read-wildcards">In the adapters and in the reads</option>
<option value="--no-match-adapter-wildcards">Nowhere</option>
</param>
<param argument="--match-read-wildcards" type="boolean" checked="false" truevalue="--match-read-wildcards" falsevalue="" label="Match wilcards in reads" help="Interpret IUPAC wildcards in reads"/>
<param argument="--no-match-adapter-wildcards" type="boolean" checked="true" truevalue="" falsevalue="--no-match-adapter-wildcards" label="Match wilcards in adapters" help="Interpret IUPAC wildcards in adapters."/>
<param argument="--revcomp" type="boolean" checked="false" truevalue="--revcomp" falsevalue="" label="Look for adapters in the reverse complement" help="Check both the read and its reverse complement for adapter matches. If match is on reverse-complemented version, output that one. Default: check only read." />
</section>

Expand Down Expand Up @@ -1268,6 +1266,52 @@ $read_mod_options.zero_cap
<has_text text="--max-expected-errors=0.9"/>
</assert_command>
</test>

<!-- https://github.com/marcelm/cutadapt/blob/3407ac0004d04b11ae7157934a6665ecaf82c328/tests/test_commandline.py#L335 -->
<test expect_num_outputs="3">
<param name="type" value="single" />
<param name="input_1" ftype="fasta" value="cutadapt/data/wildcard.fa" />
<section name="r1">
<repeat name="anywhere_adapters">
<conditional name="adapter_source">
<param name="adapter_source_list" value="user"/>
<param name="adapter" value="ACGTACGT"/>
</conditional>
</repeat>
</section>
<section name="adapter_options">
<param name="match_read_w" value="true"/>
</section>
<output name="out1" file="cutadapt/cut/wildcard.fa" ftype="fasta"/>
<assert_command>
<has_text text="--match-read-wildcards"/>
<has_text text="-b 'ACGTACGT'"/>
</assert_command>
</test>

<!-- https://github.com/marcelm/cutadapt/blob/3407ac0004d04b11ae7157934a6665ecaf82c328/tests/test_commandline.py#L368 -->
<test expect_num_outputs="3">
<param name="type" value="single" />
<param name="input_1" ftype="fasta" value="cutadapt/data/wildcardN.fa" />
<section name="r1">
<repeat name="anywhere_adapters">
<conditional name="adapter_source">
<param name="adapter_source_list" value="user"/>
<param name="adapter" value="GGGGGGG"/>
</conditional>
</repeat>
</section>
<section name="adapter_options">
<param name="match_read_w" value="true"/>
<param name="error_rate" value="0"/>
</section>
<output name="out1" file="cutadapt/cut/wildcardN.fa" ftype="fasta"/>
<assert_command>
<has_text text="--match-read-wildcards"/>
<has_text text="--error-rate 0.0"/>
<has_text text="-a 'GGGGGGG'"/>
</assert_command>
</test>
</tests>

<help><![CDATA[
Expand Down
4 changes: 4 additions & 0 deletions tools/cutadapt/test-data/cutadapt/cut/wildcard.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
>1
TGCATGCA
>2
TGCATGCA
6 changes: 6 additions & 0 deletions tools/cutadapt/test-data/cutadapt/cut/wildcardN.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
>perfect
TTT
>withN
TTT
>1mism
TTTGGGGCGG
4 changes: 4 additions & 0 deletions tools/cutadapt/test-data/cutadapt/data/wildcard.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
>1
ANGTACGTTGCATGCA
>2
ACGTANGTTGCATGCA
6 changes: 6 additions & 0 deletions tools/cutadapt/test-data/cutadapt/data/wildcardN.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
>perfect
TTTGGGGGGG
>withN
TTTGGNGGGG
>1mism
TTTGGGGCGG

0 comments on commit b708043

Please sign in to comment.