Getting StartedAdding Custom Nodes

Adding Custom Nodes

BioNodulo ships with a large library of nodes, but you will eventually want to wrap a tool that isn’t included. This page is a quick orientation; the full authoring guide lives in Contributing → Creating Custom Nodes.

Three ways to add a node

  1. Install from the registry. Browse the community node registry and add a published node to your workspace with one click. Versions are pinned so your workflows stay reproducible.
  2. Write a local node. Define a node in Python by declaring its inputs, outputs, parameters, and the command it runs. Drop it into your nodes directory and it appears in the palette.
  3. Wrap a container. Point a node at a Docker image and a command template. This is the recommended approach for reproducibility — the tool and all its dependencies travel with the image.

Anatomy of a node

A node definition specifies:

  • inputs — named, typed input ports (e.g. reads: FASTQ, reference: FASTA).
  • outputs — named, typed output ports (e.g. aligned: BAM).
  • params — user-editable parameters with types, defaults, and validation.
  • command / run — how to invoke the underlying tool, templated with the resolved inputs and params.
  • resources — hints about RAM/CPU needs used for scheduling and tier recommendations.
from bionodulo.sdk import node, Input, Output, Param, FASTQ, FASTA, BAM
 
@node(category="Alignment", label="BWA-MEM")
def bwa_mem(
    reads: Input[FASTQ],
    reference: Input[FASTA],
    threads: Param[int] = 4,
) -> Output[BAM]:
    """Align paired-end reads to a reference with BWA-MEM."""
    return run(
        f"bwa mem -t {threads} {reference} {reads.r1} {reads.r2} "
        f"| samtools sort -o {output.bam}"
    )

Validation & types

Custom nodes participate in the same type system as built-in nodes. Declaring accurate port types means the editor can validate connections and the platform can catch mistakes before a run starts.

Next steps