comparison batch.xml @ 0:e3bbe8171af9 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cnvkit commit c35b83e4b65b211377c9f616c77d7306da48a984
author iuc
date Sun, 14 May 2023 20:10:48 +0000
parents
children 4653aeb60243
comparison
equal deleted inserted replaced
-1:000000000000 0:e3bbe8171af9
1 <tool id="cnvkit_batch" name="CNVkit Batch" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
2 <description>Run the CNVkit pipeline on one or more BAM files</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="xrefs"/>
7 <expand macro="requirements"/>
8 <command detect_errors="exit_code"><![CDATA[
9 ln -s '$CNV_reference.input_sample_file' ./tumor.bam &&
10 ln -s '$CNV_reference.input_sample_file.metadata.bam_index' ./tumor.bam.bai &&
11 #if str($CNV_reference.CNV_reference_availabel) == "yes":
12 ln -s '$CNV_reference.reference' ./reference.cnn &&
13 #end if
14 #if str($CNV_reference.CNV_reference_availabel) == "no":
15 ln -s '$CNV_reference.normal' ./normal.bam &&
16 ln -s '$CNV_reference.normal.metadata.bam_index' ./normal.bam.bai &&
17 #if $CNV_reference.advanced_settings.antitargets
18 ln -s '$CNV_reference.advanced_settings.antitargets' ./antitargets.bed &&
19 #end if
20 #if $CNV_reference.advanced_settings.annotate
21 ln -s '$CNV_reference.advanced_settings.annotate' ./annotate.bed &&
22 #end if
23 #if $CNV_reference.advanced_settings.access
24 ln -s '$CNV_reference.advanced_settings.access' ./access.bed &&
25 #end if
26 ln -s '$CNV_reference.targets' ./capture.bed &&
27 #if str($CNV_reference.reference_source.ref_selector) == 'history':
28 ln -s '$CNV_reference.reference_source.fasta' ./genome.fa &&
29 samtools faidx ./genome.fa 2>&1 || echo 'Error running samtools faidx for indexing fasta reference for CNVkit' >&2 &&
30 #else
31 ln -s '$CNV_reference.reference_source.fasta.fields.path' ./genome.fa &&
32 ln -s '${CNV_reference.reference_source.fasta.fields.path}.fai' ./genome.fa.fai &&
33 #end if
34 #end if
35 #import os
36 cnvkit.py batch
37 ./tumor.bam
38 #if str($CNV_reference.CNV_reference_availabel) == "no":
39 --normal ./normal.bam
40 --targets ./capture.bed
41 --fasta ./genome.fa
42 #if $CNV_reference.advanced_settings.antitargets
43 --antitargets ./antitargets.bed
44 #end if
45 #if $CNV_reference.advanced_settings.annotate
46 --annotate ./annotate.bed
47 #end if
48 #if $CNV_reference.advanced_settings.access
49 --access ./access.bed
50 #end if
51 #end if
52 #if str($CNV_reference.CNV_reference_availabel) == "yes":
53 --reference ./reference.cnn
54 #end if
55 $output_section.scatter
56 $output_section.diagram
57 --processes \${GALAXY_SLOTS:-4}
58 #if $CNV_reference.advanced_settings.method == "hybrid"
59 #set $method_val = "hybrid"
60 --method '$method_val'
61 #else
62 --method '$CNV_reference.advanced_settings.method'
63 #end if
64
65 #if $CNV_reference.advanced_settings.segment_method == "cbs"
66 #set $segment_method_val = "cbs"
67 --segment-method '$segment_method_val'
68 #else
69 --segment-method '$CNV_reference.advanced_settings.segment_method'
70 #end if
71 $CNV_reference.advanced_settings.male_reference
72 $CNV_reference.advanced_settings.countreads
73 $CNV_reference.advanced_settings.drop_low_coverage
74
75 #if str($CNV_reference.CNV_reference_availabel) == "no":
76 $CNV_reference.advanced_settings.short_names
77 #if str($CNV_reference.advanced_settings.target_avg_size)
78 --target-avg-size $CNV_reference.advanced_settings.target_avg_size
79 #end if
80 #if str($CNV_reference.advanced_settings.antitarget_avg_size)
81 --antitarget-avg-size $CNV_reference.advanced_settings.antitarget_avg_size
82 #end if
83 #if str($CNV_reference.advanced_settings.antitarget_min_size)
84 --antitarget-min-size $CNV_reference.advanced_settings.antitarget_min_size
85 #end if
86 $CNV_reference.advanced_settings.cluster
87 #end if
88 ]]></command>
89 <inputs>
90 <conditional name="CNV_reference">
91 <param name="CNV_reference_availabel" type="select" label="Build or reuse a copy number reference file (.cnn)?" help="">
92 <option value="no" selected="True">Build a new copy number reference file</option>
93 <option value="yes">Reuse a copy number reference file</option>
94 </param>
95 <when value="no">
96 <expand macro="create_CNV_reference_file" />
97 <expand macro="reference_interface" />
98 <section name="advanced_settings" title="Advanced settings" expanded="false">
99 <expand macro="advanced_no_reference" />
100 <expand macro="shared" />
101 </section>
102 </when>
103 <when value="yes">
104 <expand macro="reuse_an_existing_cnv_reference_file" />
105 <section name="advanced_settings" title="Advanced settings" expanded="false">
106 <expand macro="shared" />
107 </section>
108 </when>
109 </conditional>
110 <expand macro="output_section" />
111 </inputs>
112 <outputs>
113 <data name="out_sample_bintest" format="tabular" label="${tool.name} on ${on_string}: Sample Bintest" from_work_dir="tumor.bintest.cns" />
114 <data name="out_sample_antitargetcoverage" format="tabular" label="${tool.name} on ${on_string}: Sample Antitarget Coverage" from_work_dir="tumor.antitargetcoverage.cnn" />
115 <data name="out_sample_call" format="tabular" label="${tool.name} on ${on_string}: rounded absolute scale copy numbers integer (not log2 ratios) " from_work_dir="tumor.call.cns" />
116 <data name="out_sample_targetcoverage_cnn" format="tabular" label="${tool.name} on ${on_string}: Sample Target Coverage" from_work_dir="tumor.targetcoverage.cnn" />
117 <data name="out_sample_cns" format="tabular" label="${tool.name} on ${on_string}: CN segmentation calls" from_work_dir="tumor.cns" />
118 <data name="out_sample_cnr" format="tabular" label="${tool.name} on ${on_string}: Bin-Level log2 Ratios/Coverages" from_work_dir="tumor.cnr" />
119 <data name="out_capture_antitarget" format="bed" label="${tool.name} on ${on_string}: Capture Antitarget" from_work_dir="capture.antitarget.bed">
120 <filter>(CNV_reference['CNV_reference_availabel']) == 'no'</filter>
121 </data>
122 <data name="out_control_targetcoverage" format="tabular" label="${tool.name} on ${on_string}: Output Normal Sample Target Coverage" from_work_dir="normal.targetcoverage.cnn">
123 <filter>(CNV_reference['CNV_reference_availabel']) == 'no'</filter>
124 </data>
125 <data name="out_control_antitargetcoverage" format="tabular" label="${tool.name} on ${on_string}: Output Normal Sample Antitarget Coverage" from_work_dir="normal.antitargetcoverage.cnn">
126 <filter>(CNV_reference['CNV_reference_availabel']) == 'no'</filter>
127 </data>
128 <data name="out_reference_cnn" format="tabular" label="${tool.name} on ${on_string}: Output Copy Number Reference Profile" from_work_dir="reference.cnn">
129 <filter>(CNV_reference['CNV_reference_availabel']) == 'no'</filter>
130 </data>
131 <data name="out_capture_target" format="bed" label="${tool.name} on ${on_string}: Output Capture Target" from_work_dir="capture.target.bed">
132 <filter>(CNV_reference['CNV_reference_availabel']) == 'no'</filter>
133 </data>
134 <data name="out_reference_target_bed" format="tabular" label="${tool.name} on ${on_string}: Output Reference Target" from_work_dir="reference.target-tmp.bed">
135 <filter>(CNV_reference['CNV_reference_availabel']) == 'yes'</filter>
136 </data>
137 <data name="out_reference_antitarget_bed" format="bed" label="${tool.name} on ${on_string}: Output Reference Antitarget" from_work_dir="reference.antitarget-tmp.bed">
138 <filter>(CNV_reference['CNV_reference_availabel']) == 'yes'</filter>
139 </data>
140 <data name="out_sample_diagram_pdf" format="pdf" label="${tool.name} on ${on_string}: Output Sample Diagram" from_work_dir="tumor-diagram.pdf">
141 <filter>output_section['diagram']</filter>
142 </data>
143 <data name="out_sample_scatter_png" format="png" label="${tool.name} on ${on_string}: Output Sample Scatter " from_work_dir="tumor-scatter.png">
144 <filter>output_section['scatter']</filter>
145 </data>
146 </outputs>
147 <tests>
148 <test expect_num_outputs="13">
149 <conditional name="reference_source">
150 <param name="ref_selector" value="history"/>
151 <param name="fasta" ftype="fasta" value="genome.fasta" />
152 </conditional>
153 <param name="CNV_reference_availabel" value="no" />
154 <param name="input_sample_file" ftype="bam" value="tumor.bam" />
155 <param name="normal" ftype="bam" value="normal.bam" />
156 <param name="targets" ftype="bed" value="capture.bed" />
157 <param name="scatter" value="1"/>
158 <param name="diagram" value="1"/>
159 <output name="out_sample_bintest" file="tumor.bintest.cns" />
160 <output name="out_sample_antitargetcoverage">
161 <assert_contents><has_text text="chromosome"/></assert_contents>
162 </output>
163 <output name="out_sample_call">
164 <assert_contents><has_text text="chromosome"/></assert_contents>
165 </output>
166 <output name="out_sample_cnr">
167 <assert_contents><has_text text="chromosome"/></assert_contents>
168 </output>
169 <output name="out_sample_targetcoverage_cnn">
170 <assert_contents><has_text text="chromosome"/></assert_contents>
171 </output>
172 <output name="out_sample_cns">
173 <assert_contents><has_text text="chromosome"/></assert_contents>
174 </output>
175 <output name="out_capture_antitarget" file="capture.antitarget.bed" />
176 <output name="out_control_targetcoverage" file="normal.targetcoverage.cnn" />
177 <output name="out_control_antitargetcoverage" file="normal.antitargetcoverage.cnn" />
178 <output name="out_reference_cnn" file="reference.cnn" />
179 <output name="out_capture_target">
180 <assert_contents><has_text_matching expression="chrM"/></assert_contents>
181 </output>
182 <output name="out_sample_scatter_png" file="tumor-scatter.png" ftype="png" compare="sim_size">
183 <assert_contents><has_size value="13000" delta="3000" /></assert_contents>
184 </output>
185 <output name="out_sample_diagram_pdf" file="tumor-diagram.pdf" ftype="pdf" compare="sim_size">
186 <assert_contents><has_size value="6000" delta="2000" /></assert_contents>
187 </output>
188 </test>
189 <test expect_num_outputs="13">
190 <conditional name="reference_source">
191 <param name="ref_selector" value="cached"/>
192 <param name="fasta" value="test_buildid"/>
193 </conditional>
194 <param name="CNV_reference_availabel" value="no" />
195 <param name="input_sample_file" ftype="bam" value="tumor.bam" />
196 <param name="normal" ftype="bam" value="normal.bam" />
197 <param name="targets" ftype="bed" value="capture.bed" />
198 <param name="scatter" value="1"/>
199 <param name="diagram" value="1"/>
200 <output name="out_sample_bintest" file="tumor.bintest.cns" />
201 <output name="out_sample_antitargetcoverage">
202 <assert_contents><has_text text="chromosome"/></assert_contents>
203 </output>
204 <output name="out_sample_call">
205 <assert_contents><has_text text="chromosome"/></assert_contents>
206 </output>
207 <output name="out_sample_cnr">
208 <assert_contents><has_text text="chromosome"/></assert_contents>
209 </output>
210 <output name="out_sample_targetcoverage_cnn">
211 <assert_contents><has_text text="chromosome"/></assert_contents>
212 </output>
213 <output name="out_sample_cns">
214 <assert_contents><has_text text="chromosome"/></assert_contents>
215 </output>
216 <output name="out_capture_antitarget" file="capture.antitarget.bed" />
217 <output name="out_control_targetcoverage" file="normal.targetcoverage.cnn" />
218 <output name="out_control_antitargetcoverage" file="normal.antitargetcoverage.cnn" />
219 <output name="out_reference_cnn" file="reference.cnn" />
220 <output name="out_capture_target">
221 <assert_contents><has_text_matching expression="chrM"/></assert_contents>
222 </output>
223 <output name="out_sample_scatter_png" file="tumor-scatter.png" ftype="png" compare="sim_size">
224 <assert_contents><has_size value="13000" delta="3000" /></assert_contents>
225 </output>
226 <output name="out_sample_diagram_pdf" file="tumor-diagram.pdf" ftype="pdf" compare="sim_size">
227 <assert_contents><has_size value="6000" delta="2000" /></assert_contents>
228 </output>
229 </test>
230 <test expect_num_outputs="10">
231 <param name="CNV_reference_availabel" value="yes" />
232 <param name="input_sample_file" ftype="bam" value="tumor.bam" />
233 <param name="reference" ftype="tabular" value="reference.cnn" />
234 <param name="scatter" value="1"/>
235 <param name="diagram" value="1"/>
236 <output name="out_sample_bintest" file="tumor.bintest.cns" />
237 <output name="out_sample_antitargetcoverage">
238 <assert_contents><has_text text="chromosome"/></assert_contents>
239 </output>
240 <output name="out_sample_call">
241 <assert_contents><has_text text="chromosome"/></assert_contents>
242 </output>
243 <output name="out_sample_cnr">
244 <assert_contents><has_text text="chromosome"/></assert_contents>
245 </output>
246 <output name="out_sample_targetcoverage_cnn">
247 <assert_contents><has_text text="chromosome"/></assert_contents>
248 </output>
249 <output name="out_sample_cns">
250 <assert_contents><has_text text="chromosome"/></assert_contents>
251 </output>
252 <output name="out_reference_target_bed" file="reference.target-tmp.bed" />
253 <output name="out_reference_antitarget_bed" file="reference.antitarget-tmp.bed" />
254 <output name="out_sample_diagram_pdf" file="tumor-diagram.pdf" ftype="pdf" compare="sim_size">
255 <assert_contents><has_size value="6000" delta="2000" /></assert_contents>
256 </output>
257 <output name="out_sample_scatter_png" file="tumor-scatter.png" ftype="png" compare="sim_size">
258 <assert_contents><has_size value="13000" delta="3000" /></assert_contents>
259 </output>
260 </test>
261 </tests>
262 <help><![CDATA[
263 CNVkit pipeline for copy-number changes and allelic imbalances detection
264 cnn, cnr and cns are tabuler files extintions:
265
266 The reference .cnn file has the columns:
267 chromosome, Start, end, gene, GC content of the sequence region (gc), RepeatMasker-masked proportion
268 of the sequence region (rmask), Statistical spread or dispersion (spread), Robust average of coverage
269 depths (log2 ) and Robust average of absolute-scale coverage depths without any bias corrections (depth)
270
271 Target and antitarget bin-level coverages (.cnn)
272 chromosome, Start, end, gene, log2 and depth
273
274 Bin-level log2 ratios (.cnr)
275 chromosome, Start, end, gene, log2, depth and proportional weight or reliability (weight)
276
277 Segmented log2 ratios (.cns)
278 chromosome, Start, end, gene, log2, depth, weight and number of bins covered by the segment (probes)
279
280
281 ]]></help>
282 <expand macro="citations" />
283 </tool>