LatchBio Integration
Overview
Latch is a Python framework for building and deploying bioinformatics workflows as serverless pipelines. Built on Flyte, create workflows with @workflow/@task decorators, manage cloud data with LatchFile/LatchDir, configure resources, and integrate Nextflow/Snakemake pipelines.
Core Capabilities
The Latch platform provides four main areas of functionality:
1. Workflow Creation and Deployment
- Define serverless workflows using Python decorators
- Support for native Python, Nextflow, and Snakemake pipelines
- Automatic containerization with Docker
- Auto-generated no-code user interfaces
- Version control and reproducibility
2. Data Management
- Cloud storage abstractions (LatchFile, LatchDir)
- Structured data organization with Registry (Projects → Tables → Records)
- Type-safe data operations with links and enums
- Automatic file transfer between local and cloud
- Glob pattern matching for file selection
3. Resource Configuration
- Pre-configured task decorators (@small_task, @large_task, @small_gpu_task, @large_gpu_task)
- Custom resource specifications (CPU, memory, GPU, storage)
- GPU support (K80, V100, A100)
- Timeout and storage configuration
- Cost optimization strategies
4. Verified Workflows
- Production-ready pre-built pipelines
- Bulk RNA-seq, DESeq2, pathway analysis
- AlphaFold and ColabFold for protein structure prediction
- Single-cell tools (ArchR, scVelo, emptyDropsR)
- CRISPR analysis, phylogenetics, and more
Quick Start
Installation and Setup
# Install Latch SDK
python3 -m pip install latch
# Login to Latch
latch login
# Initialize a new workflow
latch init my-workflow
# Register workflow to platform
latch register my-workflow
Prerequisites:
- Docker installed and running
- Latch account credentials
- Python 3.8+
Basic Workflow Example
from latch import workflow, small_task
from latch.types import LatchFile
@small_task
def process_file(input_file: LatchFile) -> LatchFile:
"""Process a single file"""
# Processing logic
return output_file
@workflow
def my_workflow(input_file: LatchFile) -> LatchFile:
"""
My bioinformatics workflow
Args:
input_file: Input data file
"""
return process_file(input_file=input_file)
When to Use This Skill
This skill should be used when encountering any of the following scenarios:
Workflow Development:
- "Create a Latch workflow for RNA-seq analysis"
- "Deploy my pipeline to Latch"
- "Convert my Nextflow pipeline to Latch"
- "Add GPU support to my workflow"
- Working with
@workflow, @task decorators
Data Management:
- "Organize my sequencing data in Latch Registry"
- "How do I use LatchFile and LatchDir?"
- "Set up sample tracking in Latch"
- Working with
latch:/// paths
Resource Configuration:
- "Configure GPU for AlphaFold on Latch"
- "My task is running out of memory"
- "How do I optimize workflow costs?"
- Working with task decorators
Verified Workflows:
- "Run AlphaFold on Latch"
- "Use DESeq2 for differential expression"
- "Available pre-built workflows"
- Using
latch.verified module
Detailed Documentation
This skill includes comprehensive reference documentation organized by capability:
references/workflow-creation.md
Read this for:
- Creating and registering workflows
- Task definition and decorators
- Supporting Python, Nextflow, Snakemake
- Launch plans and conditional sections
- Workflow execution (CLI and programmatic)
- Multi-step and parallel pipelines
- Troubleshooting registration issues
Key topics:
latch init and latch register commands
@workflow and @task decorators
- LatchFile and LatchDir basics
- Type annotations and docstrings
- Launch plans with preset parameters
- Conditional UI sections
references/data-management.md
Read this for:
- Cloud storage with LatchFile and LatchDir
- Registry system (Projects, Tables, Records)
- Linked records and relationships
- Enum and typed columns
- Bulk operations and transactions
- Integration with workflows
- Account and workspace management
Key topics:
latch:/// path format
- File transfer and glob patterns
- Creating and querying Registry tables
- Column types (string, number, file, link, enum)
- Record CRUD operations
- Workflow-Registry integration
references/resource-configuration.md
Read this for:
- Task resource decorators
- Custom CPU, memory, GPU configuration
- GPU types (K80, V100, A100)
- Timeout and storage settings
- Resource optimization strategies
- Cost-effective workflow design
- Monitoring and debugging
Key topics:
@small_task, @large_task, @small_gpu_task, @large_gpu_task
@custom_task with precise specifications
- Multi-GPU configuration
- Resource selection by workload type
- Platform limits and quotas
references/verified-workflows.md
Read this for:
- Pre-built production workflows
- Bulk RNA-seq and DESeq2
- AlphaFold and ColabFold
- Single-cell analysis (ArchR, scVelo)
- CRISPR editing analysis
- Pathway enrichment
- Integration with custom workflows
Key topics:
latch.verified module imports
- Available verified workflows
- Workflow parameters and options
- Combining verified and custom steps
- Version management
Common Workflow Patterns
Complete RNA-seq Pipeline
from latch import workflow, small_task, large_task
from latch.types import LatchFile, LatchDir
@small_task
def quality_control(fastq: LatchFile) -> LatchFile:
"""Run FastQC"""
return qc_output
@large_task
def alignment(fastq: LatchFile, genome: str) -> LatchFile:
"""STAR alignment"""
return bam_output
@small_task
def quantification(bam: LatchFile) -> LatchFile:
"""featureCounts"""
return counts
@workflow
def rnaseq_pipeline(
input_fastq: LatchFile,
genome: str,
output_dir: LatchDir
) -> LatchFile:
"""RNA-seq analysis pipeline"""
qc = quality_control(fastq=input_fastq)
aligned = alignment(fastq=qc, genome=genome)
return quantification(bam=aligned)
GPU-Accelerated Workflow
from latch import workflow, small_task, large_gpu_task
from latch.types import LatchFile
@small_task
def preprocess(input_file: LatchFile) -> LatchFile:
"""Prepare data"""
return processed
@large_gpu_task
def gpu_computation(data: LatchFile) -> LatchFile:
"""GPU-accelerated analysis"""
return results
@workflow
def gpu_pipeline(input_file: LatchFile) -> LatchFile:
"""Pipeline with GPU tasks"""
preprocessed = preprocess(input_file=input_file)
return gpu_computation(data=preprocessed)
Registry-Integrated Workflow
from latch import workflow, small_task
from latch.registry.table import Table
from latch.registry.record import Record
from latch.types import LatchFile
@small_task
def process_and_track(sample_id: str, table_id: str) -> str:
"""Process sample and update Registry"""
# Get sample from registry
table = Table.get(table_id=table_id)
records = Record.list(table_id=table_id, filter={"sample_id": sample_id})
sample = records[0]
# Process
input_file = sample.values["fastq_file"]
output = process(input_file)
# Update registry
sample.update(values={"status": "completed", "result": output})
return "Success"
@workflow
def registry_workflow(sample_id: str, table_id: str):
"""Workflow integrated with Registry"""
return process_and_track(sample_id=sample_id, table_id=table_id)
Best Practices
Workflow Design
- Use type annotations for all parameters
- Write clear docstrings (appear in UI)
- Start with standard task decorators, scale up if needed
- Break complex workflows into modular tasks
- Implement proper error handling
Data Management
- Use consistent folder structures
- Define Registry schemas before bulk entry
- Use linked records for relationships
- Store metadata in Registry for traceability
Resource Configuration
- Right-size resources (don't over-allocate)
- Use GPU only when algorithms support it
- Monitor execution metrics and optimize
- Design for parallel execution when possible
Development Workflow
- Test locally with Docker before registration
- Use version control for workflow code
- Document resource requirements
- Profile workflows to determine actual needs
Troubleshooting
Common Issues
Registration Failures:
- Ensure Docker is running
- Check authentication with
latch login
- Verify all dependencies in Dockerfile
- Use
--verbose flag for detailed logs
Resource Problems:
- Out of memory: Increase memory in task decorator
- Timeouts: Increase timeout parameter
- Storage issues: Increase ephemeral storage_gib
Data Access:
- Use correct
latch:/// path format
- Verify file exists in workspace
- Check permissions for shared workspaces
Type Errors:
- Add type annotations to all parameters
- Use LatchFile/LatchDir for file/directory parameters
- Ensure workflow return type matches actual return
Additional Resources
Support
For issues or questions:
- Check documentation links above
- Search GitHub issues
- Ask in Slack community
- Contact support@latch.bio
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: latchbio-integration3description: Latch platform for bioinformatics workflows. Build pipelines with Latch SDK, @workflow/@task decorators, deploy serverless workflows, LatchFile/LatchDir, Nextflow/Snakemake integration. Use when this capability is needed.4---56# LatchBio Integration78## Overview910Latch is a Python framework for building and deploying bioinformatics workflows as serverless pipelines. Built on Flyte, create workflows with @workflow/@task decorators, manage cloud data with LatchFile/LatchDir, configure resources, and integrate Nextflow/Snakemake pipelines.1112## Core Capabilities1314The Latch platform provides four main areas of functionality:1516### 1. Workflow Creation and Deployment17- Define serverless workflows using Python decorators18- Support for native Python, Nextflow, and Snakemake pipelines19- Automatic containerization with Docker20- Auto-generated no-code user interfaces21- Version control and reproducibility2223### 2. Data Management24- Cloud storage abstractions (LatchFile, LatchDir)25- Structured data organization with Registry (Projects → Tables → Records)26- Type-safe data operations with links and enums27- Automatic file transfer between local and cloud28- Glob pattern matching for file selection2930### 3. Resource Configuration31- Pre-configured task decorators (@small_task, @large_task, @small_gpu_task, @large_gpu_task)32- Custom resource specifications (CPU, memory, GPU, storage)33- GPU support (K80, V100, A100)34- Timeout and storage configuration35- Cost optimization strategies3637### 4. Verified Workflows38- Production-ready pre-built pipelines39- Bulk RNA-seq, DESeq2, pathway analysis40- AlphaFold and ColabFold for protein structure prediction41- Single-cell tools (ArchR, scVelo, emptyDropsR)42- CRISPR analysis, phylogenetics, and more4344## Quick Start4546### Installation and Setup4748```bash49# Install Latch SDK50python3 -m pip install latch5152# Login to Latch53latch login5455# Initialize a new workflow56latch init my-workflow5758# Register workflow to platform59latch register my-workflow60```6162**Prerequisites:**63- Docker installed and running64- Latch account credentials65- Python 3.8+6667### Basic Workflow Example6869```python70from latch import workflow, small_task71from latch.types import LatchFile7273@small_task74def process_file(input_file: LatchFile) -> LatchFile:75 """Process a single file"""76 # Processing logic77 return output_file7879@workflow80def my_workflow(input_file: LatchFile) -> LatchFile:81 """82 My bioinformatics workflow8384 Args:85 input_file: Input data file86 """87 return process_file(input_file=input_file)88```8990## When to Use This Skill9192This skill should be used when encountering any of the following scenarios:9394**Workflow Development:**95- "Create a Latch workflow for RNA-seq analysis"96- "Deploy my pipeline to Latch"97- "Convert my Nextflow pipeline to Latch"98- "Add GPU support to my workflow"99- Working with `@workflow`, `@task` decorators100101**Data Management:**102- "Organize my sequencing data in Latch Registry"103- "How do I use LatchFile and LatchDir?"104- "Set up sample tracking in Latch"105- Working with `latch:///` paths106107**Resource Configuration:**108- "Configure GPU for AlphaFold on Latch"109- "My task is running out of memory"110- "How do I optimize workflow costs?"111- Working with task decorators112113**Verified Workflows:**114- "Run AlphaFold on Latch"115- "Use DESeq2 for differential expression"116- "Available pre-built workflows"117- Using `latch.verified` module118119## Detailed Documentation120121This skill includes comprehensive reference documentation organized by capability:122123### references/workflow-creation.md124**Read this for:**125- Creating and registering workflows126- Task definition and decorators127- Supporting Python, Nextflow, Snakemake128- Launch plans and conditional sections129- Workflow execution (CLI and programmatic)130- Multi-step and parallel pipelines131- Troubleshooting registration issues132133**Key topics:**134- `latch init` and `latch register` commands135- `@workflow` and `@task` decorators136- LatchFile and LatchDir basics137- Type annotations and docstrings138- Launch plans with preset parameters139- Conditional UI sections140141### references/data-management.md142**Read this for:**143- Cloud storage with LatchFile and LatchDir144- Registry system (Projects, Tables, Records)145- Linked records and relationships146- Enum and typed columns147- Bulk operations and transactions148- Integration with workflows149- Account and workspace management150151**Key topics:**152- `latch:///` path format153- File transfer and glob patterns154- Creating and querying Registry tables155- Column types (string, number, file, link, enum)156- Record CRUD operations157- Workflow-Registry integration158159### references/resource-configuration.md160**Read this for:**161- Task resource decorators162- Custom CPU, memory, GPU configuration163- GPU types (K80, V100, A100)164- Timeout and storage settings165- Resource optimization strategies166- Cost-effective workflow design167- Monitoring and debugging168169**Key topics:**170- `@small_task`, `@large_task`, `@small_gpu_task`, `@large_gpu_task`171- `@custom_task` with precise specifications172- Multi-GPU configuration173- Resource selection by workload type174- Platform limits and quotas175176### references/verified-workflows.md177**Read this for:**178- Pre-built production workflows179- Bulk RNA-seq and DESeq2180- AlphaFold and ColabFold181- Single-cell analysis (ArchR, scVelo)182- CRISPR editing analysis183- Pathway enrichment184- Integration with custom workflows185186**Key topics:**187- `latch.verified` module imports188- Available verified workflows189- Workflow parameters and options190- Combining verified and custom steps191- Version management192193## Common Workflow Patterns194195### Complete RNA-seq Pipeline196197```python198from latch import workflow, small_task, large_task199from latch.types import LatchFile, LatchDir200201@small_task202def quality_control(fastq: LatchFile) -> LatchFile:203 """Run FastQC"""204 return qc_output205206@large_task207def alignment(fastq: LatchFile, genome: str) -> LatchFile:208 """STAR alignment"""209 return bam_output210211@small_task212def quantification(bam: LatchFile) -> LatchFile:213 """featureCounts"""214 return counts215216@workflow217def rnaseq_pipeline(218 input_fastq: LatchFile,219 genome: str,220 output_dir: LatchDir221) -> LatchFile:222 """RNA-seq analysis pipeline"""223 qc = quality_control(fastq=input_fastq)224 aligned = alignment(fastq=qc, genome=genome)225 return quantification(bam=aligned)226```227228### GPU-Accelerated Workflow229230```python231from latch import workflow, small_task, large_gpu_task232from latch.types import LatchFile233234@small_task235def preprocess(input_file: LatchFile) -> LatchFile:236 """Prepare data"""237 return processed238239@large_gpu_task240def gpu_computation(data: LatchFile) -> LatchFile:241 """GPU-accelerated analysis"""242 return results243244@workflow245def gpu_pipeline(input_file: LatchFile) -> LatchFile:246 """Pipeline with GPU tasks"""247 preprocessed = preprocess(input_file=input_file)248 return gpu_computation(data=preprocessed)249```250251### Registry-Integrated Workflow252253```python254from latch import workflow, small_task255from latch.registry.table import Table256from latch.registry.record import Record257from latch.types import LatchFile258259@small_task260def process_and_track(sample_id: str, table_id: str) -> str:261 """Process sample and update Registry"""262 # Get sample from registry263 table = Table.get(table_id=table_id)264 records = Record.list(table_id=table_id, filter={"sample_id": sample_id})265 sample = records[0]266267 # Process268 input_file = sample.values["fastq_file"]269 output = process(input_file)270271 # Update registry272 sample.update(values={"status": "completed", "result": output})273 return "Success"274275@workflow276def registry_workflow(sample_id: str, table_id: str):277 """Workflow integrated with Registry"""278 return process_and_track(sample_id=sample_id, table_id=table_id)279```280281## Best Practices282283### Workflow Design2841. Use type annotations for all parameters2852. Write clear docstrings (appear in UI)2863. Start with standard task decorators, scale up if needed2874. Break complex workflows into modular tasks2885. Implement proper error handling289290### Data Management2916. Use consistent folder structures2927. Define Registry schemas before bulk entry2938. Use linked records for relationships2949. Store metadata in Registry for traceability295296### Resource Configuration29710. Right-size resources (don't over-allocate)29811. Use GPU only when algorithms support it29912. Monitor execution metrics and optimize30013. Design for parallel execution when possible301302### Development Workflow30314. Test locally with Docker before registration30415. Use version control for workflow code30516. Document resource requirements30617. Profile workflows to determine actual needs307308## Troubleshooting309310### Common Issues311312**Registration Failures:**313- Ensure Docker is running314- Check authentication with `latch login`315- Verify all dependencies in Dockerfile316- Use `--verbose` flag for detailed logs317318**Resource Problems:**319- Out of memory: Increase memory in task decorator320- Timeouts: Increase timeout parameter321- Storage issues: Increase ephemeral storage_gib322323**Data Access:**324- Use correct `latch:///` path format325- Verify file exists in workspace326- Check permissions for shared workspaces327328**Type Errors:**329- Add type annotations to all parameters330- Use LatchFile/LatchDir for file/directory parameters331- Ensure workflow return type matches actual return332333## Additional Resources334335- **Official Documentation**: https://docs.latch.bio336- **GitHub Repository**: https://github.com/latchbio/latch337- **Slack Community**: Join Latch SDK workspace338- **API Reference**: https://docs.latch.bio/api/latch.html339- **Blog**: https://blog.latch.bio340341## Support342343For issues or questions:3441. Check documentation links above3452. Search GitHub issues3463. Ask in Slack community3474. Contact support@latch.bio348349---350> Converted and distributed by [TomeVault](https://tomevault.io/claim/lifangda) — claim your Tome and manage your conversions.351<!-- tomevault:4.0:skill_md:2026-04-11 -->