Generated banner for Pacsomatic
Generated logo for Pacsomatic

Pacsomatic

K-DenseCommunityCreated by Beifang NiuDistributed by K-Dense

  • Skill
  • Workflow
  • Science and research
  • MIT
  • Low risk
  • Has scripts

From the author

Prepares and launches nf-core/pacsomatic matched tumor-normal PacBio HiFi genomics workflows from unaligned BAM inputs. Supports samplesheet generation, pinned Nextflow launch artifacts, local checks, LSF/Slurm/PBS Pro/SGE launcher submission, and startup troubleshooting. Use for pacsomatic run preparation and execution, not general short-read somatic analysis or medical imaging PACS.
— the description by Beifang Niu

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

pacsomatic provides a structured workflow for preparing and launching nf-core/pacsomatic pipelines. It handles the generation of required samplesheets, reproducible launch artifacts, and submission scripts for various HPC schedulers like Slurm, LSF, PBS Pro, and SGE. The tool is designed specifically for unaligned PacBio HiFi BAM inputs, ensuring that necessary metadata and modification tags are respected while providing a controlled environment for pipeline execution and troubleshooting.

What it does

  • Generates samplesheets for matched tumor-normal PacBio HiFi pairs.
  • Creates reproducible Nextflow launch artifacts and configuration files.
  • Supports local execution and submission to HPC schedulers including Slurm, LSF, PBS, and SGE.
  • Provides a dry-run mode for validating helper settings and identifying missing tools.
  • Pins specific pipeline revisions to ensure reproducible analysis.
  • Assists in startup troubleshooting by managing driver logs and execution state.

When to use it

  • When you need to process matched tumor-normal PacBio HiFi genomic data using the nf-core/pacsomatic pipeline.
  • When you require a reproducible, automated way to generate samplesheets and launch scripts for HPC environments.
  • When you need to perform a dry-run to verify workflow configuration before submitting to a cluster.
  • When you are working with unaligned HiFi BAM inputs and need to ensure proper handling of PacBio-specific metadata.

Advantages

  • Reduces manual configuration errors by automating samplesheet and script generation.
  • Supports multiple HPC schedulers, facilitating deployment across different research infrastructures.
  • Ensures reproducibility by pinning pipeline versions and managing launch artifacts.
  • Provides clear separation between driver configuration and pipeline-specific parameters.

Usage examples

“Prepare a pacsomatic run for patient P001 with tumor and normal BAMs using the apptainer profile.”
The tool generates a samplesheet, a params YAML file, and a dry-run script in the specified output directory, validating the inputs without launching the pipeline.
“Submit a pacsomatic workflow to a Slurm cluster with 8GB memory and 48 hours walltime.”
The tool creates a Slurm submission script configured with the requested resources and executes the Nextflow driver to initiate the pipeline on the cluster.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/k-dense-ai/pacsomatic/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip pacsomatic.zip -d .agents/skills

Documentation by Beifang Niu

pacsomatic

When to use

Use scripts/run_pacsomatic.py to prepare one matched PacBio HiFi tumor/normal pair, generate a samplesheet and reproducible launch artifacts, and launch locally or submit the Nextflow driver to a scheduler. The pipeline realigns input BAMs; this helper targets unaligned HiFi BAMs and optional PacBio .pbi indexes. Do not substitute short reads or treat a BAM filename as evidence of platform, matched identity, or methylation information.

The reviewed upstream dev commit is 24c84cb371b0339c1d65a4de9451671945e19772. GitHub had no releases or tags on 2026-10-01, despite the internal manifest saying 1.0.0. The helper pins that commit by default for nf-core/pacsomatic; it does not invent a release tag. This is a source-reviewed development workflow, not a clinically validated assay. See references/pacsomatic_guide.md for sources and scientific checks.

Workflow

  1. Obtain distinct tumor and normal BAM paths, patient ID, distinct sample IDs, output directory, and exactly one reference mode: --fasta or --genome. IDs and BAM/PBI/FASTA paths must have no whitespace. Local inputs must be nonempty regular files. Remote BAM/PBI/FASTA URIs are passed through without downloading or authenticating; use managed filesystem/cloud credentials, never embed secrets or signed URLs in generated files.

  2. Confirm PacBio HiFi read groups and sample identity from acquisition metadata; confirm that MM/ML modification tags needed for methylation have been retained. Verify reference sequence/contig compatibility for every annotation resource.

  3. Generate artifacts with --dry-run. This performs helper checks and writes files, but does not invoke the pipeline, validate BAM contents, check remote availability, resolve every pipeline parameter, or verify biological suitability. Missing runtime tools are warnings here. --dry-run cannot be combined with --run/--submit, cloning, or environment creation.

  4. Review samplesheet, generated params YAML, script, pipeline revision, profiles, and branch-specific resources/skips. Existing artifacts require explicit --overwrite; input files can never be artifact targets. config.yaml is an operator reference, not an automatically loaded configuration file.

  5. For execution, select the actual runtime with --use-current-path or an existing --conda-env. Load cluster modules before invoking the helper; --module-load only repeats those commands in the generated script. No Conda YAML is bundled; creating an environment needs --conda-env-file explicitly.

  6. Use --run only for requested execution. For HPC, distinguish the outer launcher scheduler (--executor) from Nextflow's per-task process.executor, configured by a site profile or --nextflow-config. Driver CPU/memory requests do not constrain task resources. Read references/config-and-output.md.

  7. Report artifact paths, revision, checks/warnings, run type, submission ID if present, and a concrete next QC or failure-triage step. Scheduler acceptance is not pipeline completion. Keep the output directory and work/cache state stable for --resume; scripts run with the output directory as their cwd.

Examples

Run these from the repository root. Paths and site settings are illustrative; local tests use synthetic placeholders only, not human genomic data.

python skills/pacsomatic/scripts/run_pacsomatic.py \
  --tumor-bam /data/P001_T.bam --normal-bam /data/P001_N.bam \
  --patient-id P001 --tumor-sample-id P001_T --normal-sample-id P001_N \
  --outdir /results/P001 --fasta /refs/GRCh38.fa \
  --profile apptainer --use-current-path --dry-run

After reviewing artifacts, a Slurm launch can use the same inputs plus the following options (replace --dry-run with --run):

--executor slurm --queue compute --project my_account
--cpus 2 --memory-gb 8 --walltime 48:00
--nextflow-config /configs/slurm.config --overwrite --run

Those resources are for the driver, assuming the reviewed infrastructure config sets process.executor = 'slurm' and suitable task queue/resources. The helper normalizes 48:00 to Slurm 48:00:00 (48 hours). Do not add a sanger profile unless actually using that institution's LSF infrastructure.

Custom pipeline parameters go in --params-file; infrastructure goes in --nextflow-config (-c). The helper's explicit input/outdir/reference options win over params-file values. --extra-args is tokenized and shell-quoted, but cannot override these managed inputs/configuration options. Keep paths inside external params/config files absolute because the launcher cwd is the outdir.

Verification and references

uv run skills-ref validate skills/pacsomatic
python tests/run_all.py --isolated pacsomatic

The standard-library suite checks local artifact behavior, path protections, CLI modes, runtime failures and mocked scheduler submissions. Native Nextflow checks use a tiny local workflow; they do not establish that pacsomatic's full containerized scientific pipeline succeeds on a given dataset or cluster.

Files

references/agent-playbook.md

Operator playbook

  1. Establish one true matched PacBio HiFi tumor/normal pair from acquisition metadata. Require patient and sample IDs; do not invent clinical identifiers.

  2. Select a reference with exact assembly, contig naming and resource provenance. FASTA alone does not supply VEP, SV annotation, clonality or signature resources.

  3. Prepare artifacts with the helper's --dry-run and --use-current-path. Report each warning and separate file/name checks from unperformed BAM, schema, network, container and scheduler checks.

  4. Review samplesheet.csv: tumor status 1, normal status 0, same patient, distinct samples/files. Confirm that optional .pbi indexes correspond to their BAM. Confirm that MM/ML modification tags survived input processing before expecting methylation results.

  5. Review commit pin, params, profiles and generated shell script. Read local infrastructure configuration before launch. --executor slurm by itself does not set the task executor to Slurm. Default config.yaml is descriptive and is not loaded by Python.

  6. Execute only when requested. A new run uses --run; reusing generated artifacts needs --overwrite. If using a local checkout, record git HEAD and any uncommitted diff separately and omit --pipeline-version.

  7. Return the exact artifact/script paths, run type and checked scope, requested pipeline revision, submission job ID if parsed, and one next QC/triage action. Do not label a queued job complete or helper dry-run as pipeline validation.

  8. On failure, preserve the driver log, .nextflow.log, work task logs, params and samplesheet. Do not delete work/cache before deciding whether to resume. Keep secrets and identifiable sequencing metadata out of shared logs/reports.

All example commands in the main skill use repository-root paths. When the skill is installed elsewhere, resolve scripts/run_pacsomatic.py relative to its skill directory; .github/skills/pacsomatic is not this repository's layout.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Python

The author says: Requires Python 3.10+ for the standard-library helper. Execution requires Bash, Nextflow >=24.04.2, a compatible Java runtime (current Nextflow supports Java 17-26), the selected container runtime and optionally a scheduler. Network access is needed for uncached pipeline code, plugins, references and containers.

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Beifang Niu
Publisher
K-Dense (Community)
Distributed by
K-Dense
Source
K-Dense-AI/scientific-agent-skills · skills/pacsomatic · commit a25cf9e
Licence
MIT License (redistribution allowed)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Beifang Niu or K-Dense.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pacsomatic.zip