Expand help text and replace SVGs for filter empty, failed, and null tools

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
nekrut
2026-03-26 09:49:24 -04:00
committed by John Davis
co-authored by Claude Opus 4.6
parent 8b4c2b92d0
commit 171f783b6d
6 changed files with 287 additions and 1479 deletions
@@ -42,21 +42,58 @@
Synopsis
========
Removes empty datasets from a collection.
Removes empty (zero-byte) datasets from a collection.
===========
Description
===========
This tool takes a dataset collection and filters out (removes) datasets that have no content (zero bytes). This is useful for continuing a multi-sample analysis when downstream tools require datasets to have content.
This tool takes a dataset collection and filters out elements that have no content. A dataset is considered empty if it contains zero bytes of actual data (including compressed archives that decompress to nothing).
Optionally, you can provide a replacement dataset. When a replacement is specified, empty elements are replaced with that dataset instead of being removed.
This is useful when a multi-sample analysis produces some empty outputs — for example, when a filtering step removes all reads for certain samples. Downstream tools often fail on empty inputs, so removing them lets the rest of the analysis proceed.
Optionally, you can provide a **replacement dataset**. When specified, empty elements are replaced with that dataset instead of being removed. This preserves the collection size, which is important when element-wise pairing with another collection is needed.
========
Examples
========
**Remove empty elements**
Given a list collection where one sample produced no output::
List: "Filtered reads"
sample1 → reads.fastq (1.2 MB)
sample2 → reads.fastq (0 bytes)
sample3 → reads.fastq (800 KB)
The output keeps only non-empty elements::
List: "Filtered reads (filtered empty datasets)"
sample1 → reads.fastq (1.2 MB)
sample3 → reads.fastq (800 KB)
-------
**Replace instead of remove**
If a replacement dataset is provided, empty elements are swapped rather than dropped, preserving the collection structure::
List: "Filtered reads (filtered empty datasets)"
sample1 → reads.fastq (1.2 MB)
sample2 → replacement.fastq
sample3 → reads.fastq (800 KB)
-------
.. image:: ${static_path}/images/tools/collection_ops/filter_empty.svg
:alt: Filtering empty datasets
:alt: Filter empty datasets from collection
:width: 500
-----
-------
.. class:: infomark
@@ -53,15 +53,52 @@ Removes datasets in the error (red) state from a collection.
Description
===========
This tool takes a dataset collection and filters out (removes) datasets in the failed (red) state. This is useful for continuing a multi-sample analysis when one or more of the samples fails at some point.
This tool takes a dataset collection and filters out elements whose datasets are in the failed (red) state. A dataset enters this state when the tool that created it encountered an error during execution.
Optionally, you can provide a replacement dataset. When a replacement is specified, failed elements are replaced with that dataset instead of being removed.
This is useful when running a multi-sample analysis and one or more samples fail at some step. Rather than restarting the entire analysis, you can remove the failed elements and continue with the samples that succeeded.
Optionally, you can provide a **replacement dataset**. When specified, failed elements are replaced with that dataset instead of being removed. This preserves the collection size, which is important when element-wise pairing with another collection is needed.
========
Examples
========
**Remove failed elements**
Given a list collection where one sample's alignment failed::
List: "Aligned reads"
sample1 → aligned.bam (ok)
sample2 → aligned.bam (error)
sample3 → aligned.bam (ok)
The output keeps only successful elements::
List: "Aligned reads (filtered failed datasets)"
sample1 → aligned.bam
sample3 → aligned.bam
-------
**Replace instead of remove**
If a replacement dataset is provided, failed elements are swapped rather than dropped, preserving the collection structure::
List: "Aligned reads (filtered failed datasets)"
sample1 → aligned.bam
sample2 → replacement.bam
sample3 → aligned.bam
-------
.. image:: ${static_path}/images/tools/collection_ops/filter_error.svg
:alt: Filter failed datasets
:alt: Filter failed datasets from collection
:width: 500
-----
-------
.. class:: infomark
+44 -3
View File
@@ -44,11 +44,52 @@ Removes null (missing) elements from a collection.
Description
===========
This tool takes a dataset collection and filters out null elements. Null elements can appear when workflows use conditional steps -- if a step is skipped, it may produce a null placeholder instead of a real dataset.
This tool takes a dataset collection and filters out null elements. A null element is a placeholder that contains no actual dataset — it appears when a workflow uses conditional steps and a step is skipped, or when an expression tool produces a ``null`` value.
Optionally, you can provide a replacement dataset. When a replacement is specified, null elements are replaced with that dataset instead of being removed.
This is useful for cleaning up collections produced by conditional workflows. Downstream tools cannot process null elements, so removing them ensures the rest of the analysis can proceed.
-----
Optionally, you can provide a **replacement dataset**. When specified, null elements are replaced with that dataset instead of being removed. This preserves the collection size, which is important when element-wise pairing with another collection is needed.
========
Examples
========
**Remove null elements**
Given a list collection produced by a conditional workflow where one branch was skipped::
List: "Workflow outputs"
sample1 → result.txt (ok)
sample2 → (null)
sample3 → result.txt (ok)
The output keeps only real elements::
List: "Workflow outputs (without null datasets)"
sample1 → result.txt
sample3 → result.txt
-------
**Replace instead of remove**
If a replacement dataset is provided, null elements are swapped rather than dropped, preserving the collection structure::
List: "Workflow outputs (without null datasets)"
sample1 → result.txt
sample2 → replacement.txt
sample3 → result.txt
-------
.. image:: ${static_path}/images/tools/collection_ops/filter_null.svg
:alt: Filter null elements from collection
:width: 500
-------
.. class:: infomark
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 210" width="620" height="210">
<defs>
<filter id="shadow" x="-4%" y="-4%" width="110%" height="110%">
<feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur"/>
<feComponentTransfer in="blur">
<feFuncA type="linear" slope="0.3"/>
</feComponentTransfer>
<feMerge>
<feMergeNode/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#555"/>
</marker>
</defs>
<!-- Left: input collection -->
<rect x="10" y="10" width="210" height="185" rx="8" ry="8" fill="#d9ead3" stroke="#888" stroke-width="1" filter="url(#shadow)"/>
<text x="115" y="30" text-anchor="middle" font-family="sans-serif" font-size="13" font-weight="bold" fill="#333">List</text>
<rect x="25" y="42" width="180" height="28" rx="4" ry="4" fill="#fff" stroke="#aaa" stroke-width="0.7"/>
<text x="115" y="61" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">sample1</text>
<text x="195" y="61" text-anchor="end" font-family="sans-serif" font-size="9" fill="#2e7d32">ok</text>
<!-- Null element (highlighted gray/dashed) -->
<rect x="25" y="78" width="180" height="28" rx="4" ry="4" fill="#f0f0f0" stroke="#999" stroke-width="1.2" stroke-dasharray="4,2"/>
<text x="115" y="97" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#999">sample2</text>
<text x="195" y="97" text-anchor="end" font-family="sans-serif" font-size="9" fill="#999">null</text>
<rect x="25" y="114" width="180" height="28" rx="4" ry="4" fill="#fff" stroke="#aaa" stroke-width="0.7"/>
<text x="115" y="133" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">sample3</text>
<text x="195" y="133" text-anchor="end" font-family="sans-serif" font-size="9" fill="#2e7d32">ok</text>
<text x="115" y="166" text-anchor="middle" font-family="sans-serif" font-size="10" font-style="italic" fill="#999">sample2 is null</text>
<!-- Arrow -->
<line x1="240" y1="92" x2="360" y2="92" stroke="#555" stroke-width="2" marker-end="url(#arrowhead)"/>
<text x="300" y="82" text-anchor="middle" font-family="sans-serif" font-size="12" font-weight="bold" fill="#555">Filter</text>
<!-- Right: filtered collection -->
<rect x="380" y="10" width="220" height="155" rx="8" ry="8" fill="#d9ead3" stroke="#888" stroke-width="1" filter="url(#shadow)"/>
<text x="490" y="30" text-anchor="middle" font-family="sans-serif" font-size="13" font-weight="bold" fill="#333">List (filtered)</text>
<rect x="395" y="42" width="190" height="28" rx="4" ry="4" fill="#fff" stroke="#aaa" stroke-width="0.7"/>
<text x="490" y="61" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">sample1</text>
<rect x="395" y="78" width="190" height="28" rx="4" ry="4" fill="#fff" stroke="#aaa" stroke-width="0.7"/>
<text x="490" y="97" text-anchor="middle" font-family="sans-serif" font-size="12" fill="#333">sample3</text>
<text x="490" y="140" text-anchor="middle" font-family="sans-serif" font-size="10" font-style="italic" fill="#666">null element removed</text>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB