diff hal_halPctId.xml @ 0:fcc762afb884 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/haltools commit 6244b9d15a5ad97ae20191e2f8fbafe2050c3cac
author iuc
date Fri, 06 Feb 2026 10:32:49 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hal_halPctId.xml	Fri Feb 06 10:32:49 2026 +0000
@@ -0,0 +1,61 @@
+<tool id="hal_halpctid" name="halPctId" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
+    <description>calculates % identity by sampling bases</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/> 
+    <expand macro="stdio"/>
+    <command detect_errors="aggressive"><![CDATA[
+        set -o pipefail; ## Sets the pipeline’s exit code to halPctId’s on failure.
+        halPctId
+            --numSamples $numSamples
+            --seed $seed
+            ## Pipes output to replace commas with tabs. Output is mostly numerical, and Genome names contain no commas, as this would invalidate the HAL Newick tree.
+            '$input_hal' '$refGenome' | tr ',' '\t' > '$out_file' 
+    ]]></command>
+    <inputs>
+        <expand macro="input_hal"/>
+        <expand macro="params_refGenome"/>
+        <expand macro="params_numSamples"/>
+        <expand macro="params_seed"/>
+    </inputs>
+    <outputs>
+        <data name="out_file" format="tabular" label="${tool.name} on ${on_string}: ${refGenome}"/>
+    </outputs>
+    <tests>
+        <test expect_num_outputs="1">
+            <param name="input_hal" value="halTest.hal"/>
+            <param name="refGenome" value="Genome_1"/>
+            <param name="seed" value="100"/>
+            <output name="out_file" ftype="tabular">
+                <assert_contents>
+                    <has_line line="Genome&#009; IdenticalSites&#009; AlignedSites&#009; PercentIdentity"/>
+                    <has_line line="Genome_1&#009; 856475&#009; 856475&#009; 100"/>
+                    <has_line line="Genome_2&#009; 374132&#009; 374132&#009; 100"/>
+                    <has_n_lines n="4"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="1">
+            <param name="input_hal" value="halTest.hal"/>
+            <param name="refGenome" value="Genome_1"/>
+            <param name="numSamples" value="1000"/>
+            <param name="seed" value="100"/>
+            <output name="out_file" ftype="tabular">
+                <assert_contents>
+                    <has_line line="Genome&#009; IdenticalSites&#009; AlignedSites&#009; PercentIdentity"/>
+                    <has_line line="Genome_1&#009; 839&#009; 839&#009; 100"/>
+                    <has_line line="Genome_2&#009; 339&#009; 339&#009; 100"/>
+                    <has_n_lines n="4"/>
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+    <help><![CDATA[
+halPctId computes percent identity (% ID) for a reference genome in a HAL alignment by randomly sampling bases.
+It takes a HAL file and a reference genome name as input and outputs a table summarizing the result.
+A random seed can be set for reproducibility.
+    ]]></help>
+    <expand macro="citation"/>
+    <expand macro="creator"/>
+</tool>
\ No newline at end of file