Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions library-skills/genomics-workflow-acceleration/.skillsource.json

This file was deleted.

27 changes: 25 additions & 2 deletions library-skills/genomics-workflow-acceleration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: >-
— use parabricks.
license: CC-BY-4.0 AND Apache-2.0
metadata:
author: "Angel Pizarro <apizarro@nvidia.com>"
tags:
- genomics
- parabricks
Expand Down Expand Up @@ -74,9 +75,18 @@ For deep runtime diagnostics, installation, and per-tool command flags, use the
If the user asks to make a pipeline faster, improve price/performance, reduce
runtime/cost, convert to GPUs, or use Parabricks, proceed only when there is an
inspectable workflow path, repo, or relevant open files. If no path or entrypoint
is available, ask for the workflow location and framework; do not invent a
is available, **stop and ask** for the workflow location and framework; do not invent a
pipeline or step map.

**No path provided — required response shape:**

1. State briefly that Parabricks acceleration requires **reviewing the existing
workflow steps** (rules/processes/tasks) before mapping anything to GPU tools.
2. Ask for the pipeline location (directory, repo, `Snakefile`, WDL, Nextflow
entrypoint, or Python script) and which framework is in use.
3. Do **not** assume a Snakemake/Nextflow/WDL layout, write workflow files, or
produce a detailed CPU→Parabricks mapping until real files are available.

Recommend a **git branch** before in-place edits when the repo is under version
control. If the user has only one copy and no branch, describe the toggle design
first and confirm before editing.
Expand Down Expand Up @@ -266,7 +276,20 @@ the user asks.

User: "Make my genomics pipeline faster and convert it to GPUs."

Response: ask for workflow path and framework. Do not fabricate a pipeline map.
Response (template):

> Parabricks acceleration starts by **reviewing your existing workflow steps**
> (rules, processes, or tasks) so we only map real CPU work to GPU tools.
>
> Please share your pipeline location and framework:
> - path to the repo or workflow directory
> - entrypoint (`Snakefile`, `main.nf`, WDL, or Python script)
> - framework if ambiguous (Nextflow, Snakemake, WDL, Python)
>
> I won't invent a pipeline map or edit files until I can inspect the actual workflow.

Do not fabricate a pipeline map, write `Snakefile`/`main.nf` examples, or claim
to see rules/processes that were not read from the user's files.

### Nextflow inspect (report only)

Expand Down
1,075 changes: 1,075 additions & 0 deletions library-skills/genomics-workflow-acceleration/evals/evals.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env nextflow

/*
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* Minimal fixture for eval cases — CPU-style GATK/BWA names, not production-ready.
*/

params.samplesheet = params.samplesheet ?: 'samplesheet.csv'
params.outdir = params.outdir ?: 'results'
params.reference = params.reference ?: 'genome.fa'

include { BWA_MEM } from './modules/local/bwa_mem'
include { GATK_MARKDUPLICATES } from './modules/local/gatk_markduplicates'
include { GATK_HAPLOTYPECALLER } from './modules/local/gatk_haplotypecaller'

workflow {
ch_samples = channel.fromPath(params.samplesheet)
.splitCsv(header: true)
.map { row -> tuple(row.sample_id, file(row.fastq_1), file(row.fastq_2)) }

BWA_MEM(ch_samples, file(params.reference))
GATK_MARKDUPLICATES(BWA_MEM.out.bam)
GATK_HAPLOTYPECALLER(GATK_MARKDUPLICATES.out.bam, file(params.reference))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

process BWA_MEM {
tag "$meta.id"
label 'process_medium'

input:
tuple val(meta), path(reads)
path reference

output:
tuple val(meta), path("*.bam"), emit: bam

script:
"""
echo "bwa mem stub" > ${meta.id}.bam
"""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

process GATK_HAPLOTYPECALLER {
tag "$meta.id"
label 'process_high'

input:
tuple val(meta), path(bam)
path reference

output:
tuple val(meta), path("*.vcf.gz"), emit: vcf

script:
"""
echo "## stub" | gzip > ${meta.id}.vcf.gz
"""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

process GATK_MARKDUPLICATES {
tag "$meta.id"
label 'process_medium'

input:
tuple val(meta), path(bam)

output:
tuple val(meta), path("*.bam"), emit: bam

script:
"""
cp $bam ${meta.id}.marked.bam
"""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""Minimal Python pipeline fixture for eval cases."""

from pathlib import Path
import subprocess
import sys


def align_bwa(sample: str, ref: Path, out_bam: Path) -> None:
subprocess.run(
["bash", "-c", f'echo "bwa mem stub" > {out_bam}'],
check=True,
)


def call_variants_gatk(bam: Path, ref: Path, out_vcf: Path) -> None:
subprocess.run(
["bash", "-c", f'echo "## stub" | gzip > {out_vcf}'],
check=True,
)


def main(sample: str, ref: Path, outdir: Path) -> None:
outdir.mkdir(parents=True, exist_ok=True)
bam = outdir / f"{sample}.bam"
vcf = outdir / f"{sample}.vcf.gz"
align_bwa(sample, ref, bam)
call_variants_gatk(bam, ref, vcf)


if __name__ == "__main__":
main(sys.argv[1], Path(sys.argv[2]), Path(sys.argv[3]))
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Minimal Snakemake fixture for eval cases
configfile: "config.yaml"

SAMPLES = ["sample1"]

rule all:
input:
expand("results/{sample}.vcf.gz", sample=SAMPLES),

rule bwa_mem:
input:
r1="data/{sample}_R1.fastq.gz",
r2="data/{sample}_R2.fastq.gz",
ref="refs/genome.fa",
output:
bam="results/{sample}.bam",
threads: 8
shell:
"""
echo "bwa mem stub" > {output.bam}
"""

rule gatk_haplotypecaller:
input:
bam="results/{sample}.bam",
ref="refs/genome.fa",
output:
vcf="results/{sample}.vcf.gz",
shell:
"""
echo "## stub" | gzip > {output.vcf}
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
samples:
- sample1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

version 1.0

workflow GermlineStub {
input {
File ref_fasta
File fastq_r1
File fastq_r2
String sample_id
}
call BwaMem { input: ... }
call GatkHaplotypeCaller { input: bam = BwaMem.bam, ref = ref_fasta, sample_id = sample_id }
output { File vcf = GatkHaplotypeCaller.vcf }
}

task BwaMem {
input {
File r1
File r2
File ref
String sample_id
}
command <<<
echo "bwa mem stub" > ~{sample_id}.bam
>>>
output { File bam = "~{sample_id}.bam" }
runtime { docker: "ubuntu:22.04" cpu: 4 memory: "8G" }
}

task GatkHaplotypeCaller {
input {
File bam
File ref
String sample_id
}
command <<<
echo "## stub" | gzip > ~{sample_id}.vcf.gz
>>>
output { File vcf = "~{sample_id}.vcf.gz" }
runtime { docker: "ubuntu:22.04" cpu: 8 memory: "16G" }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"query": "Inspect the Nextflow workflow at ./my-pipeline for Parabricks acceleration opportunities.",
"should_trigger": true
},
{
"query": "Make this genomics pipeline faster and convert CPU steps to Parabricks GPUs in ./workflows/germline.nf",
"should_trigger": true
},
{
"query": "Add optional nf-core Parabricks modules in place with params.use_parabricks default false.",
"should_trigger": true
},
{
"query": "Which pbrun tool should I use for bisulfite WGBS alignment?",
"should_trigger": false
},
{
"query": "Make my genomics pipeline faster and use GPUs.",
"should_trigger": false
},
{
"query": "Here are VCF variants for my patient. What treatment should they get?",
"should_trigger": false
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Do not only suggest — **make the edits** unless the user asked report-only ("d
- Remove CPU steps from the default (toggle-off) path during consolidation.
- Merge variant calling into fq2bam.
- Remove QC the user still needs without equivalent Parabricks outputs.
- Edit only `evals/fixtures/` or other read-only eval paths when the user's tree is elsewhere.
- Edit only `skills/genomics-workflow-acceleration/evals/fixtures/` or other read-only eval paths when the user's tree is elsewhere.

## ACCELERATION.md snippets

Expand Down
43 changes: 0 additions & 43 deletions library-skills/parabricks/.skillsource.json

This file was deleted.

6 changes: 6 additions & 0 deletions library-skills/parabricks/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ description: >-
whole pipelines — use genomics-workflow-acceleration.
license: CC-BY-4.0 AND Apache-2.0
metadata:
author: "Angel Pizarro <apizarro@nvidia.com>"
version: "1.1.0"
tags:
- parabricks
Expand Down Expand Up @@ -100,6 +101,11 @@ Load only the reference file for the selected tool.
For routing heuristics when multiple tools could apply, see
[tool-index.md](references/tool-index.md).

**QC vs variant calling:** `bammetrics` and `collectmultiplemetrics` are metrics
tools only — they do not fix coverage gaps or call variants. Route variant recall
goals to callers such as `haplotypecaller`, `germline`, or `deepvariant`, not QC
tools.

## Runtime Readiness

For GPU, driver, Docker, container, storage, or installation questions, read
Expand Down
Loading