Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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.
49 changes: 49 additions & 0 deletions modules/msk/gbcmsrs/buildgtfcache/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
process GBCMSRS_BUILDGTFCACHE {
tag "${variants.name}"
label 'process_single'
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'ghcr.io/msk-access/gbcms:6.3.0':
Comment thread
nikhil marked this conversation as resolved.
Outdated
'ghcr.io/msk-access/gbcms:6.3.0' }"
containerOptions { workflow.containerEngine in ['docker', 'podman'] ? "--entrypoint ''" : '' }

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: 6.3.0
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 - stub") {

options "-stub"

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 {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
29 changes: 29 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,29 @@
{
"sarscov2 illumina - vcf gtf - stub": {
"content": [
{
"0": [
[
"gbcms-gtf-stub.idx:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,caa12a2ea191d010798bbfbaae282c28"
],
"cache_dir": [
[
"gbcms-gtf-stub.idx:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,caa12a2ea191d010798bbfbaae282c28"
]
}
],
"timestamp": "2026-08-25T11:12:12.859755",
"meta": {
"nf-test": "0.9.5",
"nextflow": "24.10.3"
}
}
}
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"
52 changes: 52 additions & 0 deletions modules/msk/gbcmsrs/dna/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
process GBCMSRS_DNA {
tag "$meta.id"
label 'process_medium'
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'ghcr.io/msk-access/gbcms:6.3.0':
'ghcr.io/msk-access/gbcms:6.3.0' }"
containerOptions { workflow.containerEngine in ['docker', 'podman'] ? "--entrypoint ''" : '' }

input:
tuple val(meta), path(variants), path(bams), path(bais)
Comment thread
rhshah marked this conversation as resolved.
Outdated
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."
}
def args = task.ext.args ?: ''
def bam_args = bams.collect { "--bam ${it}" }.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:
"""
mkdir -p gbcms_out
touch gbcms_out/${variants.baseName}.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gbcms: 6.3.0
END_VERSIONS
"""
}
77 changes: 77 additions & 0 deletions modules/msk/gbcmsrs/dna/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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: []
- 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"
41 changes: 41 additions & 0 deletions modules/msk/gbcmsrs/dna/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// 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 - stub") {
Comment thread
rhshah marked this conversation as resolved.
Outdated

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true),
[ 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