comparison ampligone.xml @ 0:d5fc5d888a46 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/ampligone commit 5bd763da003ce033467702f2fb4dca5264e0be43
author iuc
date Tue, 29 Jul 2025 10:18:37 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d5fc5d888a46
1 <tool id="ampligone" name="AmpliGone" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.2">
2 <description>Find and remove primers from NGS amplicon reads</description>
3 <macros>
4 <token name="@TOOL_VERSION@">2.0.1</token>
5 <token name="@VERSION_SUFFIX@">0</token>
6 </macros>
7 <requirements>
8 <requirement type="package" version="@TOOL_VERSION@">AmpliGone</requirement>
9 </requirements>
10 <version_command>ampligone --version</version_command>
11 <command detect_errors="exit_code"><![CDATA[
12 #import re
13
14 #set $inputs_map = {
15 'input': 'reads',
16 'reference': 'reference',
17 'primers': 'primers'
18 }
19
20 #for $key, $short in $inputs_map.items()
21 #set $ds = $inputs[$key]
22 #set $ext = re.sub("sanger", "", $ds.ext)
23 #set $is_gz = str($ds.ext).endswith('.gz') and $ext != 'bam'
24 #set $filename = $short + '.' + $ext
25
26 ln -sf '$ds' '$filename' &&
27 #silent $inputs_map[$key] = $filename
28
29 #if $key == 'input'
30 #set $output_name = 'output.fastq' + ('.gz' if $is_gz else '')
31 touch '$cleaned' &&
32 ln -sf '$cleaned' $output_name &&
33 #end if
34 #end for
35
36 #if $inputs.primers.ext == 'fasta' and $inputs.export_primers == 'yes'
37 #set $primer_filename = 'primers.bed'
38 touch '$exp_prim' &&
39 ln -sf '$exp_prim' $primer_filename &&
40 #end if
41
42 ## --- Run the tool using clean and predictable filenames ---
43 ampligone
44 ##add input files
45 --input '$inputs_map['input']'
46 --reference '$inputs_map['reference']'
47 --primers '$inputs_map['primers']'
48
49 ## Compute options
50 --threads "\${GALAXY_SLOTS:-2}"
51
52 ##optional arguments
53
54 #if $opt_args.ampli_type.amplicon_type
55 --amplicon-type $opt_args.ampli_type.amplicon_type
56 #end if
57 #if $opt_args.ampli_type.amplicon_type == 'fragmented'
58 --fragment-lookaround-size $opt_args.ampli_type.fragment_lookaround_size
59 #end if
60 #if $opt_args.error_rate
61 --error-rate $opt_args.error_rate
62 #end if
63
64 ##output options
65 #if $inputs.primers.ext == 'fasta' and $inputs.export_primers == 'yes'
66 --export-primers '$primer_filename'
67 #end if
68
69 --output '$output_name'
70
71 ]]></command>
72 <inputs>
73 <section name="inputs" title="Inputs" expanded="true">
74 <param argument="--input" type="data" format="fastqsanger,fastqsanger.gz,bam" label="Input file" help="Input file with reads in FASTQ format."/>
75 <param argument="--reference" type="data" format="fasta" label="Reference genome" help="Input Reference genome in FASTA format." />
76 <param argument="--primers" type="data" format="fasta,bed" label="Used primer sequences" help="Used primer sequences in FASTA or BED format." />
77 <param argument="--export-primers" type="boolean" checked="false" truevalue="yes" falsevalue="no" optional="true" label="Output cut primers coordinates" help="Output BED file with found primer coordinates if they are actually cut from the reads."/>
78 </section>
79
80 <section name="opt_args" title="Optional Arguments" expanded="false">
81 <conditional name="ampli_type">
82 <param argument="--amplicon-type" type="select" label="Define the amplicon-type" help="Define the amplicon-type, either being 'end-to-end', 'end-to-mid', or 'fragmented'. See the docs for more info.">
83 <option value="end-to-end" selected="true">end-to-end</option>
84 <option value="end-to-mid">end-to-mid</option>
85 <option value="fragmented">fragmented</option>
86 </param>
87 <when value="fragmented">
88 <param argument="--fragment-lookaround-size" type="integer" value="10" optional="true" label="Fragment lookaround size" help="The number of bases to look around a primer-site to consider it part of a fragment." />
89 </when>
90 <when value="end-to-end"/>
91 <when value="end-to-mid"/>
92 </conditional>
93 <param argument="--error-rate" type="float" min="0" max="1" value="0.1" label="Error rate" help="The maximum allowed error rate for the primer search. Use 0 for exact primer matches." />
94 </section>
95 </inputs>
96
97 <outputs>
98 <data name="cleaned" format="fastqsanger" label="${tool.name} on ${inputs.input.name} ($on_string): Cleaned reads"/>
99 <data name="exp_prim" format="bed" label="${tool.name} on ${on_string}: Detected primer coordinates">
100 <filter>inputs['primers'].ext == 'fasta' and inputs['export_primers'] is True</filter>
101 </data>
102 </outputs>
103 <tests>
104 <test expect_num_outputs="1">
105 <section name="inputs">
106 <param name="input" value="sars-cov-2.fastq"/>
107 <param name="reference" value="SARS-CoV-2-reference.fasta"/>
108 <param name="primers" value="SARS-CoV-2-ARTIC-V5.3.2.scheme.bed" />
109 </section>
110 <output name="cleaned">
111 <assert_contents>
112 <has_text text="@SRR30635841.1"/>
113 <has_text text="@SRR30635841.2"/>
114 <has_text text="@SRR30635841.3"/>
115 <has_text text="@SRR30635841.4"/>
116 <has_text text="@SRR30635841.5"/>
117 </assert_contents>
118 </output>
119 </test>
120 <test expect_num_outputs="2">
121 <section name="inputs">
122 <param name="input" value="sars-cov-2.fastq"/>
123 <param name="reference" value="SARS-CoV-2-reference.fasta"/>
124 <param name="primers" value="ARTIC-V5.3.2.fasta" />
125 <param name="export_primers" value="yes"/>
126 </section>
127 <output name="cleaned">
128 <assert_contents>
129 <has_text text="@SRR30635841.1"/>
130 <has_text text="@SRR30635841.2"/>
131 <has_text text="@SRR30635841.3"/>
132 <has_text text="@SRR30635841.4"/>
133 <has_text text="@SRR30635841.5"/>
134 </assert_contents>
135 </output>
136 <output name="exp_prim">
137 <assert_contents>
138 <has_text text="MN908947.3:6204-6237_LEFT"/>
139 <has_text text="MN908947.3:25744-25777_RIGHT"/>
140 </assert_contents>
141 </output>
142 </test>
143 <test expect_num_outputs="1">
144 <section name="inputs">
145 <param name="input" value="synthetic.bam"/>
146 <param name="reference" value="synthetic.fasta"/>
147 <param name="primers" value="synthetic.bed" />
148 </section>
149 <output name="cleaned">
150 <assert_contents>
151 <has_text text="read_number_2_last_120_of_ref"/>
152 <has_text text="read_number_1_first_120_of_ref"/>
153 </assert_contents>
154 </output>
155 </test>
156 </tests>
157 <help><![CDATA[
158 **AmpliGone**
159
160 In contrast to a lot of other primer-removal tools, AmpliGone does not actively look for primer sequences within the NGS reads. When providing BED input, reads are trimmed based on primer sequence coordinates in relation to a given reference sequence. Additionally, AmpliGone is able to compensate for, and therefore properly clean, reads that start or end outside of a primer-region as this is a common occurrence in amplicon-based sequencing data.
161 AmpliGone works with both reads in FASTQ format, as well as aligned data in BAM-format. However, when data is presented in the BAM-format then only read-data (sequence and quality scores) will be used. Other data present in the BAM-format will not be used in this version of AmpliGone.
162
163 Currently, AmpliGone supports Nanopore data and Illumina data. The Illumina platform (NextSeq/MiSeq/HiSeq/other) does not matter.
164
165 It is however important that you know the read-length in relation to the amplicon length. AmpliGone expects this information in the form of an 'amplicon-type'.
166
167 AmpliGone is build and tested with Nanopore and Illumina data (fastq) in mind and supports 'end-to-end', 'end-to-mid' and 'fragmented' amplicons to be cleaned.
168
169
170 **More Information**
171
172 - **Official Repository**: https://github.com/RIVM-bioinformatics/AmpliGone
173 - **Extended User Guide**: https://rivm-bioinformatics.github.io/AmpliGone/@TOOL_VERSION@/
174
175 ]]></help>
176 <citations>
177 <citation type="doi">10.5281/zenodo.7684307</citation>
178 </citations>
179 </tool>