Skip to content

Commit

Permalink
Merge branch 'develop' into enhancement/produce_metafusion_ref
Browse files Browse the repository at this point in the history
  • Loading branch information
anoronh4 committed Apr 30, 2024
2 parents 895945a + a1bdc7e commit b093ecb
Show file tree
Hide file tree
Showing 14 changed files with 257 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ indent_style = space
indent_size = 2

# These files are edited and tested upstream in nf-core/modules
[/modules/nf-core/**]
[/modules/{nf-core,msk}/**]
charset = unset
end_of_line = unset
insert_final_newline = unset
Expand Down
4 changes: 2 additions & 2 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ process {
]
}

withName: GETBASECOUNTSMULTISAMPLE {
ext.args = "--omaf --maq 20 --baq 20 --filter_improper_pair 0"
withName: GBCMS {
ext.args = { "--omaf --maq 20 --baq 20 --filter_improper_pair 0 --thread ${task.cpus}" }
publishDir = [
enabled:false
]
Expand Down
11 changes: 11 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
"name": "mskcc/forte",
"homePage": "https://github.com/mskcc/forte",
"repos": {
"[email protected]:mskcc-omics-workflows/modules.git": {
"modules": {
"msk": {
"gbcms": {
"branch": "develop",
"git_sha": "e70681357ccd39e7a10d328ca696c074750d8163",
"installed_by": ["modules"]
}
}
}
},
"https://github.com/nf-core/modules.git": {
"modules": {
"nf-core": {
Expand Down
43 changes: 0 additions & 43 deletions modules/local/getbasecountsmultisample/container/Dockerfile

This file was deleted.

54 changes: 0 additions & 54 deletions modules/local/getbasecountsmultisample/main.nf

This file was deleted.

9 changes: 9 additions & 0 deletions modules/msk/gbcms/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "gbcms"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "YOUR-TOOL-HERE"
63 changes: 63 additions & 0 deletions modules/msk/gbcms/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
process GBCMS {
tag "$meta.id"
label 'process_single'
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'ghcr.io/msk-access/gbcms:1.2.5':
'ghcr.io/msk-access/gbcms:1.2.5' }"

input:
tuple val(meta), path(bam), path(bambai), path(variant_file), val(output)
path(fasta)
path(fastafai)

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

when:
task.ext.when == null || task.ext.when
script:
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "GetBaseCountsMultiSample module does not support Conda. Please use Docker / Singularity instead."
}
def args = task.ext.args ?: ''
def sample = meta.sample
// determine if input file is a maf of vcf

def input_ext = variant_file.getExtension()
def variant_input = ''

if(input_ext == 'maf') {
variant_input = '--maf ' + variant_file
}
if(input_ext == 'vcf'){
variant_input = '--vcf ' + variant_file
}
if(variant_input == ''){
throw new Exception("Variant file must be maf or vcf, not ${input_ext}")
}

"""
GetBaseCountsMultiSample --fasta ${fasta} \\
${variant_input} \\
--output ${output} \\
--bam $sample:${bam} $args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
GetBaseCountsMultiSample: \$(echo \$(GetBaseCountsMultiSample --help) | grep -oP '[0-9]\\.[0-9]\\.[0-9]')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch variant_file.maf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
GetBaseCountsMultiSample: 1.2.5
END_VERSIONS
"""
}
59 changes: 59 additions & 0 deletions modules/msk/gbcms/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
name: "gbcms"
description: This module wraps GetBaseCountsMultiSample, which calculates the base counts in multiple BAM files for all the sites in a given VCF file or MAF file
keywords:
- basecount
- bams
- vcf
tools:
- "gbcms":
description: "Calculate the base counts in multiple BAM files for all the sites in a given VCF file or MAF file"
homepage: "https://github.com/msk-access/GetBaseCountsMultiSample"
documentation: "https://github.com/msk-access/GetBaseCountsMultiSample/blob/master/README.md"

input:
# Only when we have meta
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- fasta:
type: file
description: Input reference sequence file
pattern: "*.fasta"

- fastafai:
type: file
description: Index of the reference Fasta
pattern: "*.fai"
- bam:
type: file
description: Input bam file, in the format of SAMPLE_NAME:BAM_FILE. This paramter need to be specified at least once
pattern: "*.bam"
- bambai:
type: file
description: Index of Bam
pattern: "*.bai"
- variant_file:
type: file
description: Input variant file in TCGA maf format. --maf or --vcf need to be specified at least once. But --maf and --vcf are mutually exclusive
pattern: "*.{maf,vcf}"
- output:
type: string
description: Output file

output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- variant_file:
type: file
description: base counts in multiple BAM files for all the sites in a given VCF file or MAF file
pattern: "*.{vcf,maf}"

authors:
- "@buehlere"
41 changes: 41 additions & 0 deletions modules/msk/gbcms/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// nf-core modules test gbcms
nextflow_process {

name "Test Process GBCMS"
script "../main.nf"
process "GBCMS"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "modules_msk"
tag "gbcms"

test("sarscov2 illumina paired-end [fastq]") {

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

}

}
45 changes: 45 additions & 0 deletions modules/msk/gbcms/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"sarscov2 illumina paired-end [fastq]": {
"content": [
{
"0": [
[
{
"id": "test",
"sample": "197"
},
"variant_file.vcf:md5,28c8df33c7ea5ed5d1cf9997d8e00ffa"
]
],
"1": [
[
{
"id": "test",
"sample": "197"
},
"versions.yml:md5,a94265ed3bc4b5631d85b9b9b5d2b7e5"
]
],
"variant_file": [
[
{
"id": "test",
"sample": "197"
},
"variant_file.vcf:md5,28c8df33c7ea5ed5d1cf9997d8e00ffa"
]
],
"versions": [
[
{
"id": "test",
"sample": "197"
},
"versions.yml:md5,a94265ed3bc4b5631d85b9b9b5d2b7e5"
]
]
}
],
"timestamp": "2023-12-13T15:05:34.981489"
}
}
12 changes: 12 additions & 0 deletions modules/msk/gbcms/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
params {
enable_conda = false
}

process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: "GBCMS" {
ext.args = ''
}

}
2 changes: 2 additions & 0 deletions modules/msk/gbcms/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gbcms:
- "modules/msk/gbcms/**"
Loading

0 comments on commit b093ecb

Please sign in to comment.