pacsomatic
Operator toolkit for nf-core/pacsomatic matched tumor-normal workflows from BAM inputs. Use this skill when the user needs to validate run inputs, generate pacsomatic-compliant samplesheets, prepare reproducible Nextflow launch artifacts, run locally or submit to schedulers (LSF/Slurm/PBS/SGE), and triage execution failures. Triggers on requests to run pacsomatic, prepare launch commands/scripts, perform dry-run checks, or troubleshoot pipeline startup and scheduler submission errors.
Install this skill
Works with Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, and 70+ other harnesses.
npx skills add KalarisLabs/research-agent-skills --skill pacsomaticuvx research-agent-skills install pacsomaticDocumentation & Instructions
pacsomatic
Overview
This skill provides a reproducible execution workflow for nf-core/pacsomatic, centered on a single helper entrypoint that handles validation, artifact generation, and optional execution.
Primary entrypoint:
scripts/run_pacsomatic.py
The helper script:
- validates required identifiers, files, reference mode, and runtime prerequisites
- writes a pacsomatic-compatible samplesheet (
patient,sample,status,bam,pbi) - generates a params YAML and launch script for reproducible reruns
- supports dry-run validation and run/submit execution paths
Use this skill as the default path for pacsomatic operations. Do not bypass it with manually assembled nextflow run nf-core/pacsomatic commands unless the user explicitly asks for manual command construction.
When to Use This Skill
Invoke this skill when the user asks to:
- run matched tumor-normal analysis from BAM files
- generate or fix pacsomatic samplesheet and launch artifacts
- execute locally or submit to schedulers (LSF/Slurm/PBS/SGE)
- perform dry-run validation before execution
- troubleshoot launch failures or summarize run outputs
Do not use this skill for:
- deep biological interpretation beyond run-level sanity checks
- editing pipeline internals unless explicitly requested
Typical trigger phrases:
- "run nf-core/pacsomatic for this tumor-normal pair"
- "prepare pacsomatic samplesheet and launch script"
- "do a dry run first and tell me what is missing"
- "submit pacsomatic to slurm/lsf and return the job id"
- "why did pacsomatic submission fail"
Routing and Execution Rules
- Always collect required run inputs first.
- Always route through
scripts/run_pacsomatic.pyfor validation and artifact generation. - Default to
--dry-runwhen the user asks for checks/validation only. - Use
--runonly when the user asks to execute/submit. - For scheduler modes, include executor-specific resource arguments and return detected job ID when available.
- If execution fails, report first failure point and next triage target (
.nextflow.log,pipeline_info, failing task logs).
Inputs Required
Required:
- tumor BAM path
- normal BAM path
- patient ID
- tumor sample ID
- normal sample ID
- output directory
- exactly one reference mode:
--fastaor--genome
Optional:
- profile, resources, scheduler account/queue
- pipeline version (
-r) - params file, resume/report/dag flags
--dry-runand/or--run
Workflow
- Validate identity and input constraints.
- Validate required local paths (BAM, optional PBI, optional FASTA).
- Resolve runtime and dependency checks.
- Build samplesheet and generated params YAML.
- Generate launch script for selected executor.
- If
--dry-runand not--run, stop after artifact generation. - If
--run, execute locally or submit to scheduler. - Return command/script path, validation status, and job ID (if detected).
Agent Response Contract
Every response after invocation should include:
- exact command used or generated script path
- confirmation that validation checks ran
- run type (
dry-runvsrun) - scheduler job ID when available
- one concrete next step for validation/triage
Quick Start
Dry run:
python scripts/run_pacsomatic.py \
--tumor-bam /path/to/tumor.bam \
--normal-bam /path/to/normal.bam \
--patient-id P001 \
--tumor-sample-id P001_T \
--normal-sample-id P001_N \
--outdir /path/to/output \
--genome GRCh38 \
--profile singularity,sanger \
--dry-run
Scheduler execution example (Slurm):
python scripts/run_pacsomatic.py \
--tumor-bam /path/to/tumor.bam \
--normal-bam /path/to/normal.bam \
--patient-id P001 \
--tumor-sample-id P001_T \
--normal-sample-id P001_N \
--outdir /path/to/output \
--genome GRCh38 \
--profile singularity,sanger \
--executor slurm \
--queue compute \
--project my_account \
--cpus 16 \
--memory-gb 64 \
--walltime 48:00 \
--run
Configuration
Use config.yaml as the baseline for profile/executor/runtime defaults. Override at invocation time when user requirements differ.
Testing
Run unit tests from skill root:
python -m unittest discover -s tests/pacsomatic -v
References
references/agent-playbook.mdreferences/config-and-output.mdreferences/pacsomatic_guide.mdscripts/run_pacsomatic.py
Agent operating procedure
- Check the environment. Confirm tool versions, the reference genome/annotation build and the input formats (FASTQ, BAM, VCF, h5ad).
- Pin down the inputs. Confirm formats, identifiers and parameters from the data or the user. Ask rather than guess any value that changes the result.
- Run a small version first. Run the pipeline on a small subset (one sample, one chromosome, a few thousand cells) first.
- Execute the full task using the instructions and references above.
- Validate the result. Check QC metrics, sample identities, genome build consistency and batch effects before interpreting results.
- Report. State what was run (versions, commands, parameters), what was checked, and what is still uncertain.
| If this happens | Do this |
|---|---|
| Genome builds or identifiers do not match between inputs | Stop and harmonize (liftover, ID mapping) before continuing. |
| A function, flag or endpoint in these instructions is missing in the installed version | Check the installed version's own documentation (help(), --help, official docs), adapt, and tell the user. Never invent an API. |
| A required input, identifier or parameter is ambiguous | Ask the user, or state the assumption explicitly before running. |
Integrity rules
- Never fabricate results, parameters, identifiers, citations or statistics. If something cannot be run or verified, say so plainly.
- Do not interpret biological significance beyond what the statistics support; report multiple-testing correction.
- Treat version-specific details here as possibly outdated: confirm them against the official documentation for the installed version.
- Ask before actions that cost money, consume shared GPUs or cloud quota, touch personal or patient data, or cannot be undone.
Related skills
nextflow: Build, run, and debug Nextflow data pipelines and nf-core workflows end to end.
Trigger Prompts & Evaluation Corpus
These evaluation prompts test that the agent correctly selects pacsomatic for relevant tasks and leaves it out for near misses.
Should trigger (3)
- should trigger
“do a dry run of pacsomatic on my tumor/normal pair first and tell me what's missing”
expects Collects the required inputs (tumor/normal BAM paths, patient and sample IDs, output dir, and exactly one of fasta or genome) and asks for any that are missing. Then routes through scripts/run_pacsomatic.py with --dry-run, not --run, and reports the command, validation status, run type and a next step.
- should trigger
“I have PacBio HiFi BAMs for patient P017: /data/p017/P017_T.hifi.bam (sample P017_T) and /data/p017/P017_N.hifi.bam (sample P017_N), reference is /ref/GRCh38.fa. Submit it to our Slurm cluster, partition 'long', account 'onc-lab', output in /scratch/p017_out, and give me the job id. Last time sbatch failed with 'Invalid account or account/partition combination specified'.”
expects Uses scripts/run_pacsomatic.py with the Slurm executor, --fasta, and the queue and account arguments. Uses --run because submission was requested. Generates the samplesheet (patient,sample,status,bam,pbi), params YAML and launch script, and returns the detected job ID. Does not hand-assemble a nextflow run command. If it fails, reports the first failure point and points to .nextflow.log and the scheduler error, noting the account/partition mismatch.
- should trigger
“I've got long-read tumor and matched normal BAMs for one patient and want somatic variant calls through the nf-core long-read somatic workflow. Can you get everything set up so I can rerun it later exactly the same way?”
expects Recognizes this as a pacsomatic matched tumor-normal task. Gathers the missing inputs (IDs, output dir, reference mode). Generates the samplesheet, params YAML and launch script via scripts/run_pacsomatic.py so the run is reproducible. States the run type (dry-run unless execution was requested) and gives a next step.
Near misses (2)
- near miss
“I'm writing a custom Nextflow DSL2 module for bcftools norm and my channel keeps emitting an empty tuple. Can you help me debug the process and the workflow block?”
expects Does not use pacsomatic. This is general Nextflow DSL2 development (processes, channels), so it should be handled by the nextflow skill.
- near miss
“Here is the somatic VCF from my tumor-normal run. Which of these driver mutations are likely clinically actionable in lung adenocarcinoma, and what therapies would they suggest?”
expects Does not use pacsomatic. The request is for biological and clinical interpretation of variants, not run orchestration, which the skill excludes. Should not invent therapies or actionability claims beyond the evidence. It should say what can be supported and recommend appropriate annotation and curation resources.