Working with Data Types
Data type nodes allow you to pass structured values between code nodes. This tutorial covers the available data types and how to use them.
Available Data Types
| Type | Description | Example |
|---|---|---|
string | Text values | "BRCA1" |
number | Numeric values | 42, 3.14 |
boolean | True/false | true |
list | Array of values | [1, 2, 3] |
dict | Key-value pairs | {"gene": "TP53"} |
file | File path reference | /app/data/counts.csv |
Step 1: Add a Data Type Node
Drag a Data node from the nodebar. Set its type to string and value to BRCA1.
Step 2: Connect to a Python Node
Add a Python node and connect the data node’s output to the Python node’s input:
# 'value' is automatically available from the data node
gene = value
print(f"Looking up gene: {gene}")Step 3: Chain Multiple Data Nodes
Create a small pipeline:
- Data node (
string,"BRCA1") → Python node (query) - Data node (
number,10) → Python node (limit results) - Both Python nodes → Final Python node (combine results)
Passing Complex Data
Use list and dict types to pass structured data:
# Input from a dict data node: {"genes": ["BRCA1", "TP53", "EGFR"]}
genes = value["genes"]
for gene in genes:
print(f"Processing {gene}...")Next: RNA-seq Pipeline
Last updated on