1
---
2
name: pacsomatic
3
description: 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.
4
license: MIT
5
compatibility: 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.
6
metadata:
7
version: "1.4"
8
skill-author: Beifang Niu
9
contributors: Haidong, Wenchao
10
upstream-pipeline: https://github.com/nf-core/pacsomatic
11
upstream-revision: "24c84cb371b0339c1d65a4de9451671945e19772"
12
last-reviewed: "2026-10-01"
13
---
14
15
# pacsomatic
16
17
## When to use
18
19
Use [scripts/run_pacsomatic.py](scripts/run_pacsomatic.py) to prepare one matched
20
PacBio HiFi tumor/normal pair, generate a samplesheet and reproducible launch
21
artifacts, and launch locally or submit the **Nextflow driver** to a scheduler.
22
The pipeline realigns input BAMs; this helper targets unaligned HiFi BAMs and
23
optional PacBio `.pbi` indexes. Do not substitute short reads or treat a BAM
24
filename as evidence of platform, matched identity, or methylation information.
25
26
The reviewed upstream `dev` commit is
27
`24c84cb371b0339c1d65a4de9451671945e19772`. GitHub had no releases or tags on
28
2026-10-01, despite the internal manifest saying `1.0.0`. The helper pins that
29
commit by default for `nf-core/pacsomatic`; it does not invent a release tag.
30
This is a source-reviewed development workflow, not a clinically validated assay.
31
See [references/pacsomatic_guide.md](references/pacsomatic_guide.md) for sources
32
and scientific checks.
33
34
## Workflow
35
36
1. Obtain distinct tumor and normal BAM paths, patient ID, distinct sample IDs,
37
output directory, and exactly one reference mode: `--fasta` or `--genome`.
38
IDs and BAM/PBI/FASTA paths must have no whitespace. Local inputs must be
39
nonempty regular files. Remote BAM/PBI/FASTA URIs are passed through without
40
downloading or authenticating; use managed filesystem/cloud credentials,
41
never embed secrets or signed URLs in generated files.
42
2. Confirm PacBio HiFi read groups and sample identity from acquisition metadata;
43
confirm that MM/ML modification tags needed for methylation have been retained.
44
Verify reference sequence/contig compatibility for every annotation resource.
45
3. Generate artifacts with `--dry-run`. This performs helper checks and writes
46
files, but does **not** invoke the pipeline, validate BAM contents, check remote
47
availability, resolve every pipeline parameter, or verify biological suitability.
48
Missing runtime tools are warnings here. `--dry-run` cannot be combined with
49
`--run`/`--submit`, cloning, or environment creation.
50
4. Review samplesheet, generated params YAML, script, pipeline revision, profiles,
51
and branch-specific resources/skips. Existing artifacts require explicit
52
`--overwrite`; input files can never be artifact targets. `config.yaml` is an
53
operator reference, not an automatically loaded configuration file.
54
5. For execution, select the actual runtime with `--use-current-path` or an
55
existing `--conda-env`. Load cluster modules **before** invoking the helper;
56
`--module-load` only repeats those commands in the generated script. No Conda
57
YAML is bundled; creating an environment needs `--conda-env-file` explicitly.
58
6. Use `--run` only for requested execution. For HPC, distinguish the outer
59
launcher scheduler (`--executor`) from Nextflow's per-task `process.executor`,
60
configured by a site profile or `--nextflow-config`. Driver CPU/memory requests
61
do not constrain task resources. Read [references/config-and-output.md](references/config-and-output.md).
62
7. Report artifact paths, revision, checks/warnings, run type, submission ID if
63
present, and a concrete next QC or failure-triage step. Scheduler acceptance
64
is not pipeline completion. Keep the output directory and work/cache state
65
stable for `--resume`; scripts run with the output directory as their cwd.
66
67
## Examples
68
69
Run these from the repository root. Paths and site settings are **illustrative**;
70
local tests use synthetic placeholders only, not human genomic data.
71
72
```bash
73
python skills/pacsomatic/scripts/run_pacsomatic.py \
74
--tumor-bam /data/P001_T.bam --normal-bam /data/P001_N.bam \
75
--patient-id P001 --tumor-sample-id P001_T --normal-sample-id P001_N \
76
--outdir /results/P001 --fasta /refs/GRCh38.fa \
77
--profile apptainer --use-current-path --dry-run
78
```
79
80
After reviewing artifacts, a Slurm launch can use the same inputs plus the
81
following options (replace `--dry-run` with `--run`):
82
83
```text
84
--executor slurm --queue compute --project my_account
85
--cpus 2 --memory-gb 8 --walltime 48:00
86
--nextflow-config /configs/slurm.config --overwrite --run
87
```
88
89
Those resources are for the driver, assuming the reviewed infrastructure config
90
sets `process.executor = 'slurm'` and suitable task queue/resources. The helper
91
normalizes `48:00` to Slurm `48:00:00` (48 hours). Do not add a `sanger` profile
92
unless actually using that institution's LSF infrastructure.
93
94
Custom pipeline parameters go in `--params-file`; infrastructure goes in
95
`--nextflow-config` (`-c`). The helper's explicit input/outdir/reference options
96
win over params-file values. `--extra-args` is tokenized and shell-quoted, but
97
cannot override these managed inputs/configuration options. Keep paths inside
98
external params/config files absolute because the launcher cwd is the outdir.
99
100
## Verification and references
101
102
```bash
103
uv run skills-ref validate skills/pacsomatic
104
python tests/run_all.py --isolated pacsomatic
105
```
106
107
The standard-library suite checks local artifact behavior, path protections,
108
CLI modes, runtime failures and mocked scheduler submissions. Native Nextflow
109
checks use a tiny local workflow; they do not establish that pacsomatic's full
110
containerized scientific pipeline succeeds on a given dataset or cluster.
111
112
- [Operator playbook](references/agent-playbook.md)
113
- [Configuration, scheduler and output contracts](references/config-and-output.md)
114
- [Upstream sources and scientific checks](references/pacsomatic_guide.md)
115