comparison sam2rma.xml @ 0:4f0a8e401e2e draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/megan commit 5386f7bb4bf5bdd4b5303d0686c97fe5d9b99ca0"
author iuc
date Sat, 11 Dec 2021 11:52:57 +0000
parents
children ef0443c0eaba
comparison
equal deleted inserted replaced
-1:000000000000 0:4f0a8e401e2e
1 <tool id="megan_sam2rma" name="MEGAN: Generate a MEGAN rma6 file" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>from a DIAMOND or MALT sam file</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="bio_tools"/>
7 <expand macro="requirements"/>
8 <command detect_errors="exit_code"><![CDATA[
9 #import re
10
11 #if str($input_type_cond.input_type) in ['single', 'pair']:
12 #set read1 = $input_type_cond.read1
13 #set sam1 = $input_type_cond.sam1
14 #else:
15 ## Processing paired reads are tricky if we're
16 ## downstream from MALT. MALT doesn’t have a
17 ## paired-read mode, so it won’t attempt to analyze
18 ## reads in pairs. To do paired read processing,
19 ## set MALT to generate SAM files and then import the
20 ## SAM files into MEGAN, specifying paired read mode
21 ## there. If you have multiple SAM files for the same
22 ## sample, then import them all at the same time to
23 ## create one unified rma6 file.
24
25 #set read1 = $input_type_cond.reads_collection['forward']
26 #set sam1 = $input_type_cond.sam1
27 #end if
28
29 #if $read1.is_of_type('fasta', 'fasta.gz'):
30 #set read_ext = '.fasta'
31 #else:
32 #set read_ext = '.fastq'
33 #end if
34 #if $read1.ext.endswith('.gz'):
35 #set read_ext = $read_ext + '.gz'
36 #end if
37
38 #set read1_identifier = 'read1' + $read_ext
39 ln -s '${read1}' '${read1_identifier}' &&
40
41 #set sam1_identifier = 'sam1.' + $sam1.ext
42 ln -s '${sam1}' '${sam1_identifier}' &&
43
44 #if str($input_type_cond.input_type) in ['pair', 'paired']:
45 #if str($input_type_cond.input_type) == 'pair':
46 #set read2 = $input_type_cond.read2
47 #set sam2 = $input_type_cond.sam2
48 #else if str($input_type_cond.input_type) == 'paired':
49 #set read2 = $input_type_cond.reads_collection['reverse']
50 #set sam2 = $input_type_cond.sam2
51 #end if
52 #set read2_identifier = 'read2' + $read_ext
53 ln -s '${read2}' '${read2_identifier}' &&
54 #set sam2_identifier = 'sam2.' + $sam2.ext
55 ln -s '${sam2}' '${sam2_identifier}' &&
56 #end if
57
58 ## The output must be a directory when we have multiple
59 ## inputs, and the outputs inherit the base name of the
60 ## inputs.
61
62 sam2rma
63 #if str($input_type_cond.input_type) == 'single':
64 --in '${sam1_identifier}'
65 --reads '${read1_identifier}'
66 --out '${output_single}'
67 #else if str($input_type_cond.input_type) == 'pair':
68 --in '${sam1_identifier}' '${sam2_identifier}'
69 --reads '${read1_identifier}' '${read2_identifier}'
70 --paired
71 --pairedSuffixLength $input_type_cond.pairedSuffixLength
72 --out '.'
73 #else if str($input_type_cond.input_type) == 'paired':
74 --in '${sam1_identifier}' '${sam2_identifier}'
75 --reads '${read1_identifier}' '${read2_identifier}'
76 --paired
77 --pairedSuffixLength $input_type_cond.pairedSuffixLength
78 ## Strangely, megan requires an output
79 ## directory when processing paired reads
80 ## even though it produces a single file.
81 ## We'll accommodate thie by prepending ./
82 ## to a temporary output file and then move
83 ## it later.
84 --out '.'
85 #end if
86 #if $advanced_options.metaDataFile:
87 --metaDataFile '$advanced_options.metaDataFile'
88 #end if
89 #if str($advanced_options.paired_reads_cond.paired_reads) == 'yes':
90 --paired
91 $advanced_options.paired_reads_cond.pairedSuffixLength
92 #end if
93 $advanced_options.longReads
94 --maxMatchesPerRead $advanced_options.maxMatchesPerRead
95 $advanced_options.classify
96 --minScore $advanced_options.minScore
97 --maxExpected $advanced_options.maxExpected
98 --topPercent $advanced_options.topPercent
99 --minSupportPercent $advanced_options.minSupportPercent
100 --minSupport $advanced_options.minSupport
101 --minPercentReadCover $advanced_options.minPercentReadCover
102 --minPercentReferenceCover $advanced_options.minPercentReferenceCover
103 --minReadLength $advanced_options.minReadLength
104 --lcaAlgorithm '$advanced_options.lcaAlgorithm'
105 --lcaCoveragePercent $advanced_options.lcaCoveragePercent
106 --readAssignmentMode '$advanced_options.readAssignmentMode'
107 #if $advanced_options.conFile:
108 --conFile '$advanced_options.conFile'
109 #end if
110 #if $advanced_options.mapDB:
111 --mapDB '$advanced_options.mapDB'
112 #end if
113 #if str($advanced_options.only) != '':
114 --only '$advanced_options.only'
115 #end if
116 --useCompression 'false'
117 --threads \${GALAXY_SLOTS:-8}
118 --tempStoreDir '.'
119 #if str($input_type_cond.input_type) in ['pair', 'paired']:
120 && mv 'sam1.rma6' '$output_forward'
121 && mv 'sam2.rma6' '$output_reverse'
122 #end if
123 ]]></command>
124 <inputs>
125 <conditional name="input_type_cond">
126 <param name="input_type" type="select" label="Choose the category of the reads files to be analyzed">
127 <option value="single" selected="true">Single dataset</option>
128 <option value="pair">Dataset pair</option>
129 <option value="paired">List of dataset pairs</option>
130 </param>
131 <when value="single">
132 <param name="read1" type="data" format="fasta,fasta.gz,fastqsanger.gz,fastqsanger" label="Forward read file" help="This read file should be the one used by DIAMOND or MALT to generate the SAM file below"/>
133 <param name="sam1" type="data" format="sam" label="Output file of DIAMOND or MALT on input forward read file"/>
134 </when>
135 <when value="pair">
136 <param name="read1" type="data" format="fasta,fasta.gz,fastqsanger.gz,fastqsanger" label="Forward read file" help="This read file should be the one used by DIAMOND or MALT to generate the SAM file below"/>
137 <param name="sam1" type="data" format="sam" label="Output file of DIAMOND or MALT on input forward read file"/>
138 <param name="read2" type="data" format="fasta,fasta.gz,fastqsanger.gz,fastqsanger" label="Reverse read file" help="This read file should be the one used by DIAMOND or MALT to generate the SAM file below"/>
139 <param name="sam2" type="data" format="sam" label="Output file of DIAMOND or MALT on input reverse read file"/>
140 <param argument="--pairedSuffixLength" type="integer" value="0" label="Length of name suffix used to distinguish read names" help="Use 0 if read and mate have the same name"/>
141 </when>
142 <when value="paired">
143 <param name="reads_collection" type="data_collection" format="fasta,fasta.gz,fastqsanger,fastqsanger.gz" collection_type="paired" label="Collection of paired read files"/>
144 <param name="sam1" type="data" format="sam" label="Output file of DIAMOND or MALT on input forward read file"/>
145 <param name="sam2" type="data" format="sam" label="Output file of DIAMOND or MALT on input reverse read file"/>
146 <param argument="--pairedSuffixLength" type="integer" value="0" label="Length of name suffix used to distinguish read names" help="Use 0 if read and mate have the same name"/>
147 </when>
148 </conditional>
149 <section name="advanced_options" title="Advanced options" expanded="false">
150 <param argument="--metaDataFile" type="data" format="tabular" multiple="true" optional="true" label="Files containing metadata to be included in the output files"/>
151 <conditional name="paired_reads_cond">
152 <param name="paired_reads" type="select" label="DAA file was created using paired reads?">
153 <option value="no" selected="true">no</option>
154 <option value="yes">Yes</option>
155 </param>
156 <when value="no"/>
157 <when value="yes">
158 <param argument="--pairedSuffixLength" type="integer" value="0" label="Length of name suffix used to distinguish read names" help="Use 0 if read and mate have the same name"/>
159 </when>
160 </conditional>
161 <expand macro="long_reads_param"/>
162 <expand macro="max_matches_per_read_param"/>
163 <expand macro="classify_param"/>
164 <expand macro="min_score_param"/>
165 <expand macro="max_expected_param"/>
166 <expand macro="top_percent_param"/>
167 <expand macro="min_max_params"/>
168 <expand macro="lca_params"/>
169 <expand macro="read_assignment_mode_param"/>
170 <expand macro="con_file_param"/>
171 <expand macro="mapdb_param"/>
172 <expand macro="only_named_classifications_param"/>
173 </section>
174 </inputs>
175 <outputs>
176 <data name="output_single" format="rma6">
177 <filter>input_type_cond['input_type'] == 'single'</filter>
178 </data>
179 <data name="output_forward" format="rma6" label="${tool.name} on ${on_string} (forward">
180 <filter>input_type_cond['input_type'] != 'single'</filter>
181 </data>
182 <data name="output_reverse" format="rma6" label="${tool.name} on ${on_string} (reverse)">
183 <filter>input_type_cond['input_type'] != 'single'</filter>
184 </data>
185 </outputs>
186 <tests>
187 <!-- Single dataset input -->
188 <test expect_num_outputs="1">
189 <param name="sam1" ftype="sam" value="input1.sam"/>
190 <param name="read1" ftype="fastqsanger.gz" value="13-1941-6_S4_L001_R1_600000.fastq.gz"/>
191 <output name="output_single" ftype="rma6">
192 <assert_contents>
193 <has_size value="885"/>
194 </assert_contents>
195 </output>
196 </test>
197 <!-- Dataset pair input -->
198 <test expect_num_outputs="2">
199 <param name="input_type" value="pair"/>
200 <param name="read1" value="13-1941-6_S4_L001_R1_600000.fastq.gz" ftype="fastqsanger.gz"/>
201 <param name="sam1" value="input1.sam" ftype="sam"/>
202 <param name="read2" value="13-1941-6_S4_L001_R2_600000.fastq.gz" ftype="fastqsanger.gz"/>
203 <param name="sam2" value="input2.sam" ftype="sam"/>
204 <output name="output_forward" ftype="rma6">
205 <assert_contents>
206 <has_size value="805"/>
207 </assert_contents>
208 </output>
209 <output name="output_reverse" ftype="rma6">
210 <assert_contents>
211 <has_size value="805"/>
212 </assert_contents>
213 </output>
214 </test>
215 <!-- List of dataset pairs input -->
216 <test expect_num_outputs="2">
217 <param name="input_type" value="paired"/>
218 <param name="reads_collection">
219 <collection type="paired">
220 <element name="forward" value="13-1941-6_S4_L001_R1_600000.fastq.gz"/>
221 <element name="reverse" value="13-1941-6_S4_L001_R2_600000.fastq.gz"/>
222 </collection>
223 </param>
224 <param name="sam1" value="input1.sam" ftype="sam"/>
225 <param name="sam2" value="input2.sam" ftype="sam"/>
226 <output name="output_forward" ftype="rma6">
227 <assert_contents>
228 <has_size value="805"/>
229 </assert_contents>
230 </output>
231 <output name="output_reverse" ftype="rma6">
232 <assert_contents>
233 <has_size value="805"/>
234 </assert_contents>
235 </output>
236 </test>
237 </tests>
238 <help>
239 **What it does**
240
241 Generates a MEGAN RMA (RealMedia Audio) file from a SAM file that was generated by DIAMOND or MALT. MEGAN uses an
242 update of the original RMA file format known as RMA6.
243
244 Inputs consist of reads in fasta or fasqsanger format (gzip compression is supported) and associated SAM files.
245 Each read file should have been used previously as the input to DIAMOND or MALT to produce the associated SAM file
246 for this tool.
247 </help>
248 <expand macro="citations"/>
249 </tool>