0
|
1 <tool id="pima_report" name="PIMA: summary report" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
|
|
2 <description></description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements"/>
|
|
7 <command detect_errors="exit_code"><![CDATA[
|
|
8 #import re
|
|
9
|
26
|
10 #if str($read_type_cond.read_type) == 'ont':
|
|
11 #set analysis_name = re.sub('[^\s\w\-]', '_', str($read_type_cond.ont_file.element_identifier))
|
25
|
12 #else:
|
26
|
13 #set analysis_name = re.sub('[^\s\w\-]', '_', str($read_type_cond.illumina_forward_read.element_identifier))
|
25
|
14 #end if
|
0
|
15 #set assembly_name = re.sub('[^\s\w\-]', '_', str($assembly_fasta_file.element_identifier))
|
2
|
16
|
12
|
17 #if str($bedtools_complementbed_file) not in ['None', '']:
|
|
18 #set bedtools_version = re.sub('[^\s\w\-]', '_', str($bedtools_complementbed_file.element_identifier))
|
|
19 #end if
|
|
20 #if str($blastn_features) not in ['None', '']:
|
|
21 #set blastn_version = re.sub('[^\s\w\-]', '_', str($blastn_features.element_identifier))
|
|
22 #end if
|
|
23 #if str($dnadiff_snps_file) not in ['None', '']:
|
|
24 #set dnadiff_version = re.sub('[^\s\w\-]', '_', str($dnadiff_snps_file.element_identifier))
|
|
25 #end if
|
26
|
26
|
|
27 ## All ONT samples are single-end reads, while all Illumina samples are
|
|
28 ## sets if paired reads. For ONT, we need both an assembly_fasta_file
|
|
29 ## which is produced by the medaka pipeline and and assembler_version_file
|
|
30 ## which is produced by flye. For Illumina we need only the assembly_fasta_file
|
|
31 ## which is produced by SPAdes since the version can be derived from it.
|
|
32 #if str($assembler_version_file) in ['None', '']:
|
|
33 ## We're analyzing a set of Illumina paired reads.
|
|
34 #set assembler_version = re.sub('[^\s\w\-]', '_', str($assembly_fasta_file.element_identifier))
|
|
35 #else:
|
|
36 ## We're analyzing an ONT sample.
|
21
|
37 #set assembler_version = re.sub('[^\s\w\-]', '_', str($assembler_version_file.element_identifier))
|
1
|
38 #end if
|
26
|
39
|
2
|
40 #if str($kraken2_report_file) not in ['None', '']:
|
|
41 #set kraken2_version = re.sub('[^\s\w\-]', '_', str($kraken2_report_file.element_identifier))
|
12
|
42 #end if
|
|
43 #if str($minimap2_bam_file) not in ['None', '']:
|
|
44 #set minimap2_version = re.sub('[^\s\w\-]', '_', str($minimap2_bam_file.element_identifier))
|
|
45 #end if
|
|
46 #if str($samtools_pileup_file) not in ['None', '']:
|
|
47 #set samtools_version = re.sub('[^\s\w\-]', '_', str($samtools_pileup_file.element_identifier))
|
|
48 #end if
|
|
49 #if str($varscan_vcf_file) not in ['None', '']:
|
|
50 #set varscan_version = re.sub('[^\s\w\-]', '_', str($varscan_vcf_file.element_identifier))
|
2
|
51 #end if
|
0
|
52
|
1
|
53 mkdir amr_matrix_png_dir &&
|
13
|
54 mkdir circos_png_dir &&
|
0
|
55 mkdir feature_bed_dir &&
|
|
56 mkdir feature_png_dir &&
|
|
57 mkdir mutation_regions_dir &&
|
|
58 touch 'pima_report.pdf' &&
|
|
59
|
1
|
60 #for $i in $amr_matrices_png:
|
|
61 #set file_name = $i.file_name
|
|
62 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
|
63 ln -s $i 'amr_matrix_png_dir/$identifier' &&
|
|
64 #end for
|
13
|
65 #for $i in $circos_png:
|
|
66 #set file_name = $i.file_name
|
|
67 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
|
68 ln -s $i 'circos_png_dir/$identifier' &&
|
|
69 #end for
|
0
|
70 #for $i in $features_bed:
|
|
71 #set file_name = $i.file_name
|
|
72 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
|
73 ln -s $i 'feature_bed_dir/$identifier' &&
|
|
74 #end for
|
|
75 #for $i in $features_png:
|
|
76 #set file_name = $i.file_name
|
|
77 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
|
78 ln -s $i 'feature_png_dir/$identifier' &&
|
|
79 #end for
|
|
80 #for $i in $mutation_regions:
|
|
81 #set file_name = $i.file_name
|
|
82 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
|
83 ln -s $i 'mutation_regions_dir/$identifier' &&
|
|
84 #end for
|
|
85
|
28
|
86 #if $lrn_risk_amr_collection:
|
|
87 #set lrn_risk_amr_file = 'lrn_risk_amr.tsv'
|
|
88 touch $lrn_risk_amr_file &&
|
|
89 #for $i in $lrn_risk_amr_collection:
|
|
90 cat $i >> $lrn_risk_amr_file &&
|
|
91 #end for
|
|
92 #end if
|
|
93
|
|
94 #if $lrn_risk_blacklist_collection:
|
|
95 #set lrn_risk_blacklist_file = 'lrn_risk_blacklist.tsv'
|
|
96 touch $lrn_risk_blacklist_file &&
|
|
97 #for $i in $lrn_risk_blacklist_collection:
|
|
98 cat $i >> $lrn_risk_blacklist_file &&
|
|
99 #end for
|
|
100 #end if
|
|
101
|
|
102 #if $lrn_risk_vf_collection:
|
|
103 #set lrn_risk_vf_file = 'lrn_risk_vf.tsv'
|
|
104 touch $lrn_risk_vf_file &&
|
|
105 #for $i in $lrn_risk_vf_collection:
|
|
106 cat $i >> $lrn_risk_vf_file &&
|
|
107 #end for
|
|
108 #end if
|
|
109
|
0
|
110 python '${__tool_directory__}/pima_report.py'
|
1
|
111 --amr_matrix_png_dir 'amr_matrix_png_dir'
|
|
112 --amr_deletions_file '$amr_deletions_file'
|
0
|
113 --analysis_name '$analysis_name'
|
|
114 --assembly_fasta_file '$assembly_fasta_file'
|
|
115 --assembly_name '$assembly_name'
|
12
|
116 #if str($bedtools_complementbed_file) not in ['None', '']:
|
|
117 --bedtools_version '$bedtools_version'
|
|
118 #end if
|
|
119 #if str($blastn_features) not in ['None', '']:
|
|
120 --blastn_version '$blastn_version'
|
|
121 #end if
|
13
|
122 --circos_png_dir 'circos_png_dir'
|
1
|
123 --compute_sequence_length_file '$compute_sequence_length_file'
|
0
|
124 --contig_coverage_file '$contig_coverage_file'
|
|
125 --dbkey '$aligned_sample.metadata.dbkey'
|
1
|
126 --dnadiff_snps_file '$dnadiff_snps_file'
|
12
|
127 #if str($dnadiff_snps_file) not in ['None', '']:
|
|
128 --dnadiff_version '$dnadiff_version'
|
|
129 #end if
|
18
|
130 --errors_file '$errors_file'
|
0
|
131 --feature_bed_dir 'feature_bed_dir'
|
|
132 --feature_png_dir 'feature_png_dir'
|
21
|
133 #if str($assembler_version_file) not in ['None', '']:
|
|
134 --assembler_version '$assembler_version'
|
26
|
135 #if str($read_type_cond.read_type) == 'ont':
|
21
|
136 ## Need to pass the tabular flye assembly file.
|
|
137 --flye_assembly_info_file '$assembler_version_file'
|
|
138 #end if
|
1
|
139 #end if
|
|
140 --genome_insertions_file '$genome_insertions_file'
|
26
|
141 #if str($read_type_cond.read_type) == 'ont':
|
|
142 ## We're analyzing a single-edn ONT sample.
|
|
143 #if $read_type_cond.ont_file.ext.endswith(".gz"):
|
|
144 --gzipped
|
|
145 #end if
|
|
146 --ont_file '$read_type_cond.ont_file'
|
|
147 #else:
|
|
148 ## We're analyzing a set of Illumina paired reads.
|
|
149 #if $read_type_cond.illumina_forward_read.ext.endswith(".gz"):
|
|
150 --gzipped
|
|
151 #end if
|
|
152 --illumina_forward_read_file '$read_type_cond.illumina_forward_read'
|
|
153 --illumina_reverse_read_file '$read_type_cond.illumina_reverse_read'
|
0
|
154 #end if
|
2
|
155 #if str($kraken2_report_file) not in ['None', '']:
|
|
156 --kraken2_report_file '$kraken2_report_file'
|
|
157 --kraken2_version '$kraken2_version'
|
|
158 #end if
|
28
|
159 #if $lrn_risk_amr_collection:
|
|
160 --lrn_risk_amr_file '$lrn_risk_amr_file'
|
|
161 #end if
|
|
162 #if $lrn_risk_blacklist_collection:
|
|
163 --lrn_risk_blacklist_file '$lrn_risk_blacklist_file'
|
|
164 #end if
|
|
165 #if $lrn_risk_vf_collection:
|
|
166 --lrn_risk_vf_file '$lrn_risk_vf_file'
|
|
167 #end if
|
12
|
168 #if str($minimap2_bam_file) not in ['None', '']:
|
|
169 --minimap2_version '$minimap2_version'
|
|
170 #end if
|
0
|
171 --mutation_regions_dir 'mutation_regions_dir'
|
|
172 --mutation_regions_bed_file '$mutation_regions_bed_file'
|
|
173 --pima_css '${__tool_directory__}/pima.css'
|
1
|
174 --plasmids_file '$plasmids_file'
|
13
|
175 --quast_report_file '$quast_report_file'
|
26
|
176 --read_type '$read_type_cond.read_type'
|
1
|
177 --reference_insertions_file '$reference_insertions_file'
|
12
|
178 #if str($samtools_pileup_file) not in ['None', '']:
|
|
179 --samtools_version '$samtools_version'
|
|
180 #end if
|
|
181 #if str($varscan_vcf_file) not in ['None', '']:
|
|
182 --varscan_version '$varscan_version'
|
|
183 #end if
|
0
|
184 && mv 'pima_report.pdf' '$output'
|
|
185 ]]></command>
|
|
186 <inputs>
|
1
|
187 <param name="amr_matrices_png" format="png" type="data_collection" collection_type="list" label="Collection of AMR matrix PNG files"/>
|
0
|
188 <param name="aligned_sample" type="data" format="bam" label="Aligned sample BAM file"/>
|
1
|
189 <param name="amr_deletions_file" type="data" format="bed" label="AMR deletions BED file"/>
|
0
|
190 <param name="assembly_fasta_file" type="data" format="fasta" label="Assembly FASTA file"/>
|
12
|
191 <param name="bedtools_complementbed_file" type="data" format="bed" label="Bedtools ComplementBed BED file"/>
|
4
|
192 <param name="blastn_features" format="tabular" type="data_collection" collection_type="list" label="Collection of blastn tabular files"/>
|
13
|
193 <param name="circos_png" format="png" type="data_collection" collection_type="list" label="Collection of circos PNG files"/>
|
1
|
194 <param name="compute_sequence_length_file" type="data" format="tabular,tsv" label="Compute sequence length tabular file"/>
|
|
195 <param name="contig_coverage_file" type="data" format="tabular,tsv" label="Contig coverage tabular file"/>
|
|
196 <param name="dnadiff_snps_file" type="data" format="tabular" label="DNAdiff snps tabular file"/>
|
18
|
197 <param name="errors_file" type="data" format="txt" label="AMR mutation regions error txt file"/>
|
0
|
198 <param name="features_bed" format="bed" type="data_collection" collection_type="list" label="Collection of best feature hits BED files"/>
|
|
199 <param name="features_png" format="png" type="data_collection" collection_type="list" label="Collection of best feature hits PNG files"/>
|
21
|
200 <param name="assembler_version_file" type="data" format="fasta,tabular,tsv" optional="true" label="Assembly version file" help="Optional, ignored if not selected"/>
|
1
|
201 <param name="genome_insertions_file" type="data" format="bed" label="Genome insertions BED file"/>
|
2
|
202 <param name="kraken2_report_file" type="data" format="tabular,tsv" optional="true" label="Kraken2 report tabular file" help="Optional, ignored if not selected"/>
|
28
|
203 <param name="lrn_risk_amr_collection" format="tsv" type="data_collection" collection_type="list" optional="true" label="LRN Risk AMR collection"/>
|
|
204 <param name="lrn_risk_blacklist_collection" format="tsv" type="data_collection" collection_type="list" optional="true" label="LRN Risk blacklist collection"/>
|
|
205 <param name="lrn_risk_vf_collection" format="tsv" type="data_collection" collection_type="list" optional="true" label="LRN Risk virulence factors collection"/>
|
12
|
206 <param name="minimap2_bam_file" type="data" format="bam" label="Minimap2 BAM file"/>
|
0
|
207 <param name="mutation_regions" format="tabular,tsv" type="data_collection" collection_type="list" label="Collection of mutation regions tabular files"/>
|
|
208 <param name="mutation_regions_bed_file" type="data" format="mutations_regions,bed" label="Mutation regions BED file"/>
|
13
|
209 <param name="quast_report_file" type="data" format="tabular" label="Quast report tabular file"/>
|
26
|
210 <conditional name="read_type_cond">
|
|
211 <param argument="--read_type" type="select" label="Specify the read type">
|
|
212 <option value="ont" selected="true">ONT single read</option>
|
|
213 <option value="illumina">Illumina read pair</option>
|
|
214 </param>
|
|
215 <when value="ont">
|
|
216 <param name="ont_file" type="data" format="fastqsanger,fastqsanger.gz" label="ONT single read sample file"/>
|
|
217 </when>
|
|
218 <when value="illumina">
|
|
219 <param name="illumina_forward_read" format="fastqsanger,fastqsanger.gz" type="data" label="Illumina forward read sample file"/>
|
|
220 <param name="illumina_reverse_read" format="fastqsanger,fastqsanger.gz" type="data" label="Illumina reverse read sample file"/>
|
|
221 </when>
|
|
222 </conditional>
|
1
|
223 <param name="reference_insertions_file" type="data" format="bed" label="Reference insertions BED file"/>
|
23
|
224 <param name="plasmids_file" type="data" format="tsv" optional="true" label="pChunks plasmids TSV file" help="Optional, ignored if not selected"/>
|
12
|
225 <param name="samtools_pileup_file" type="data" format="pileup" label="Samtools pileup file"/>
|
|
226 <param name="varscan_vcf_file" type="data" format="vcf" label="Varscan VCF file"/>
|
0
|
227 </inputs>
|
|
228 <outputs>
|
|
229 <data name="output" format="pdf"/>
|
|
230 </outputs>
|
|
231 <tests>
|
|
232 <test>
|
|
233 <param name="aligned_sample" value="aligned_sample.bam" ftype="bam"/>
|
|
234 <param name="assembly_fasta_file" value="assembly_fasta.fasta" ftype="fasta"/>
|
|
235 <param name="contig_coverage_file" value="contig_coverage.tabular" ftype="tabular"/>
|
26
|
236 <param name="read_type" value="ont"/>
|
|
237 <param name="ont_file" value="ont_fastq.fastq" ftype="fastq"/>
|
0
|
238 <output name="output" value="output.pdf" ftype="pdf"/>
|
|
239 </test>
|
|
240 </tests>
|
|
241 <help>
|
|
242 **What it does**
|
|
243
|
|
244 Generates the PIMA analysis summary report.
|
|
245 </help>
|
|
246 <expand macro="citations"/>
|
|
247 </tool>
|
|
248
|