Immunopipe config

From pwwang/immunopipe · View interactive version

Immunopipe config is an AI agent skill from the GitHub repository pwwang/immunopipe. Master skill for generating immunopipe pipeline configurations. Determines pipeline architecture based on data type (scRNA-seq with or without scTCR/BCR-seq) and analysis requirements. Routes to individual process skills for detailed configuration. Use this skill when starting a new immunopipe confi

How to use this skill

Skill file

Immunopipe Configuration Generator (Main Skill)

Purpose: Master skill for generating immunopipe pipeline configurations. Routes to individual process skills and determines pipeline architecture based on analysis requirements.

When to Use This Skill

Pipeline Architecture Decision Tree

Step 1: Data Type Assessment

Ask the user about their data:

  1. Do you have scRNA-seq data?
  1. Do you have scTCR-seq or scBCR-seq data?
  1. Is your RNA data already processed in a Seurat object?

Step 2: Analysis Goals

Ask what analyses they want to perform:

| Goal | Required Processes | Routing |

|------|-------------------|---------|

| Basic clustering & visualization | SampleInfo, SeuratPreparing, SeuratClustering, SeuratClusterStats | Use sampleinfo, seuratpreparing, seuratclustering, seuratclusterstats skills |

| T/B cell selection | Add TOrBCellSelection | Use torbcellselection skill |

| Cell type annotation | Add CellTypeAnnotation; use tool = "mapquery" for reference-based mapping | Use the celltypeannotation skill for new configs; SeuratMap2Ref is deprecated and compatibility-only for existing configs |

| Marker finding | Add ClusterMarkers or MarkersFinder | Use clustermarkers or markersfinder skills |

| TCR clonotype analysis | Add CDR3Clustering, TESSA, ClonalStats | Use cdr3clustering, tessa, clonalstats skills |

| Cell-cell communication | Add CellCellCommunication | Use cellcellcommunication skill |

| Pathway enrichment | Add ScFGSEA | Use scfgsea skill |

| Metabolic analysis | Add ScrnaMetabolicLandscape | Use scrnametaboliclandscape skill |

| Differential expression | Add PseudoBulkDEG | Use pseudobulkdeg skill |

For reference-based mapping, configure:

[CellTypeAnnotation.envs]
tool = "mapquery"

[CellTypeAnnotation.envs.mapquery]
db = "reference.rds"
use = "celltype"

SeuratMap2Ref remains supported only for existing configurations; see the legacy skill.

Step 3: Essential vs Optional Processes

Essential Processes (always needed for TCR route):

Essential Processes (RNA-only route):

Optional Processes (enable only if requested):

Pipeline-Level Configuration

Basic Pipeline Options

name = "my_pipeline"           # Pipeline name (affects workdir and outdir)
outdir = "./output"            # Output directory (default: ./<name>-output)
loglevel = "info"              # Logging level: debug, info, warning, error
forks = 4                      # Number of parallel jobs (adjust based on CPU cores)
cache = true                   # Enable caching (recommended)
error_strategy = "halt"        # halt, ignore, or retry
num_retries = 3                # Number of retries if error_strategy = "retry"

Scheduler Configuration

Local execution (default):

scheduler = "local"

SLURM cluster:

scheduler = "slurm"

[scheduler_opts]
qsub_opts = "-p general -q general -N {job.name} -t {job.index}"

SGE cluster:

scheduler = "sge"

[scheduler_opts]
qsub_opts = "-V -cwd -j yes"

Google Cloud Batch:

# Use: immunopipe gbatch instead of immunopipe
# See gbatch skill for configuration

Plugin Options

[plugin_opts.report]
filters = ["name:Filter"]  # Filter processes in report

[plugin_opts.runinfo]
# Runinfo plugin enabled by default

Routing to Process Skills

When user needs specific process configuration, route to the appropriate skill:

Core Input Processes

Preprocessing Processes

Clustering Processes

Cell Selection

Annotation Processes

Marker Analysis

TCR/BCR Analysis

Downstream Analysis

Metabolic Analysis

Configuration File Structure

A complete TOML configuration file has three sections:

# 1. PIPELINE-LEVEL OPTIONS
name = "my_pipeline"
outdir = "./output"
forks = 4

# 2. PROCESS-LEVEL OPTIONS
[ProcessName]
cache = true
forks = 2  # Override pipeline-level forks for this process

[ProcessName.in]
# Input files specification

[ProcessName.envs]
# Environment variables (process parameters)

# 3. GOOGLE BATCH OPTIONS (if using immunopipe gbatch)
[cli-gbatch]
project = "my-gcp-project"
region = "us-central1"

Example Workflows

Example 1: Basic TCR Analysis

User request: "I have scRNA-seq and scTCR-seq data. I want basic analysis with T cell selection."

Response:

  1. Enable essential TCR processes: SampleInfo, ScRepLoading, SeuratPreparing, SeuratClustering, SeuratClusterStats
  2. Enable T cell selection: SeuratClusteringOfAllCells, TOrBCellSelection
  3. Route to sampleinfo skill to configure input files
  4. Route to each process skill for configuration

Minimal config:

name = "tcr_analysis"
forks = 4

[SampleInfo.in]
infile = ["sample_info.txt"]

[SeuratClusteringOfAllCells]
[TOrBCellSelection]

Example 2: Advanced RNA-only Analysis

User request: "RNA-only data. I need clustering, cell type annotation, marker finding, and pathway enrichment."

Response:

  1. Enable essential RNA processes: SampleInfo, SeuratPreparing, SeuratClustering, SeuratClusterStats
  2. Add requested analyses: CellTypeAnnotation, ClusterMarkers, ScFGSEA
  3. Route to individual skills for configuration

Example 3: Loading from Prepared Seurat Object

User request: "I already have a processed Seurat object. I want to run TCR analysis."

Response:

  1. Use LoadingRNAFromSeurat instead of SampleInfo + SeuratPreparing
  2. Enable TCR processes: ScRepLoading, SeuratClustering, etc.
  3. Set prepared = true in LoadingRNAFromSeurat to skip preprocessing

Important Notes

Process Dependencies

Some processes have dependencies:

When a process has dependencies, the input will be inferred from its dependencies, in in should be specified.

Mutually Exclusive Options

Cache Strategy

Configuration Validation

After generating configuration, validate with:

python -m immunopipe.validate_config config.toml

External References

When process options reference external packages, expand them:

Seurat Functions

Plotthis Functions

DESeq2 Design

GSEA Databases

CellChat Database

Workflow Summary

  1. Assess data type (RNA-only vs TCR/BCR)
  2. Determine analysis goals (clustering, annotation, TCR analysis, etc.)
  3. Select essential processes based on data type
  4. Add optional processes based on goals
  5. Configure pipeline-level options (name, forks, scheduler)
  6. Route to individual process skills for detailed configuration
  7. Generate complete TOML file
  8. Validate configuration before running

Quick Start Templates

For quick starts, use these templates:

Error Prevention

Common configuration errors to avoid:

  1. Missing input specification: Always set [ProcessName.in] for entry processes
  2. TCR data without ScRepLoading: If TCRData/BCRData columns exist, enable ScRepLoading
  3. Contradictory process enablement: Don't enable both "OfAllCells" and regular versions without TOrBCellSelection
  4. Invalid gene names: Use human gene symbols (uppercase) or mouse (title case)
  5. Path issues: Use absolute paths or paths relative to config file location
  6. Resource limits: Set appropriate forks based on available CPU/memory

Next Steps

After generating config:

  1. Save to .toml file (e.g., config.toml)
  2. Run: immunopipe config.toml
  3. Or use web UI: pipen board @config.toml
  4. Or use Google Batch: immunopipe gbatch config.toml

For modifications, route to specific process skills based on what needs to change.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.