oxo-flow-cli 0.14.1

CLI for the oxo-flow bioinformatics pipeline engine
# 03 — Parallel Sample Processing
# Process multiple samples in parallel using wildcard expansion.
# Demonstrates: {sample} wildcards, fan-out/fan-in, resource declarations.

[workflow]
name = "parallel-samples"
version = "1.0.0"
description = "Process multiple samples in parallel using wildcards"
author = "oxo-flow examples"

[defaults]
threads = 2
memory = "4G"

# Define the sample list for {sample} wildcard expansion.
# Each entry under [[sample_groups]] creates one expanded instance
# per rule that uses the {sample} wildcard.
[[sample_groups]]
name = "all"
samples = ["sampleA", "sampleB", "sampleC"]

[[rules]]
name = "preprocess"
input = ["raw/{sample}.txt"]
output = ["processed/{sample}.clean.txt"]
shell = """
mkdir -p processed
sed '/^$/d' {input[0]} | sort > {output[0]}
"""

[[rules]]
name = "analyze"
input = ["processed/{sample}.clean.txt"]
output = ["analysis/{sample}.stats.txt"]
shell = """
mkdir -p analysis
lines=$(wc -l < {input[0]})
words=$(wc -w < {input[0]})
chars=$(wc -c < {input[0]})
echo "sample: {sample}" > {output[0]}
echo "lines: $lines" >> {output[0]}
echo "words: $words" >> {output[0]}
echo "chars: $chars" >> {output[0]}
"""

[rules.resources]
threads = 4
memory = "8G"

[[rules]]
name = "aggregate"
input = ["analysis/sampleA.stats.txt", "analysis/sampleB.stats.txt", "analysis/sampleC.stats.txt"]
output = ["results/combined_report.txt"]
shell = """
mkdir -p results
echo "=== Combined Analysis Report ===" > {output[0]}
echo "Generated by oxo-flow" >> {output[0]}
echo "" >> {output[0]}
cat {input} >> {output[0]}
"""