diff hal_halRemoveSubtree.xml @ 0:19f3c5cad8ae 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:35:56 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hal_halRemoveSubtree.xml	Fri Feb 06 10:35:56 2026 +0000
@@ -0,0 +1,82 @@
+<tool id="hal_halremovesubtree" name="halRemoveSubtree" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
+    <description>removes an entire subtree in a HAL file</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/> 
+    <expand macro="stdio"/>
+    <command detect_errors="aggressive"><![CDATA[
+        ## Copy input HAL to ensure that it is not modified.
+        cp '$input_hal' writable_hal.hal && 
+        halRemoveSubtree
+            $noMarkAncestors
+            writable_hal.hal '$root'
+    ]]></command>
+    <inputs>
+        <expand macro="input_hal"/>
+        <param name="root" type="text" value="" label="Node name" help="Subtree below this node will be deleted (but not the node itself). If a leaf genome is given, nothing happens">
+            <expand macro="sanitizer_default"/>
+            <expand macro="validator_trim"/>
+        </param>
+        <expand macro="params_noMarkAncestors"/>
+    </inputs>
+    <outputs>
+        <data name="out_file" format="hal" label="${tool.name} on ${on_string}" from_work_dir="writable_hal.hal"/>
+    </outputs>
+    <tests>
+        <test expect_num_outputs="1">
+            <param name="input_hal" value="halTest.hal"/>
+            <param name="root" value="Genome_0"/>
+            <output name="out_file" ftype="hal">
+                <assert_contents>
+                    <has_size min="45000"/>
+                </assert_contents>
+            </output>
+            <assert_stderr>
+                <has_line line="[halRemoveSubtree] removing Genome_1"/>
+            </assert_stderr>
+        </test>
+        <test expect_num_outputs="1">
+            <param name="input_hal" value="halTest.hal"/>
+            <param name="root" value="Genome_1"/>
+            <output name="out_file" ftype="hal">
+                <assert_contents>
+                    <has_size min="50000"/>
+                </assert_contents>
+            </output>
+            <assert_stderr>
+                <has_line line="[halRemoveSubtree] Warning: given root Genome_1 is a leaf: doing nothing"/>
+            </assert_stderr>
+        </test>
+        <test expect_num_outputs="1">
+            <param name="input_hal" value="halTest.hal"/>
+            <param name="root" value="Genome_0"/>
+            <param name="noMarkAncestors" value="true"/>
+            <output name="out_file" ftype="hal">
+                <assert_contents>
+                    <has_size min="45000"/>
+                </assert_contents>
+            </output>
+            <assert_stderr>
+                <has_line line="[halRemoveSubtree] removing Genome_1"/>
+            </assert_stderr>
+        </test>
+    </tests>
+    <help><![CDATA[
+halRemoveSubtree removes all descendant genomes below a given node from an input HAL file and updates the tree structure accordingly. 
+The given node itself is not removed. 
+By default, ancestor nodes are marked for update to ensure consistency of the alignment after removal. 
+This behavior can be disabled when ancestor updates are not required.
+
+A new HAL file is created as output instead of modifying the input HAL file.
+
+-----
+
+.. class:: warningmark
+
+Running the tool on a HAL file in mmap format will fail because this format type is not supported by this tool.
+It is recommended to convert the input to HDF5 format first using halExtract.
+    ]]></help>
+    <expand macro="citation"/>
+    <expand macro="creator"/>
+</tool>
\ No newline at end of file