Mercurial > repos > iuc > tb_profiler_profile
comparison tb_profiler_profile.xml @ 0:82d71ed440f6 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/tb-profiler commit 7dba70c70c9fe33353a0fd21803b11cfddc42c32
| author | iuc |
|---|---|
| date | Tue, 21 Oct 2025 10:24:35 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:82d71ed440f6 |
|---|---|
| 1 <tool id="tb_profiler_profile" name="TB-Profiler Profile" version="@TOOL_VERSION@+galaxy0" profile="20.09" license="AGPL-3.0-or-later"> | |
| 2 <description>Infer strain types and drug resistance markers from sequences</description> | |
| 3 | |
| 4 <macros> | |
| 5 <import>macros.xml</import> | |
| 6 </macros> | |
| 7 | |
| 8 <xrefs> | |
| 9 <xref type="bio.tools">tb-profiler</xref> | |
| 10 </xrefs> | |
| 11 | |
| 12 <requirements> | |
| 13 <requirement type="package" version="@TOOL_VERSION@">tb-profiler</requirement> | |
| 14 </requirements> | |
| 15 | |
| 16 <expand macro="version_command"/> | |
| 17 | |
| 18 <command detect_errors="exit_code"><![CDATA[ | |
| 19 #if str($fastq_or_bam.input_select.value) in ("paired_fastq", "paired_collection_fastq", "single_fastq") | |
| 20 #if str($fastq_or_bam.input_select.value) == "paired_fastq" | |
| 21 #set r1_ext = $fastq_or_bam.read1.extension | |
| 22 #set r2_ext = $fastq_or_bam.read2.extension | |
| 23 ln -s '$fastq_or_bam.read1' fastq_r1.'$r1_ext' && | |
| 24 ln -s '$fastq_or_bam.read2' fastq_r2.'$r2_ext' && | |
| 25 #else if str($fastq_or_bam.input_select.value) == "single_fastq" | |
| 26 #set r1_ext = $fastq_or_bam.fastq.extension | |
| 27 ln -s '$fastq_or_bam.fastq' fastq_r1.'$r1_ext' && | |
| 28 #else if str($fastq_or_bam.input_select.value) == "paired_collection_fastq" | |
| 29 #set r1_ext = $fastq_or_bam.fastq_collection.forward.extension | |
| 30 #set r2_ext = $fastq_or_bam.fastq_collection.reverse.extension | |
| 31 ln -s '$fastq_or_bam.fastq_collection.forward' fastq_r1.'$r1_ext' && | |
| 32 ln -s '$fastq_or_bam.fastq_collection.reverse' fastq_r2.'$r2_ext' && | |
| 33 #end if | |
| 34 #else if str($fastq_or_bam.input_select.value) == "bam" | |
| 35 ln -s '$fastq_or_bam.bam_input' input.bam && | |
| 36 #end if | |
| 37 | |
| 38 tb-profiler profile | |
| 39 --platform '${platform.value}' | |
| 40 ${spoligotype} | |
| 41 #if str($fastq_or_bam.input_select.value) in ("paired_fastq", "paired_collection_fastq", "single_fastq") | |
| 42 -1 fastq_r1.'$r1_ext' | |
| 43 #end if | |
| 44 #if str($fastq_or_bam.input_select.value) in ("paired_fastq", "paired_collection_fastq") | |
| 45 -2 fastq_r2.'$r1_ext' | |
| 46 #else if str($fastq_or_bam.input_select.value) == "bam" | |
| 47 --bam input.bam | |
| 48 #end if | |
| 49 | |
| 50 --threads "\${GALAXY_SLOTS:-1}" | |
| 51 #if $advanced.options == 'yes' | |
| 52 --mapper '${advanced.mapper}' | |
| 53 --caller '${advanced.caller}' | |
| 54 --depth '${advanced.vf.min_depth_hard},${advanced.vf.min_depth_soft}' | |
| 55 --af '${advanced.vf.min_af_hard},${advanced.vf.min_af_soft}' | |
| 56 --strand '${advanced.vf.min_read_hard},${advanced.vf.min_read_soft}' | |
| 57 --sv-depth '${advanced.vf.min_sv_depth_hard},${advanced.vf.min_sv_depth_soft}' | |
| 58 --sv-af '${advanced.vf.min_sv_af_hard},${advanced.vf.min_sv_af_soft}' | |
| 59 --sv-len '${advanced.vf.max_sv_len_hard},${advanced.vf.max_sv_len_soft}' | |
| 60 ${advanced.suspect} | |
| 61 ${advanced.no_trim} | |
| 62 ${advanced.no_coverage_qc} | |
| 63 ${advanced.no_samclip} | |
| 64 ${advanced.no_delly} | |
| 65 #end if | |
| 66 | |
| 67 #if $output_format == "pdf" | |
| 68 --pdf | |
| 69 #else if $output_format == "txt" | |
| 70 --txt | |
| 71 #end if | |
| 72 && mv results/tbprofiler.results.json $results_json | |
| 73 #if str($fastq_or_bam.input_select) != "bam" | |
| 74 && mv bam/tbprofiler.bam '${output_bam}' | |
| 75 #end if | |
| 76 && bcftools view -Ov -o '${output_vcf}' vcf/tbprofiler.targets.vcf.gz | |
| 77 #if $output_format == "pdf" | |
| 78 && mv results/tbprofiler.results.pdf '${output_pdf}' | |
| 79 #else if $output_format == "txt" | |
| 80 && mv results/tbprofiler.results.txt '${output_txt}' | |
| 81 #end if | |
| 82 | |
| 83 ]]> </command> | |
| 84 <inputs> | |
| 85 <param name="platform" type="select" label="Platform"> | |
| 86 <option value="illumina" selected="true">Illumina</option> | |
| 87 <option value="nanopore">Nanopore</option> | |
| 88 <option value="pacbio">PacBio</option> | |
| 89 </param> | |
| 90 <conditional name="fastq_or_bam"> | |
| 91 <param name="input_select" type="select" label="Input File Type"> | |
| 92 <option value="paired_fastq">Paired Fastq</option> | |
| 93 <option value="paired_collection_fastq">Paired Collection Fastq</option> | |
| 94 <option value="single_fastq">Single Fastq</option> | |
| 95 <option value="bam">BAM</option> | |
| 96 </param> | |
| 97 <when value="paired_fastq"> | |
| 98 <param name="read1" type="data" format="fastq" label="Read1" help="First read file (default: None)"/> | |
| 99 <param name="read2" type="data" format="fastq" optional="true" label="Read2" help="Second read file (default: None)"/> | |
| 100 </when> | |
| 101 <when value="paired_collection_fastq"> | |
| 102 <param label="Reads (collection)" name="fastq_collection" type="data_collection" collection_type="paired" format="fastq,fastq.gz,fastqsanger,fastqsanger.gz" /> | |
| 103 </when> | |
| 104 <when value="single_fastq"> | |
| 105 <param label="Reads" name="fastq" type="data" format="fastq,fastq.gz,fastqsanger,fastqsanger.gz" /> | |
| 106 </when> | |
| 107 <when value="bam"> | |
| 108 <param name="bam_input" type="data" format="bam" label="Bam" help="Warning!!!: The BAM files must have been created using the ensembl version of the genome."/> | |
| 109 </when> | |
| 110 </conditional> | |
| 111 <param argument="--spoligotype" type="boolean" label="Perform in-silico spoligotyping" checked="false" truevalue="--spoligotype" falsevalue="" | |
| 112 help="Uses spacers of CRISPR region to call a spoligotype."/> | |
| 113 <param name="output_format" label="Output format" type="select"> | |
| 114 <option value="txt" selected="true">Text</option> | |
| 115 <option value="pdf">PDF</option> | |
| 116 </param> | |
| 117 <conditional name="advanced"> | |
| 118 <param label="Select advanced options" type="select" name="options"> | |
| 119 <option value="yes">Yes</option> | |
| 120 <option value="no" selected="true">No</option> | |
| 121 </param> | |
| 122 <when value="no"> | |
| 123 </when> | |
| 124 <when value="yes"> | |
| 125 <param argument="mapper" label="Mapper" type="select" help="Mapping tools to use (default: bwa)"> | |
| 126 <option value="bwa" selected="true">bwa</option> | |
| 127 <option value="minimap2">minimap2</option> | |
| 128 <option value="bowtie2">bowtie2</option> | |
| 129 <option value="bwa-mem2">bwa-mem2</option> | |
| 130 </param> | |
| 131 <param argument="caller" label="Variant caller" help="Variant calling tool to use" type="select"> | |
| 132 <option value="freebayes" selected="true">freebayes</option> | |
| 133 <option value="bcftools">bcftools</option> | |
| 134 <option value="gatk">gatk</option> | |
| 135 <option value="pilon">pilon</option> | |
| 136 <option value="lofreq">lofreq</option> | |
| 137 </param> | |
| 138 <section name="vf" title="Variant Filters"> | |
| 139 <param name="min_depth_hard" argument="--depth" label="Min Depth (hard cutoff)" type="integer" value="0" min="0" | |
| 140 help="Minimum depth required to call variant. Bases with depth below this cutoff will be marked as missing (default: 0)"/> | |
| 141 <param name="min_depth_soft" argument="--depth" label="Min Depth (soft cutoff)" type="integer" value="10" min="0" | |
| 142 help="Minimum depth required to call variant. Variants at positions lower than this depth and above the hard cutoff will be marked as QC fail (default: 10)"/> | |
| 143 <param name="min_af_hard" argument="--af" type="float" value="0" label="Minimum allele frequency to call variants (hard cutoff)" min="0.0" max="1.0" | |
| 144 help="Minimum allele frequency to call variants (default: 0)" /> | |
| 145 <param name="min_af_soft" argument="--af" type="float" value="0.1" label="Minimum allele frequency to call variants (soft cutoff)" min="0.0" max="1.0" | |
| 146 help="Variants with an allele frequency lower than this (and higher than the hard cutoff) will be marked as QC fail (default 0.1)" /> | |
| 147 <param name="min_read_hard" argument="--strand" type="integer" value="0" label="Mininum read number per strand (hard cutoff)" min="0" | |
| 148 help="Minimum read number per strand to call variants (default: 0)" /> | |
| 149 <param name="min_read_soft" argument="--strand" type="integer" value="3" label="Mininum read number per strand (soft cutoff)" min="0" | |
| 150 help="Minimum read number per strand to report variants (default: 3). Variants with number of reads on each strand below this (and above the hard cutoff) will be marked as QC fail" /> | |
| 151 <param name="min_sv_depth_hard" argument="--sv-depth" type="integer" value="0" label="Min Depth for SV (hard cutoff)" min="0" | |
| 152 help="Minimum depth required to call structural variants (default: 0)" /> | |
| 153 <param name="min_sv_depth_soft" argument="--sv-depth" type="integer" value="10" label="Min Depth for SV (soft cutoff)" min="0" | |
| 154 help="Minimum depth required to call structural variants. Variants at positions lower than this depth and above the hard cutoff will be marked as QC fail" /> | |
| 155 <param name="min_sv_af_hard" argument="--sv-af" type="float" value="0.5" label="Min SV allele frequency (hard cutoff)" min="0.0" max="1.0" | |
| 156 help="Minimum allele frequency to call structural variants (default: 0.5)" /> | |
| 157 <param name="min_sv_af_soft" argument="--sv-af" type="float" value="0.9" label="Min SV allele frequency (soft cutoff)" min="0.0" max="1.0" | |
| 158 help="Variants with an allele frequency lower than this (and higher than the hard cutoff) will be marked as QC fail (default 0.9)" /> | |
| 159 <param name="max_sv_len_hard" argument="--sv-len" type="integer" value="100000" label="Max SV length (hard cutoff)" min="0" | |
| 160 help="Maximum length (length) of structural variants to call (default: 100000)" /> | |
| 161 <param name="max_sv_len_soft" argument="--sv-len" type="integer" value="50000" label="Max SV length (soft cutoff)" min="0" | |
| 162 help="Structural variants with length higher than this (and lower than the hard cutoff) will be marked as QC fail (default: 50000)" /> | |
| 163 </section> | |
| 164 <param argument="--suspect" label="Use ML predictions of resistance from the SUSPECT tool suite" type="boolean" checked="False" truevalue="--suspect" falsevalue="" | |
| 165 help="The SUSPECT tools offer ML-based predictions of RIF, PZA and BDQ resistance. Note that this uses a web service thus requires an Internet connection."/> | |
| 166 <param argument="--no_trim" label="Do not trim reads using trimmomatic" checked="false" type="boolean" truevalue="--no_trim" falsevalue="" /> | |
| 167 <param argument="--no_coverage_qc" label="Don't collect flagstats" type="boolean" truevalue="--no_coverage_qc" falsevalue="" /> | |
| 168 <param argument="--no_samclip" label="Don't removed clipped reads from variant calling" type="boolean" truevalue="--no_samclip" falsevalue="" /> | |
| 169 <param argument="--no_delly" label="Don't run delly for SV calling" type="boolean" truevalue="--no_delly" falsevalue="" /> | |
| 170 </when> | |
| 171 </conditional> | |
| 172 </inputs> | |
| 173 <outputs> | |
| 174 <data name="results_json" format="json" from_work_dir="results/tbprofiler.results.json" label="${tool.name} on ${on_string}: Results.json"/> | |
| 175 <data format="vcf" name="output_vcf" label="${tool.name} VCF on ${on_string}" /> | |
| 176 <data format="bam" name="output_bam" label="${tool.name} BAM on ${on_string}"> | |
| 177 <filter>fastq_or_bam['input_select'] != 'bam'</filter> | |
| 178 </data> | |
| 179 <data format="pdf" name="output_pdf" label="${tool.name} PDF report on ${on_string}"> | |
| 180 <filter>output_format == 'pdf'</filter> | |
| 181 </data> | |
| 182 <data format="txt" name="output_txt" label="${tool.name} report on ${on_string}"> | |
| 183 <filter>output_format == 'txt'</filter> | |
| 184 </data> | |
| 185 </outputs> | |
| 186 <tests> | |
| 187 <test expect_num_outputs="4"> | |
| 188 <conditional name="fastq_or_bam"> | |
| 189 <param name="input_select" value="single_fastq"/> | |
| 190 <param name="fastq" ftype="fastq.gz" value="rif_resistant.fastq.gz" /> | |
| 191 </conditional> | |
| 192 <param name="output_format" value="txt" /> | |
| 193 <param name="platform" value="illumina" /> | |
| 194 <conditional name="advanced"> | |
| 195 <param name="options" value="no" /> | |
| 196 </conditional> | |
| 197 <output name="output_txt"> | |
| 198 <assert_contents> | |
| 199 <has_line line="Drug-resistance: RR-TB" /> | |
| 200 <has_line line="lineage2.2.2	100.000	East-Asian (Beijing)	RD105;RD207" /> | |
| 201 <has_line line="Rifampicin	R	rpoB p.Asp435Val (1.00)" /> | |
| 202 <has_line line="761110	Rv0667	rpoB	missense_variant	p.Asp435Val	43	1.000	rifampicin	Assoc w R" /> | |
| 203 </assert_contents> | |
| 204 </output> | |
| 205 </test> | |
| 206 <test expect_num_outputs="3"> | |
| 207 <conditional name="fastq_or_bam"> | |
| 208 <param name="input_select" value="bam"/> | |
| 209 <param name="bam_input" ftype="bam" value="rif_resistant.bam" /> | |
| 210 </conditional> | |
| 211 <param name="output_format" value="txt" /> | |
| 212 <param name="platform" value="illumina" /> | |
| 213 <conditional name="advanced"> | |
| 214 <param name="options" value="no" /> | |
| 215 </conditional> | |
| 216 <output name="output_txt"> | |
| 217 <assert_contents> | |
| 218 <has_line line="Drug-resistance: RR-TB" /> | |
| 219 <has_line line="lineage2.2.2	100.000	East-Asian (Beijing)	RD105;RD207" /> | |
| 220 <has_line line="Rifampicin	R	rpoB p.Asp435Val (1.00)" /> | |
| 221 <has_line line="761110	Rv0667	rpoB	missense_variant	p.Asp435Val	43	1.000	rifampicin	Assoc w R" /> | |
| 222 </assert_contents> | |
| 223 </output> | |
| 224 </test> | |
| 225 <test expect_num_outputs="4"> | |
| 226 <conditional name="fastq_or_bam"> | |
| 227 <param name="input_select" value="single_fastq"/> | |
| 228 <param name="fastq" ftype="fastq.gz" value="rif_resistant.fastq.gz" /> | |
| 229 </conditional> | |
| 230 <param name="output_format" value="txt" /> | |
| 231 <param name="platform" value="illumina" /> | |
| 232 <conditional name="advanced"> | |
| 233 <param name="options" value="yes" /> | |
| 234 <section name="vf"> | |
| 235 <param name="min_depth_hard" value="40" /> | |
| 236 <param name="min_depth_soft" value="50" /> | |
| 237 </section> | |
| 238 </conditional> | |
| 239 <output name="output_txt"> | |
| 240 <assert_contents> | |
| 241 <has_line line="lineage2.2.2	100.000	East-Asian (Beijing)	RD105;RD207" /> | |
| 242 <has_line line="761110	Rv0667	rpoB	missense_variant	p.Asp435Val	43	1.000	rifampicin	Assoc w R" /> | |
| 243 </assert_contents> | |
| 244 </output> | |
| 245 <output name="results_json"> | |
| 246 <assert_contents> | |
| 247 <has_text text='"filter": "soft_fail",' /> | |
| 248 </assert_contents> | |
| 249 </output> | |
| 250 </test> | |
| 251 <test expect_num_outputs="4"> | |
| 252 <conditional name="fastq_or_bam"> | |
| 253 <param name="input_select" value="single_fastq"/> | |
| 254 <param name="fastq" ftype="fastq.gz" value="rpoB_and_crispr.fastq.gz" /> | |
| 255 </conditional> | |
| 256 <param name="output_format" value="txt" /> | |
| 257 <param name="platform" value="illumina" /> | |
| 258 <param name="spoligotype" value="true" /> | |
| 259 <conditional name="advanced"> | |
| 260 <param name="options" value="no" /> | |
| 261 </conditional> | |
| 262 <output name="output_txt"> | |
| 263 <assert_contents> | |
| 264 <has_line line="Octal: 000000000000771" /> | |
| 265 <has_line line="Drug-resistance: RR-TB" /> | |
| 266 <has_line line="Rifampicin	R	rpoB p.Asp435Val (1.00)" /> | |
| 267 <has_line line="761110	Rv0667	rpoB	missense_variant	p.Asp435Val	35	1.000	rifampicin	Assoc w R" /> | |
| 268 </assert_contents> | |
| 269 </output> | |
| 270 </test> | |
| 271 </tests> | |
| 272 <help><![CDATA[ | |
| 273 Summary | |
| 274 ======= | |
| 275 | |
| 276 The pipeline aligns reads to the H37Rv reference using BWA, bowtie2 or minimap2 and then calls variants | |
| 277 (using bcftools, GATK4 or freebayes). These variants are then compared to a drug-resistance database. | |
| 278 TB-Profiler also predicts the number of reads supporting drug resistance variants as an insight into | |
| 279 hetero-resistance (not applicable for MinION data). | |
| 280 | |
| 281 Produces a JSON output file by default. | |
| 282 | |
| 283 In the Advanced options, you can select the mapper and variant caller to use, as well as set a number of filtering parameters. | |
| 284 Each of these typically has a "hard" and a "soft" cutoff. If a variant value is below the "hard" cutoff it is discarded, if | |
| 285 it is between the "hard" and "soft" values it is removed from the final predictions but added to the "qc_fail_variants" section | |
| 286 of the output. | |
| 287 | |
| 288 One of the advanced options is to use the SUSPECT tool suite to predict resistance to `rifampicin (RIF)`_, `pyrazinamide (PZA)`_ | |
| 289 and `bedaquiline (BDQ)`_. | |
| 290 | |
| 291 .. _rifampicin (RIF): https://www.nature.com/articles/s41598-020-74648-y | |
| 292 .. _pyrazinamide (PZA): https://www.nature.com/articles/s41598-020-58635-x | |
| 293 .. _bedaquiline (BDQ): https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0217169 | |
| 294 ]]> </help> | |
| 295 <citations> | |
| 296 <citation type="doi">10.1186/s13073-019-0650-x</citation> | |
| 297 </citations> | |
| 298 </tool> |
