-
Notifications
You must be signed in to change notification settings - Fork 6
modules for new gbcms #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7321fa1
modules for new gbcms
buehlere 9109160
PR response
buehlere 1cb83b3
add snapshots
buehlere c7be359
make cache deterministic
buehlere a7b5699
update snapshot
buehlere bd17f9e
update image
buehlere 915b999
update snapshots
buehlere 4792477
update snapshot
buehlere 63acd41
add note about filter duplicates
buehlere File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| gbcmsrs/buildgtfcache: | ||
| - "modules/msk/gbcmsrs/buildgtfcache/**" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | ||
|
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" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.