changeset 1:63e02ef6e153 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/clair3 commit 05505898035b41c07461dc0eecec61699ecbcf41
author iuc
date Fri, 28 Oct 2022 20:58:30 +0000
parents 44f6ec903688
children c8ba8286e7c0
files clair3.xml test-data/full_alignment_1.vcf test-data/full_alignment_1.vcf.gz test-data/merge_output_1.vcf test-data/merge_output_1.vcf.gz test-data/output_cram_test.vcf.gz test-data/pileup_1.vcf test-data/pileup_1.vcf.gz test-data/test1.cram
diffstat 9 files changed, 81 insertions(+), 82 deletions(-) [+]
line wrap: on
line diff
--- a/clair3.xml	Wed Jun 15 09:45:05 2022 +0000
+++ b/clair3.xml	Fri Oct 28 20:58:30 2022 +0000
@@ -1,8 +1,12 @@
 <tool id="clair3" name="Clair3" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09">
+    <description>germline small variant caller for long-reads</description>
     <macros>
-        <token name="@TOOL_VERSION@">0.1.11</token>
+        <token name="@TOOL_VERSION@">0.1.12</token>
         <token name="@VERSION_SUFFIX@">0</token>
     </macros>
+    <xrefs>
+        <xref type='bio.tools'>clair3</xref>
+    </xrefs>
     <requirements>
         <requirement type="package" version="@TOOL_VERSION@">clair3</requirement>
     </requirements>
@@ -18,9 +22,13 @@
         #if $model_source.source == "datatable"
             #set model_path = $model_source.model.fields.path 
         #end if
-
-        ln -s '${$bam_input}' input_reads.bam &&
-        ln -s '${$bam_input.metadata.bam_index}' input_reads.bai &&
+        #set $extension = $bam_input.ext
+        ln -s '${$bam_input}' input_reads.$extension &&
+        #if $extension == 'bam'
+            ln -s '${$bam_input.metadata.bam_index}' input_reads.bai &&
+        #else
+            ln -s '${$bam_input.metadata.cram_index}' input_reads.crai &&
+        #end if
 
         #if $bed_or_vcf.bed_or_vcf_selector == 'bed'
             ln -s '$bed_or_vcf.bed_fn' input.bed &&
@@ -29,7 +37,7 @@
         #end if
 
         run_clair3.sh
-            --bam_fn=input_reads.bam
+            --bam_fn=input_reads.$extension
             --ref_fn=reference.fasta
             #if $model_source.source == "datatable"
                 --platform='${model_source.model.fields.platform}'
@@ -43,7 +51,7 @@
                 --model_path=\$(dirname \$(which run_clair3.sh))/models/$model_source.select_built_in
             #end if
             --output='.'
-            --threads=\${GALAXY_SLOTS:-1}
+            --threads=\${GALAXY_SLOTS:-2}
             #if $bed_or_vcf.bed_or_vcf_selector == 'bed'
                   --bed_fn=input.bed
             #elif $bed_or_vcf.bed_or_vcf_selector == 'vcf'
@@ -51,9 +59,7 @@
             #else
                 $bed_or_vcf.include_all_ctgs
             #end if
-            #if $output_options.selection_mode == 'advanced'
-                $output_options.gvcf
-            #end if
+            $gvcf
             #if $adv.qual
             --qual=$adv.qual
             #end if
@@ -73,13 +79,14 @@
 
     ]]></command>
     <inputs>
+        <param type="data" name="bam_input" argument="--bam_fn" format="bam,cram" label="BAM/CRAM file input" />
         <conditional name="ref_source">
             <param type="select" label="Reference genome source" name="source">
                 <option value="history" selected="true">History</option>
                 <option value="builtin">Built-in</option>
             </param>
             <when value="history">
-                <param type="data" format="fasta" name="ref_fasta" label="Reference genome" />
+                <param type="data" format="fasta" name="ref_fasta" argument="--ref_fn" label="Reference genome" />
             </when>
             <when value="builtin">
                 <param type="select" name="ref_fasta_builtin" label="Reference genome">
@@ -88,12 +95,12 @@
             </when>
         </conditional>
         <conditional name="model_source">
-            <param type="select" label="Select if you want to use built-in models or your own via datatable." name="source">
+            <param name="source" type="select" label="Clair3 model" help="Select if you want to use a built-in model shipping with the tool or a model cached on this Galaxy server.">
                 <option value="built-in">Built-in</option>
-                <option value="datatable">Datatable</option>
+                <option value="datatable">Cached</option>
             </param>
             <when value="built-in">
-                <param type="select" name="select_built_in" label="Select built-in model.">
+                <param type="select" name="select_built_in" label="Built-in model">
                     <option value="r941_prom_sup_g5014">r941_prom_sup_g5014</option>
                     <option value="r941_prom_hac_g360+g422">r941_prom_hac_g360+g422</option>
                     <option value="hifi">hifi</option>
@@ -101,68 +108,60 @@
                 </param>
             </when>
             <when value="datatable">
-                <param argument="--model_path" type="select" name="model" label="Select model" >
+                <param  name="model" argument="--model_path" type="select" label="Cached model from server" >
                     <options from_data_table="clair3_models">
-                        <validator type="no_options" message="no modles available" />
+                        <validator type="no_options" message="no cached models available" />
                     </options>
                 </param>
             </when>
         </conditional>
-        <param type="data" name="bam_input" format="bam" label="BAM file input." />
-             <conditional name="bed_or_vcf">
-                <param type="select" name="bed_or_vcf_selector" label="Restict variant calling to:">
-                    <option value="unrestricted" selected="true">Whole reference (unrestricted)</option>
-                    <option value="bed" selected="true">Regions defined in BED dataset</option>
-                    <option value="vcf">Sites defined in VCF dataset</option>
-                </param>
-                <when value="bed">
-                    <param type="data" name="bed_fn" format="bed" label="Call variants only in the provided bed regions."/>
-                </when>
-                <when value="vcf">
-                    <param type="data" name="vcf_fn" format="vcf" label="Candidate sites VCF file input, variants will only be called at the sites in the VCF file if provided."/>
-                </when>
-                <when value="unrestricted">
-                    <param type="boolean" name="include_all_ctgs" truevalue="--include_all_ctgs" falsevalue="" checked="true" label="Call variants on all contigs, otherwise call in chr{1..22,X,Y} and {1..22,X,Y}, default: disable." />
-                </when>
-            </conditional>
-        <conditional name="output_options">
-                <param label="Use advanced output options" name="selection_mode" type="select">
-                    <option selected="true" value="defaults">Show merged output file only</option>
-                    <option value="advanced">Show intermediate output files</option>
-                </param>
-                <when value="defaults"/>
-                <when value="advanced">
-                    <param name="full_alignment_check" type="boolean" label="Show full alignment file"/>
-                    <param name="pileup_check" type="boolean" label="Show pileup file"/>
-                    <param name="phased_bam_check" type="boolean" label="Show itermediate phased BAM file"/>
-                    <param type="boolean" name="gvcf" truevalue="--gvcf" falsevalue="" label="Enable GVCF output, default: disable" />
-                </when>
+        <conditional name="bed_or_vcf">
+            <param type="select" name="bed_or_vcf_selector" label="Restict variant calling to:">
+                <option value="unrestricted" selected="true">Whole reference (unrestricted)</option>
+                <option value="bed" selected="true">Regions defined in BED dataset</option>
+                <option value="vcf">Sites defined in VCF dataset</option>
+            </param>
+            <when value="bed">
+                <param type="data" argument="--bed_fn" format="bed" label="Call variants only in the provided bed regions."/>
+            </when>
+            <when value="vcf">
+                <param type="data" argument="--vcf_fn" format="vcf" label="Candidate sites VCF file input" help="Variants will only be called at the sites in the VCF file if provided."/>
+            </when>
+            <when value="unrestricted">
+                <param type="boolean" argument="--include_all_ctgs" truevalue="--include_all_ctgs" falsevalue="" checked="true" label="Call variants on all contigs" help="If disabled, call in chr{1..22,X,Y} and {1..22,X,Y}" />
+            </when>
         </conditional>
-        <section name="adv" title="Advanced Parameters" expanded="false">
-            <param type="integer" name="qual" value="0" min="0" label="If set, variants with >qual will be marked PASS, or LowQual otherwise." />
-            <param type="float" name="snp_min_af" value="0.08" min="0" max="1" label="Minimum SNP AF required for a candidate variant. Lowering the value might increase a bit of sensitivity in trade of speed and accuracy, default: ont:0.08,hifi:0.08,ilmn:0.08." />
-            <param type="float" name="indel_min_af" value="0.15" min="0" max="1" label="Minimum INDEL AF required for a candidate variant. Lowering the value might increase a bit of sensitivity in trade of speed and accuracy, default: ont:0.15,hifi:0.08,ilmn:0.08." />
-            <param type="boolean" name="enable_phasing" truevalue="--enable_phasing" falsevalue="" label="Output phased variants using whatshap, default: disable" />
-            <param type="boolean" name="no_phasing_for_fa" truevalue="--no_phasing_for_fa" falsevalue="" label="EXPERIMENTAL: Call variants without whatshap phasing in full alignment calling, default: disable." />
-            <param type="boolean" name="print_ref_calls" truevalue="--print_ref_calls" falsevalue="" label="Show reference calls (0/0) in vcf file, default: disable." />
-            <param type="select" name="ploidity_model" label="Call with the following ploidy model" help="EXPERIMENTAL: Enable haploid calling mode. Only 1/1 is considered as a variant, default: disable. EXPERIMENTAL: Enable haploid calling mode. 0/1 and 1/1 are considered as a variant, default: disable.">
-                <option value="" selected="true">diploid</option>
-                <option value="--haploid_sensitive">haploid (sensitive)</option>
-                <option value="--haploid_precise">haploid (precise)</option>
+        <param type="boolean" argument="--gvcf" truevalue="--gvcf" falsevalue="" label="Enable GVCF output" help="GVCF stands for Genomic VCF. A GVCF is a kind of VCF, so the basic format specification is the same as for a regular VCF but contains extra information. Default: disable" />
+        <param name="output_files" type="select" display="checkboxes" multiple="true" label="Optional additional output files">
+            <option value="full_alignment">Full alignment file</option>
+            <option value="pileup">Pileup file</option>
+            <option value="phased_bam">Phased BAM file</option>
+        </param>
+        <section name="adv" title="Advanced parameters" expanded="false">
+            <param type="integer" argument="--qual" value="0" min="0" label="Qual" help="If set, variants with >qual will be marked PASS, or LowQual otherwise." />
+            <param type="float" argument="--snp_min_af" value="0.08" min="0" max="1" label="Minimum SNP AF" help="Minimum SNP AF required for a candidate variant. Lowering the value might increase a bit of sensitivity in trade of speed and accuracy. Default: ont:0.08,hifi:0.08,ilmn:0.08." />
+            <param type="float" argument="--indel_min_af" value="0.15" min="0" max="1" label="Minimum INDEL AF" help="Minimum INDEL AF required for a candidate variant. Lowering the value might increase a bit of sensitivity in trade of speed and accuracy. Default: ont:0.15,hifi:0.08,ilmn:0.08." />
+            <param type="boolean" argument="--enable_phasing" truevalue="--enable_phasing" falsevalue="" label="Enable phasing" help="Output phased variants using whatshap. Default: disable" />
+            <param type="boolean" argument="--no_phasing_for_fa" truevalue="--no_phasing_for_fa" falsevalue="" label="Call variants without whatshap phasing" help="EXPERIMENTAL: Call variants without whatshap phasing in full alignment calling. Default: disable" />
+            <param type="boolean" argument="--print_ref_calls" truevalue="--print_ref_calls" falsevalue="" label="Print reference calls" help="Show reference calls (0/0) in vcf file. Default: disable." />
+            <param type="select" name="ploidity_model" label="Call with the following ploidy model" help="EXPERIMENTAL. When haploid sensitive is enabled only 1/1 is considered as a variant. When haploid precise is enabled only 0/1 and 1/1 are considered as a variant. Default: diploid.">
+                <option value="" selected="true">Diploid</option>
+                <option value="--haploid_sensitive">Haploid sensitive (--haploid_sensitive)</option>
+                <option value="--haploid_precise">haploid precise (--haploid_precise)</option>
             </param>
-            <param type="integer" name="chunk_size" value="5000000" min="1" label="The size of each chuck for parallel processing, default: 5Mbp." optional="true" />
+            <param type="integer" argument="--chunk_size" value="5000000" min="1" label="Chunk size" help="The size of each chuck for parallel processing. Default: 5Mbp." optional="true" />
         </section>
     </inputs>
     <outputs>
-      <data name="merge_output" format="vcf_bgzip" from_work_dir="./merge_output.vcf.gz" />
-      <data name="pileup" format="vcf_bgzip" from_work_dir="./pileup.vcf.gz">
-            <filter>output_options['selection_mode'] == 'advanced' and output_options['pileup_check']</filter>
+        <data name="merge_output" format="vcf_bgzip" from_work_dir="./merge_output.vcf.gz" label="${tool.name} on ${on_string}: merged output"/>
+        <data name="pileup" format="vcf_bgzip" from_work_dir="./pileup.vcf.gz" label="${tool.name} on ${on_string}: pileup">
+            <filter>output_files and 'pileup' in output_files</filter>
         </data>
-        <data name="full_alignment" format="vcf_bgzip" from_work_dir="./full_alignment.vcf.gz">
-            <filter>output_options['selection_mode'] == 'advanced' and output_options['full_alignment_check']</filter>
+        <data name="full_alignment" format="vcf_bgzip" from_work_dir="./full_alignment.vcf.gz" label="${tool.name} on ${on_string}: full alignment">
+            <filter>output_files and 'full_alignment' in output_files</filter>
         </data>
-        <data name="phased_bam" format="bam" from_work_dir="./phased_bam.bam">
-            <filter>output_options['selection_mode'] == 'advanced' and output_options['phased_bam_check']</filter>
+        <data name="phased_bam" format="bam" from_work_dir="./phased_bam.bam" label="${tool.name} on ${on_string}: phased BAM">
+            <filter>output_files and 'phased_bam' in output_files</filter>
         </data>
     </outputs>
     <tests>
@@ -180,10 +179,6 @@
                 <param name="bed_or_vcf_selector" value="vcf"/>
                 <param name="vcf_fn" value="test1.vcf.gz" />
             </conditional>
-            <conditional name="output_options">
-                <param name="selection_mode" value="advanced"/>
-                <param name="gvcf" value="true" />
-            </conditional>
             <section name="adv">
                 <param name="no_phasing_for_fa" value="true"/>
                 <param name="print_ref_calls" value="true"/>
@@ -207,18 +202,14 @@
                 <param name="source" value="builtin" />
                 <param name="ref_fasta_builtin" value="test1" />
             </conditional>
-            <conditional name="output_options">
-                <param name="selection_mode" value="advanced"/>
-                <param name="pileup_check" value="true"/>
-                <param name="full_alignment_check" value="true"/>
-                <param name="phased_bam_check" value="true"/>
-            </conditional>
+            <param name="gvcf" value="true"/>
+            <param name="output_files" value="full_alignment,pileup,phased_bam"/>
             <section name="adv">
                 <param name="print_ref_calls" value="true"/>
             </section>
-            <output name="merge_output" decompress="true" file="merge_output_1.vcf" ftype="vcf_bgzip"/>
-            <output name="pileup" decompress="true" file="pileup_1.vcf" ftype="vcf_bgzip"/>
-            <output name="full_alignment" decompress="true" file="full_alignment_1.vcf" ftype="vcf_bgzip"/>
+            <output name="merge_output" decompress="true" file="merge_output_1.vcf.gz" ftype="vcf_bgzip"/>
+            <output name="pileup" decompress="true" file="pileup_1.vcf.gz" ftype="vcf_bgzip"/>
+            <output name="full_alignment" decompress="true" file="full_alignment_1.vcf.gz" ftype="vcf_bgzip"/>
             <output name="phased_bam" file="phased_bam_1.bam" ftype="bam"/>
         </test>
         <test expect_num_outputs="4">
@@ -235,12 +226,7 @@
                 <param name="source" value="builtin" />
                 <param name="ref_fasta_builtin" value="test1" />
             </conditional>
-            <conditional name="output_options">
-                <param name="selection_mode" value="advanced"/>
-                <param name="pileup_check" value="true"/>
-                <param name="full_alignment_check" value="true"/>
-                <param name="phased_bam_check" value="true"/>
-            </conditional>
+            <param name="output_files" value="full_alignment,pileup,phased_bam"/>
             <section name="adv">
                 <param name="snp_min_af" value="0.5"/>
                 <param name="indel_min_af" value="0.12"/>
@@ -268,6 +254,19 @@
                 </assert_contents>
             </output>
         </test>
+        <!-- Test input CRAM -->
+        <test expect_num_outputs="1">
+            <conditional name="model_source">
+                <param name="source" value="builtin" />
+                <param name="select_built_in" value="r941_prom_hac_g360+g422" />
+            </conditional>
+            <param name="bam_input" value="test1.cram" />
+            <conditional name="ref_source">
+                <param name="source" value="history" />
+                <param name="ref_fasta" value="test1.fasta" />
+            </conditional>
+            <output name="merge_output" file="output_cram_test.vcf.gz" ftype="vcf_bgzip"/>
+        </test>
     </tests>
     <help><![CDATA[
       Clair3 is a germline small variant caller for long-reads. Clair3 makes the best of two major method categories:
Binary file test-data/full_alignment_1.vcf has changed
Binary file test-data/full_alignment_1.vcf.gz has changed
Binary file test-data/merge_output_1.vcf has changed
Binary file test-data/merge_output_1.vcf.gz has changed
Binary file test-data/output_cram_test.vcf.gz has changed
Binary file test-data/pileup_1.vcf has changed
Binary file test-data/pileup_1.vcf.gz has changed
Binary file test-data/test1.cram has changed