diff tb_profiler_profile.xml @ 18:4839e590cb26 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/blob/master/tools/tb-profiler commit 74ef4277d954bbbb0acd47ae6ef2d323485d5bf1
author iuc
date Thu, 30 May 2024 11:31:53 +0000
parents d03af1c7002c
children 51dd22484644
line wrap: on
line diff
--- a/tb_profiler_profile.xml	Mon Mar 11 21:48:49 2024 +0000
+++ b/tb_profiler_profile.xml	Thu May 30 11:31:53 2024 +0000
@@ -1,7 +1,7 @@
-<tool id="tb_profiler_profile" name="TB-Profiler Profile" version="@TOOL_VERSION@+galaxy0" profile="20.09">
+<tool id="tb_profiler_profile" name="TB-Profiler Profile" version="@TOOL_VERSION@+galaxy0" profile="23.2" license="AGPL-3.0-or-later">
     <description>Infer strain types and drug resistance markers from sequences</description>
     <macros>
-        <token name="@TOOL_VERSION@">4.4.1</token>
+        <token name="@TOOL_VERSION@">6.2.1</token>
     </macros>
     <xrefs>
         <xref type="bio.tools">tb-profiler</xref>
@@ -31,6 +31,7 @@
 
         tb-profiler profile
             --platform '${platform.value}'
+            ${spoligotype}
         #if str($fastq_or_bam.input_select.value) in ("paired_fastq", "paired_collection_fastq", "single_fastq")
             -1 fastq_r1.'$r1_ext'
         #end if
@@ -44,9 +45,17 @@
         #if $advanced.options == 'yes'
             --mapper '${advanced.mapper}'
             --caller '${advanced.caller}'
-            --min_depth '${advanced.min_depth}'
-            --af '${advanced.min_allele_freq}'
-            --reporting_af '${advanced.min_allele_freq_reporting}'
+            --depth '${advanced.vf.min_depth_hard},${advanced.vf.min_depth_soft}'
+            --af '${advanced.vf.min_af_hard},${advanced.vf.min_af_soft}'
+            --strand '${advanced.vf.min_read_hard},${advanced.vf.min_read_soft}'
+            --sv-depth '${advanced.vf.min_sv_depth_hard},${advanced.vf.min_sv_depth_soft}'
+            --sv-af '${advanced.vf.min_sv_af_hard},${advanced.vf.min_sv_af_soft}'
+            --sv-len '${advanced.vf.max_sv_len_hard},${advanced.vf.max_sv_len_soft}'
+            ${advanced.suspect}
+            ${advanced.no_trim}
+            ${advanced.no_coverage_qc}
+            ${advanced.no_samclip}
+            ${advanced.no_delly}
         #end if
 
         #if $output_format == "pdf"
@@ -58,7 +67,7 @@
         #if str($fastq_or_bam.input_select) != "bam"
             && mv bam/tbprofiler.bam '${output_bam}'
         #end if
-        && bcftools view -Ov -o'${output_vcf}' vcf/tbprofiler.targets.csq.vcf.gz
+        && bcftools view -Ov -o'${output_vcf}' vcf/tbprofiler.targets.vcf.gz
         #if $output_format == "pdf"
             && mv results/tbprofiler.results.pdf '${output_pdf}'
         #else if $output_format == "txt"
@@ -93,6 +102,8 @@
                 <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."/>
             </when>
         </conditional>
+        <param argument="--spoligotype" type="boolean" label="Perform in-silico spoligotyping" checked="false" truevalue="--spoligotype" falsevalue="" 
+            help="Uses spacers of CRISPR region to call a spoligotype."/>
         <param name="output_format" label="Output format" type="select">
             <option value="txt" selected="true">Text</option>
             <option value="pdf">PDF</option>
@@ -118,9 +129,38 @@
                     <option value="pilon">pilon</option>
                     <option value="lofreq">lofreq</option>
                 </param>
-                <param name="min_depth" label="Min Depth" type="integer" value="10" help="Minimum depth required to call variant. Bases with depth below this cutoff will be marked as missing (default: 10)"/>
-                <param name="min_allele_freq" argument="--af" type="float" value="0.1" label="Minimum allele frequency to call variants" help=" Minimum allele frequency to call variants (default: 0.1)" />
-                <param name="min_allele_freq_reporting" argument="--reporting_af" value="0.1" label="Reporting Minimum allele frequency to call variants" type="float" help=" Minimum allele frequency to call variants (default: 0.1)"/>
+                <section name="vf" title="Variant Filters">
+                    <param name="min_depth_hard" argument="--depth" label="Min Depth (hard cutoff)" type="integer" value="0" min="0"
+                        help="Minimum depth required to call variant. Bases with depth below this cutoff will be marked as missing (default: 0)"/>
+                    <param name="min_depth_soft" argument="--depth" label="Min Depth (soft cutoff)" type="integer" value="10" min="0"
+                        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)"/>
+                    <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" 
+                        help="Minimum allele frequency to call variants (default: 0)" />
+                    <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"
+                        help="Variants with an allele frequency lower than this (and higher than the hard cutoff) will be marked as QC fail (default 0.1)" />
+                    <param name="min_read_hard" argument="--strand" type="integer" value="0" label="Mininum read number per strand (hard cutoff)" min="0"
+                        help="Minimum read number per strand to call variants (default: 0)" />
+                    <param name="min_read_soft" argument="--strand" type="integer" value="3" label="Mininum read number per strand (soft cutoff)" min="0"
+                        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" />
+                    <param name="min_sv_depth_hard" argument="--sv-depth" type="integer" value="0" label="Min Depth for SV (hard cutoff)" min="0"
+                        help="Minimum depth required to call structural variants (default: 0)" />
+                    <param name="min_sv_depth_soft" argument="--sv-depth" type="integer" value="10" label="Min Depth for SV (soft cutoff)" min="0"
+                        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" />
+                    <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"
+                        help="Minimum allele frequency to call structural variants (default: 0.5)" />
+                    <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"
+                        help="Variants with an allele frequency lower than this (and higher than the hard cutoff) will be marked as QC fail (default 0.9)" />
+                    <param name="max_sv_len_hard" argument="--sv-len" type="integer" value="100000" label="Max SV length (hard cutoff)" min="0"
+                        help="Maximum length (length) of structural variants to call (default: 100000)" />
+                    <param name="max_sv_len_soft" argument="--sv-len" type="integer" value="50000" label="Max SV length (soft cutoff)" min="0"
+                        help="Structural variants with length higher than this (and lower than the hard cutoff) will be marked as QC fail (default: 50000)" />
+                </section>
+                <param argument="--suspect" label="Use ML predictions of resistance from the SUSPECT tool suite" type="boolean" checked="False" truevalue="--suspect" falsevalue="" 
+                    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."/>
+                <param argument="--no_trim" label="Do not trim reads using trimmomatic" checked="false" type="boolean" truevalue="--no_trim" falsevalue="" />
+                <param argument="--no_coverage_qc" label="Don't collect flagstats" type="boolean" truevalue="--no_coverage_qc" falsevalue="" />
+                <param argument="--no_samclip" label="Don't removed clipped reads from variant calling" type="boolean" truevalue="--no_samclip" falsevalue="" />
+                <param argument="--no_delly" label="Don't run delly for SV calling" type="boolean" truevalue="--no_delly" falsevalue="" />
             </when>
         </conditional>
     </inputs>
@@ -136,7 +176,6 @@
         <data format="txt" name="output_txt" label="${tool.name} report on ${on_string}">
             <filter>output_format == 'txt'</filter>
         </data>
-
     </outputs>
     <tests>
         <test expect_num_outputs="4">
@@ -148,9 +187,9 @@
             <output name="output_txt">
                 <assert_contents>
                     <has_line line="Drug-resistance: RR-TB" />
-                    <has_line line="lineage2.2.2&#009;1.000&#009;Beijing-RD105/RD207&#009;RD105;RD207" />
+                    <has_line line="lineage2.2.2&#009;1.000&#009;East-Asian (Beijing)&#009;RD105;RD207" />
                     <has_line line="Rifampicin&#009;R&#009;rpoB p.Asp435Val (1.00)" />
-                    <has_line line="761110&#009;Rv0667&#009;rpoB&#009;missense_variant&#009;p.Asp435Val&#009;1.000&#009;rifampicin&#009;type=who_confidence|drug=rifampicin|who_confidence=Assoc w R" />
+                    <has_line line="761110&#009;Rv0667&#009;rpoB&#009;missense_variant&#009;p.Asp435Val&#009;1.000&#009;rifampicin&#009;Assoc w R" />
                 </assert_contents>
             </output>
         </test>
@@ -163,9 +202,9 @@
             <output name="output_txt">
                 <assert_contents>
                     <has_line line="Drug-resistance: RR-TB" />
-                    <has_line line="lineage2.2.2&#009;1.000&#009;Beijing-RD105/RD207&#009;RD105;RD207" />
+                    <has_line line="lineage2.2.2&#009;1.000&#009;East-Asian (Beijing)&#009;RD105;RD207" />
                     <has_line line="Rifampicin&#009;R&#009;rpoB p.Asp435Val (1.00)" />
-                    <has_line line="761110&#009;Rv0667&#009;rpoB&#009;missense_variant&#009;p.Asp435Val&#009;1.000&#009;rifampicin&#009;type=who_confidence|drug=rifampicin|who_confidence=Assoc w R" />
+                    <has_line line="761110&#009;Rv0667&#009;rpoB&#009;missense_variant&#009;p.Asp435Val&#009;1.000&#009;rifampicin&#009;Assoc w R" />
                 </assert_contents>
             </output>
         </test>
@@ -174,15 +213,38 @@
             <param name="fastq" ftype="fastq.gz" value="rif_resistant.fastq.gz" />
             <param name="output_format" value="txt" />
             <param name="platform" value="illumina" />
-            <param name="options" value="yes" />
-            <param name="min_allele_freq" value="0.25" />
-            <param name="min_allele_freq_reporting" value="0.33" />
+            <conditional name="advanced">
+                <param name="options" value="yes" />
+                <section name="vf">
+                    <param name="min_depth_hard" value="40" />
+                    <param name="min_depth_soft" value="50" />
+                </section>
+            </conditional>
             <output name="output_txt">
                 <assert_contents>
+                    <has_line line="lineage2.2.2&#009;1.000&#009;East-Asian (Beijing)&#009;RD105;RD207" />
+                    <has_line line="761110&#009;Rv0667&#009;rpoB&#009;missense_variant&#009;p.Asp435Val&#009;1.000&#009;rifampicin&#009;Assoc w R" />
+                </assert_contents>
+            </output>
+            <output name="results_json">
+                <assert_contents>
+                    <has_text text='"filter": "soft_fail",' />
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="4">
+            <param name="input_select" value="single_fastq"/>
+            <param name="fastq" ftype="fastq.gz" value="rpoB_and_crispr.fastq.gz" />
+            <param name="output_format" value="txt" />
+            <param name="platform" value="illumina" />
+            <param name="spoligotype" value="true" />
+            <param name="options" value="no" />
+            <output name="output_txt">
+                <assert_contents>
+                    <has_line line="Octal: 000000000000771" />
                     <has_line line="Drug-resistance: RR-TB" />
-                    <has_line line="lineage2.2.2&#009;1.000&#009;Beijing-RD105/RD207&#009;RD105;RD207" />
                     <has_line line="Rifampicin&#009;R&#009;rpoB p.Asp435Val (1.00)" />
-                    <has_line line="761110&#009;Rv0667&#009;rpoB&#009;missense_variant&#009;p.Asp435Val&#009;1.000&#009;rifampicin&#009;type=who_confidence|drug=rifampicin|who_confidence=Assoc w R" />
+                    <has_line line="761110&#009;Rv0667&#009;rpoB&#009;missense_variant&#009;p.Asp435Val&#009;1.000&#009;rifampicin&#009;Assoc w R" />
                 </assert_contents>
             </output>
         </test>
@@ -198,6 +260,17 @@
 
 Produces a JSON output file by default.
 
+In the Advanced options, you can select the mapper and variant caller to use, as well as set a number of filtering parameters.
+Each of these typically has a "hard" and a "soft" cutoff. If a variant value is below the "hard" cutoff it is discarded, if
+it is between the "hard" and "soft" values it is removed from the final predictions but added to the "qc_fail_variants" section
+of the output.
+
+One of the advanced options is to use the SUSPECT tool suite to predict resistance to `rifampicin (RIF)`_, `pyrazinamide (PZA)`_
+and `bedaquiline (BDQ)`_.
+
+.. _rifampicin (RIF): https://www.nature.com/articles/s41598-020-74648-y
+.. _pyrazinamide (PZA): https://www.nature.com/articles/s41598-020-58635-x
+.. _bedaquiline (BDQ): https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0217169
     ]]>    </help>
     <citations>
         <citation type="doi">10.1186/s13073-019-0650-x</citation>