diff hal_halStats.xml @ 1:4b1c38d744a0 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/haltools commit 30ac0af6dfa729277011bcd73cd5560efa03fb97
author iuc
date Wed, 18 Mar 2026 15:06:06 +0000
parents 25dcde5bf94e
children
line wrap: on
line diff
--- a/hal_halStats.xml	Fri Feb 06 10:39:34 2026 +0000
+++ b/hal_halStats.xml	Wed Mar 18 15:06:06 2026 +0000
@@ -7,11 +7,11 @@
     <expand macro="stdio"/>
     <command detect_errors="aggressive"><![CDATA[
         set -o pipefail; ## Sets the pipeline’s exit code to halStats’s on failure.
-        ( ## echo headers for specific numerical data
+        ## echo headers for specific numerical data
         #if $mode.option == '--baseComp':
-            echo -e 'fraction_of_As\tfraction_of_Gs\tfraction_of_Cs\tfraction_of_Ts';
+            echo -e 'fraction_of_As\tfraction_of_Gs\tfraction_of_Cs\tfraction_of_Ts' >> '$out_file' &&
         #else if $mode.option == '--numSegments':
-            echo -e 'numTopSegments\tnumBottomSegments';
+            echo -e 'numTopSegments\tnumBottomSegments' >> '$out_file' &&
         #end if
         halStats
             #if $mode.option == '--allCoverage':
@@ -26,6 +26,8 @@
                 --root
             #else if $mode.option == '--tree':
                 --tree
+            #else if $mode.option == '--assembly':
+                --assembly
             #else if $mode.option == '--baseComp':
                 --baseComp '$mode.baseComp'
             #else if $mode.option == '--bedSequences':
@@ -60,13 +62,13 @@
                 --topSegments '$mode.topSegments'
             #end if
             '$input_hal'
-        ## Pipes specific output to replace commas with tabs. Output is mostly numerical, and Genome names contain no commas, as this would invalidate the HAL Newick tree.
-        #if $mode.option == '--allCoverage' or $mode.option == '--sequenceStats' or $mode.option == '--percentID' or $mode.option == '--coverage':
-            | tr ',' '\t'
-        #else if $mode.option == '--numSegments':
-            | tr ' ' '\t' ## Replace spaces
-        #end if
-        ) > '$out_file'
+            ## Pipes specific output to replace commas with tabs. Output is mostly numerical, and Genome names contain no commas, as this would invalidate the HAL Newick tree.
+            #if $mode.option == '--allCoverage' or $mode.option == '--sequenceStats' or $mode.option == '--percentID' or $mode.option == '--coverage' or $mode.option == '--assembly':
+                | sed $'s/, */\t/g'
+            #else if $mode.option == '--numSegments':
+                | tr ' ' '\t' ## Replace spaces
+            #end if
+            >> '$out_file'
     ]]></command>
     <inputs>
         <expand macro="input_hal"/>
@@ -78,6 +80,7 @@
                 <option value="--bedSequences">List of sequences in a given genome (in BED format) (--bedSequences)</option>
                 <option value="--sequenceStats">Stats for each sequence in a given genome (--sequenceStats)</option>
                 <option value="--tree">Newick tree (--tree)</option>
+                <option value="--assembly">Assembly stats for each genome (--assembly)</option>
                 <option value="--branches">List of branches specified by the child genome (--branches)</option>
                 <option value="--span">Branches on path (or spanning tree) between given list of genomes (--span)</option>
                 <option value="--spanRoot">Genomes on path (or spanning tree) with spanning tree root between given list of genomes (--spanRoot)</option>
@@ -174,6 +177,7 @@
                 </param>
             </when>
             <when value="--root"/>
+            <when value="--assembly"/>
             <when value="--sequenceStats">
                 <param name="sequenceStats" type="text" value="" label="Genome name">
                     <expand macro="sanitizer_default"/>
@@ -213,6 +217,7 @@
                 <when input="mode.option" value="--baseComp" format="tabular"/>
                 <when input="mode.option" value="--metaData" format="tabular"/>
                 <when input="mode.option" value="--genomeMetaData" format="tabular"/>
+                <when input="mode.option" value="--assembly" format="tabular"/>
                 <when input="mode.option" value="--bedSequences" format="bed"/>
                 <when input="mode.option" value="--topSegments" format="bed"/>
                 <when input="mode.option" value="--bottomSegments" format="bed"/>
@@ -238,8 +243,8 @@
             </conditional>
             <output name="out_file" ftype="tabular">
                 <assert_contents>
-                    <has_line line="FromGenome&#009; ToGenome&#009; sitesCovered1Times&#009; sitesCovered2Times&#009; sitesCovered3Times&#009; sitesCovered4Times&#009; sitesCovered5Times"/>
-                    <has_line line="Genome_1&#009; Genome_1&#009; 5472&#009; 4688&#009; 3516&#009; 2637&#009; 1465"/>
+                    <has_line line="FromGenome&#009;ToGenome&#009;sitesCovered1Times&#009;sitesCovered2Times&#009;sitesCovered3Times&#009;sitesCovered4Times&#009;sitesCovered5Times"/>
+                    <has_line line="Genome_1&#009;Genome_1&#009;5472&#009;4688&#009;3516&#009;2637&#009;1465"/>
                     <has_n_lines n="10"/>
                 </assert_contents>
             </output>
@@ -247,6 +252,20 @@
         <test expect_num_outputs="1">
             <param name="input_hal" value="halTest.hal"/>
             <conditional name="mode">
+                <param name="option" value="--coverage"/>
+                <param name="coverage" value="Genome_1"/>
+            </conditional>
+            <output name="out_file" ftype="tabular">
+                <assert_contents>
+                    <has_line line="Genome&#009;sitesCovered1Times&#009;sitesCovered2Times&#009;sitesCovered3Times&#009;sitesCovered4Times&#009;sitesCovered5Times"/>
+                    <has_line line="Genome_1&#009;5472&#009;4688&#009;3516&#009;2637&#009;1465"/>
+                    <has_n_lines n="4"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="1">
+            <param name="input_hal" value="halTest.hal"/>
+            <conditional name="mode">
                 <param name="option" value="--bedSequences"/>
                 <param name="bedSequences" value="Genome_0"/>
             </conditional>
@@ -333,8 +352,8 @@
             </conditional>
             <output name="out_file" ftype="tabular">
                   <assert_contents>
-                    <has_line line="SequenceName&#009; Length&#009; NumTopSegments&#009; NumBottomSegments"/>
-                    <has_line line="Genome_0_seq&#009; 1758&#009; 0&#009; 8"/>
+                    <has_line line="SequenceName&#009;Length&#009;NumTopSegments&#009;NumBottomSegments"/>
+                    <has_line line="Genome_0_seq&#009;1758&#009;0&#009;8"/>
                     <has_n_lines n="3"/>
                 </assert_contents>
             </output>
@@ -372,8 +391,8 @@
             </conditional>
             <output name="out_file" ftype="tabular">
                 <assert_contents>
-                    <has_line line="Genome&#009; % ID&#009; numID&#009; numSites"/>
-                    <has_line line="Genome_0&#009; 1&#009; 1758&#009; 1758"/>
+                    <has_line line="Genome&#009;% ID&#009;numID&#009;numSites"/>
+                    <has_line line="Genome_0&#009;1&#009;1758&#009;1758"/>
                     <has_n_lines n="5"/>
                 </assert_contents>
             </output>
@@ -469,6 +488,32 @@
                 </assert_contents>
             </output>
         </test>
+        <test expect_num_outputs="1">
+            <param name="input_hal" value="halTestExtended.hal"/>
+            <conditional name="mode">
+                <param name="option" value="--span"/>
+                <param name="span" value="Genome_0,Genome_2"/>
+            </conditional>
+            <output name="out_file" ftype="txt">
+                <assert_contents>
+                    <has_text text="Insert Genome_2"/>
+                    <has_n_lines n="1"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="1">
+            <param name="input_hal" value="halTest.hal"/>
+            <conditional name="mode">
+                <param name="option" value="--assembly"/>
+            </conditional>
+            <output name="out_file" ftype="tabular">
+                <assert_contents>
+                    <has_line line="Genome&#009;TotalLength&#009;NumContigs&#009;MinContigLength&#009;MaxContigLength&#009;MeanContigLength&#009;MedianContigLength&#009;N50&#009;L50"/>
+                    <has_line line="Genome_1&#009;5472&#009;1&#009;5472&#009;5472&#009;5472&#009;0&#009;5472&#009;1"/>
+                    <has_n_lines n="5"/>
+                </assert_contents>
+            </output>
+        </test>
     </tests>
     <help><![CDATA[
 halStats prints structural and summary information from a HAL file, which must be provided as input.
@@ -482,7 +527,7 @@
 
 The tool generates different output formats based on the selected type of statistic:
 
-- **Tabular** for --coverage, --allCoverage, --sequenceStats, --percentID, --baseComp, --chromSizes, --metaData, --numSegments, or --genomeMetaData
+- **Tabular** for --coverage, --allCoverage, --sequenceStats, --percentID, --baseComp, --chromSizes, --metaData, --numSegments, --genomeMetaData, or --assembly
 - **BED** for --bedSequences, --topSegments, or --bottomSegments
 - Plain **text** for all other type of statistics