Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
5 changes: 5 additions & 0 deletions .github/skip_nf_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"modules/msk/facets",
"modules/msk/fgbio/collectduplexseqmetrics",
"modules/msk/gbcms",
"modules/msk/gbcmsrs/dna",
"modules/msk/gbcmsrs/rna",
"modules/msk/gbcmsrs/normalize",
"modules/msk/gbcmsrs/merge",
"modules/msk/gbcmsrs/buildgtfcache",
"modules/msk/neoantigenediting/computefitness",
"modules/msk/neoantigenediting/aligntoiedb",
"modules/msk/neoantigenutils/neoantigeninput",
Expand Down
7 changes: 7 additions & 0 deletions modules/msk/gbcmsrs/buildgtfcache/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "YOUR-TOOL=HERE"
Comment thread
rhshah marked this conversation as resolved.
48 changes: 48 additions & 0 deletions modules/msk/gbcmsrs/buildgtfcache/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
process GBCMSRS_BUILDGTFCACHE {
tag "${variants.name}"
label 'process_single'
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'ghcr.io/mskcc-omics-workflows/gbcms:6.3.1':
'ghcr.io/mskcc-omics-workflows/gbcms:6.3.1' }"

input:
path variants
path gtf

output:
path "gbcms_gtf_cache", emit: cache_dir
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "GBCMSRS_BUILDGTFCACHE module does not support Conda. Please use Docker / Singularity instead."
}
def args = task.ext.args ?: ''
"""
mkdir -p gbcms_gtf_cache
gbcms build-gtf-cache \\
--gtf ${gtf} \\
--variants ${variants} \\
--gtf-cache-dir gbcms_gtf_cache \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gbcms: \$(gbcms --version | sed 's/^gbcms //')
END_VERSIONS
"""

stub:
"""
mkdir -p gbcms_gtf_cache
touch gbcms_gtf_cache/gbcms-gtf-stub.idx

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gbcms: \$(echo "${task.container}" | sed 's/.*://')
END_VERSIONS
"""
}
54 changes: 54 additions & 0 deletions modules/msk/gbcmsrs/buildgtfcache/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
name: "gbcmsrs_buildgtfcache"
description:
Pre-build the gbcms GTF index cache once for a cohort so that per-sample
`gbcms rna` runs skip re-parsing the GTF
keywords:
- cache
- gtf
- rna
- index
tools:
- "gbcms":
description:
"A high-performance, orientation-aware genotype counting system for
genomic variants (Rust rewrite of GetBaseCountsMultiSample)"
homepage: "https://github.com/msk-access/gbcms"
documentation: "https://msk-access.github.io/gbcms/"
tool_dev_url: "https://github.com/msk-access/gbcms"
licence: ["AGPL-3.0"]
identifier: ""

input:
- variants:
type: file
description:
Variant file (VCF/MAF) for the cohort. Only its chromosome set is
used, and it must be the same variant file the per-sample `gbcms rna` runs use
so the cache key lines up.
pattern: "*.{vcf,maf}"
ontologies: []
- gtf:
type: file
description: GTF annotation file (Ensembl/GENCODE)
pattern: "*.gtf"
ontologies: []
output:
cache_dir:
- gbcms_gtf_cache:
type: directory
description:
Directory containing the serialized GTF index cache. Point every
per-sample `gbcms rna --gtf-cache-dir` at this same directory.
pattern: "gbcms_gtf_cache"
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
authors:
- "@shahr"
maintainers:
- "@shahr"
35 changes: 35 additions & 0 deletions modules/msk/gbcmsrs/buildgtfcache/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// nf-core modules test gbcmsrs/buildgtfcache
nextflow_process {

name "Test Process GBCMSRS_BUILDGTFCACHE"
script "../main.nf"
process "GBCMSRS_BUILDGTFCACHE"

tag "modules"
tag "modules_msk"
tag "gbcmsrs"
tag "gbcmsrs/buildgtfcache"

test("sarscov2 illumina - vcf gtf") {

when {
process {
"""
input[0] = file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true)
input[1] = file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true)
"""
}
}

then {
def idx_files = file(process.out.cache_dir[0]).listFiles().findAll { it.name.endsWith('.idx') }
assertAll(
{ assert process.success },
{ assert idx_files.size() == 1 },
{ assert snapshot(process.out.versions).match() }
)
}

}

}
14 changes: 14 additions & 0 deletions modules/msk/gbcmsrs/buildgtfcache/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"sarscov2 illumina - vcf gtf": {
"content": [
[
"versions.yml:md5,9d75c19a947df6e008a3918a2e97ebc6"
]
],
"timestamp": "2026-08-27T10:14:42.910180254",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
}
}
2 changes: 2 additions & 0 deletions modules/msk/gbcmsrs/buildgtfcache/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gbcmsrs/buildgtfcache:
- "modules/msk/gbcmsrs/buildgtfcache/**"
7 changes: 7 additions & 0 deletions modules/msk/gbcmsrs/dna/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "YOUR-TOOL=HERE"
61 changes: 61 additions & 0 deletions modules/msk/gbcmsrs/dna/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
process GBCMSRS_DNA {
tag "$meta.id"
label 'process_medium'
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'ghcr.io/mskcc-omics-workflows/gbcms:6.3.1':
'ghcr.io/mskcc-omics-workflows/gbcms:6.3.1' }"

input:
tuple val(meta), path(variants), val(sample_names), path(bams), path(bais)
path fasta
path fasta_fai

output:
tuple val(meta), path("gbcms_out/*.{vcf,maf}"), emit: variant_file
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "GBCMSRS_DNA module does not support Conda. Please use Docker / Singularity instead."
}
// gbcms's read filters (--filter-duplicates/-secondary/-supplementary/-qc-failed)
// default to ON. A pipeline mapping its own boolean params into ext.args must emit
// the explicit --no-filter-x form when off; omitting the flag silently keeps it on.
// On Nextflow >=26.04 (strict parser), CLI param overrides arrive as Strings, so
// `params.x ? 'a' : 'b'` sees "false" as truthy — compare with `.toString() == 'true'`.
def args = task.ext.args ?: ''
// Bare `--bam path` labels the sample using the staged file's stem, which is not
// meaningful for real BAM naming conventions. Pairing each bam with an explicit
// name keeps the output filename and Tumor_Sample_Barcode/VCF sample column
// predictable and equal to what the caller intends.
def bam_args = [sample_names, bams].transpose().collect { name, bam -> "--bam ${name}:${bam}" }.join(' ')
"""
gbcms dna \\
--variants ${variants} \\
${bam_args} \\
--fasta ${fasta} \\
--output-dir gbcms_out \\
--threads ${task.cpus} \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gbcms: \$(gbcms --version | sed 's/^gbcms //')
END_VERSIONS
"""

stub:
def sample_name = sample_names[0]
"""
mkdir -p gbcms_out
touch gbcms_out/${sample_name}.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gbcms: \$(echo "${task.container}" | sed 's/.*://')
END_VERSIONS
"""
}
84 changes: 84 additions & 0 deletions modules/msk/gbcmsrs/dna/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
name: "gbcmsrs_dna"
description:
Count alleles in cfDNA/somatic DNA BAMs at known variant sites using
gbcms
keywords:
- basecount
- genotyping
- dna
- variants
tools:
- "gbcms":
description:
"A high-performance, orientation-aware genotype counting system for
genomic variants (Rust rewrite of GetBaseCountsMultiSample)"
homepage: "https://github.com/msk-access/gbcms"
documentation: "https://msk-access.github.io/gbcms/"
tool_dev_url: "https://github.com/msk-access/gbcms"
licence: ["AGPL-3.0"]
identifier: ""

input:
Comment thread
rhshah marked this conversation as resolved.
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test' ]`
- variants:
type: file
description: Input variant file in VCF or MAF format
pattern: "*.{vcf,maf}"
ontologies: []
- sample_names:
type: string
description:
List of sample names, parallel to `bams`, used to label each BAM
via `--bam <name>:<path>`. Without an explicit name, gbcms falls
back to the staged file's stem, which is usually not the desired
sample id.
- bams:
type: file
description: One or more indexed BAM/CRAM files to count alleles in
pattern: "*.{bam,cram}"
ontologies: []
- bais:
type: file
description: Index file(s) for the input BAM/CRAM file(s)
pattern: "*.{bai,crai}"
ontologies: []
- fasta:
type: file
description: Reference genome FASTA file
pattern: "*.{fasta,fa}"
ontologies: []
- fasta_fai:
type: file
description: Index of the reference genome FASTA file
pattern: "*.fai"
ontologies: []
output:
variant_file:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test' ]`
- "gbcms_out/*.{vcf,maf}":
type: file
description:
Variant file annotated with allele counts, strand information,
and statistical annotations
pattern: "gbcms_out/*.{vcf,maf}"
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
authors:
- "@shahr"
maintainers:
- "@buehlere"
- "@shahr"
40 changes: 40 additions & 0 deletions modules/msk/gbcmsrs/dna/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// nf-core modules test gbcmsrs/dna
nextflow_process {

name "Test Process GBCMSRS_DNA"
script "../main.nf"
process "GBCMSRS_DNA"

tag "modules"
tag "modules_msk"
tag "gbcmsrs"
tag "gbcmsrs/dna"

test("sarscov2 illumina - vcf") {

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true),
[ 'test' ],
[ file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true) ],
[ file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam_bai'], checkIfExists: true) ]
]
input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
input[2] = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
Loading
Loading