Pacsomatic
K-DenseCommunityCreated by Beifang NiuDistributed by K-Dense
- Skill
- Workflow
- Science and research
- MIT
- Low risk
- Has scripts
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
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/k-dense-ai/pacsomatic/downloadUnzip 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
Obtain distinct tumor and normal BAM paths, patient ID, distinct sample IDs, output directory, and exactly one reference mode:
--fastaor--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.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.
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-runcannot be combined with--run/--submit, cloning, or environment creation.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.yamlis an operator reference, not an automatically loaded configuration file.For execution, select the actual runtime with
--use-current-pathor an existing--conda-env. Load cluster modules before invoking the helper;--module-loadonly repeats those commands in the generated script. No Conda YAML is bundled; creating an environment needs--conda-env-fileexplicitly.Use
--runonly for requested execution. For HPC, distinguish the outer launcher scheduler (--executor) from Nextflow's per-taskprocess.executor, configured by a site profile or--nextflow-config. Driver CPU/memory requests do not constrain task resources. Read references/config-and-output.md.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-runAfter 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 --runThose 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 pacsomaticThe 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
- ATTRIBUTION.mdAdded by AutoGineer966 B
- LICENSE1.0 KiB
- SKILL.md6.3 KiB
- config.yaml1.0 KiB
- references/agent-playbook.md2.0 KiB
- references/config-and-output.md5.8 KiB
- references/pacsomatic_guide.md5.2 KiB
- scripts/run_pacsomatic.pyScript35.9 KiB
references/config-and-output.md
Configuration and outputs
Samplesheet and input scope
The helper writes exactly two records with columns patient,sample,status,bam,pbi:
normal status=0, tumor status=1; both share patient ID and have different sample
IDs and BAM files. Paths are absolute or remote URIs. PBI is optional and blank
when absent. PacBio PBI is not a coordinate BAI/CSI index. The pipeline aligns
reads with pbmm2 and then generates coordinate indexes; a missing input BAI is
not a defect for unaligned HiFi BAMs.
The reviewed upstream schema also permits .cram and .bai/.crai in its broadly
named bam/pbi fields. The usage docs describe unaligned PacBio BAM/PBI, and
this helper deliberately validates that narrower path. It does not promise
CRAM compatibility through the complete workflow. Upstream can handle multiple
samples, but this helper generates one tumor and one normal only; additional
samples require deliberate pairing review (upstream pairs by patient).
Artifact and parameter controls
| Option | Contract |
|---|---|
--pipeline-version | Remote Nextflow -r; default reviewed commit for nf-core/pacsomatic |
--repo-path | Existing local pipeline containing main.nf; checkout/version control remains external; omit --pipeline-version |
--checkout-dir | Explicit opt-in clone; a new clone checks out the requested revision; an existing clone must already match |
--params-file | Existing local YAML/JSON for pipeline parameters; explicit helper input/outdir/reference wins |
--nextflow-config | Existing local Nextflow config for task executor/resources; forwarded as -c |
--use-generated-params-file | Use the generated YAML when no custom params file was supplied |
--resume | Reuse compatible cached tasks; requires retained .nextflow state and work files |
--with-report, --with-dag | Optional Nextflow report/DAG paths; choose supported formats (e.g. HTML) |
--overwrite | Replace reviewed helper artifacts; never allows input/artifact aliasing |
Writes <outdir>/samplesheet.csv, pacsomatic.params.generated.yaml and
run_pacsomatic.<executor>.sh (none uses local). Default work path is
<outdir>/work. Generated YAML quotes string values. A custom params file is
referenced, not copied or merged into the generated minimal YAML; retain it and
its provenance too. Generated paths alone are not a complete run manifest.
Scheduler semantics
--executor controls only how the driver script is launched:
| Value | Submit command | Driver resource conventions |
|---|---|---|
local, none | bash SCRIPT | No allocation or resource enforcement |
slurm | sbatch SCRIPT | --cpus-per-task, total --mem MiB, HH:MM:SS; %j job ID in log names |
lsf | bsub < SCRIPT | -n, explicit -M ...MB, -W HH:MM; %J log names |
pbs | qsub SCRIPT | PBS Pro/OpenPBS select=1:ncpus=...:mem=...mb; not portable Torque syntax |
sge | qsub SCRIPT | -pe smp and per-slot h_vmem rounded upward in MiB |
The helper's --walltime always means hours:minutes[:seconds]; minute/second
fields must be below 60 and total time positive. LSF requires zero seconds.
Resources must be positive and finite. PBS/SGE default logs are fixed
launcher.out/launcher.err; choose unique names for simultaneous submissions.
Log paths and scheduler directive fields use a conservative character set; no
whitespace, shell expansions or embedded newlines are accepted.
These are portable starting templates, not verified cluster allocations.
Confirm site-specific LSF per-process/per-job -M interpretation and memory
reservation policy, PBS resource names, and SGE smp/h_vmem configuration.
A driver job must be allowed to submit tasks and remain alive until they finish.
Set task resources and executor in a reviewed site profile/config, independently
of the outer scheduler. If tasks run locally inside a driver allocation, enforce
Nextflow executor capacity and per-process resource limits yourself.
No HPC scheduler was contacted during skill testing. Tests mock submission argv,
stdin, exit handling and job ID parsing (LSF/Slurm/PBS/SGE). Success from sbatch,
bsub or qsub means acceptance, not successful scientific results.
Runtime checks
--use-current-path uses installed tools. Otherwise the helper resolves the named
Conda environment and prepends its bin for both checks and the generated script.
--create-conda-env requires an explicitly supplied environment YAML and is
unavailable in dry-run mode. --module-load accepts plain module ... commands
only; preflight cannot evaluate cluster module initialization automatically.
Preflight runs Nextflow -version, checks minimum 24.04.2, checks Java using
JAVA_CMD/JAVA_HOME/PATH, and checks the selected runtime executable. A profile
singularity requires singularity; apptainer requires apptainer. This does
not test daemon permissions, containers, plugins, remote credentials, task
execution or GPU compatibility. --check-host-bio-tools is an optional partial
PATH inventory, not a complete dependency resolver; there is no upstream
container profile named local.
Results and triage
Upstream groups results under alignment, germline_snv, somatic_snv,
somatic_sv, somatic_cnv, methylation, tumor_clonality, signature_analysis,
multiqc and pipeline_info. Presence depends on enabled/successful branches.
Do not interpret a missing branch as a negative biological finding.
The pinned config uses timestamped execution report/timeline/trace filenames
and a timestamped HTML DAG under pipeline_info; the generic website output
page still shows some older DOT/SVG names. Inspect actual outputs, including
params.json, samplesheet.valid.csv, software versions, run exit status and
QC reports. Start failures at <outdir>/.nextflow.log, driver logs, then the
failing work task's .command.sh, .command.err, .command.out and .exitcode.
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