Skip to content
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

Add module muse/sump #5629

Merged
merged 21 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 11 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 modules/nf-core/muse/sump/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::muse=2.1.2
56 changes: 56 additions & 0 deletions modules/nf-core/muse/sump/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
process MUSE_SUMP {
tag "$meta.id"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'oras://community.wave.seqera.io/library/muse:2.1.2--f6ec9e78771509ff':
'community.wave.seqera.io/library/muse:2.1.2--e8279641c6ef8c63' }"

input:
tuple val(meta), path(muse_call_txt)
tuple val(meta2), path(ref_vcf), path(ref_vcf_tbi)

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

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

script:
def args = task.ext.args ?: '' // hands -G for WGS data and -E for WES data
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '2.1.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
cp $ref_vcf_tbi /tmp/
rm $ref_vcf_tbi
cp /tmp/$ref_vcf_tbi .
rm /tmp/$ref_vcf_tbi
famosab marked this conversation as resolved.
Show resolved Hide resolved

MuSE \\
sump \\
$args \\
-I $muse_call_txt \\
-O ${prefix}.vcf \\
famosab marked this conversation as resolved.
Show resolved Hide resolved
-n $task.cpus \\
-D $ref_vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
MuSE: ${VERSION}
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '2.1.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch ${prefix}.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
MuSE: ${VERSION}
END_VERSIONS
"""
}
66 changes: 66 additions & 0 deletions modules/nf-core/muse/sump/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "muse_sump"
description: computes tier-based cutoffs from a sample-specific error model
famosab marked this conversation as resolved.
Show resolved Hide resolved
keywords:
- genomics
- wgs
- wxs
- vcf
famosab marked this conversation as resolved.
Show resolved Hide resolved
tools:
- "MuSE":
description: "Somatic point mutation caller based on Markov substitution model
for molecular evolution"
homepage: "https://bioinformatics.mdanderson.org/public-software/muse/"
documentation: "https://github.com/wwylab/MuSE"
tool_dev_url: "https://github.com/wwylab/MuSE"
doi: "10.1101/gr.278456.123"
licence: ["https://github.com/danielfan/MuSE/blob/master/LICENSE"]
identifier: ""

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- muse_call_txt:
type: file
description: single input file generated by 'MuSE call'
pattern: "*.MuSE.txt"
- - meta2:
type: map
description: |
Groovy Map containing reference information.
e.g. `[ id:'test' ]`
- ref_vcf:
type: file
description: |
dbSNP vcf file that should be bgzip compressed, tabix indexed and
based on the same reference genome used in 'MuSE call'
pattern: ".vcf.gz"
- ref_vcf_tbi:
type: file
description: |
dbSNP vcf file that should be bgzip compressed, tabix indexed and
based on the same reference genome used in 'MuSE call'
famosab marked this conversation as resolved.
Show resolved Hide resolved
pattern: ".vcf.gz.tbi"
output:
- vcf:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.vcf":
type: file
description: Identified somatic variants with tiered rankings
pattern: "*.vcf"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@famosab"
maintainers:
- "@famosab"
70 changes: 70 additions & 0 deletions modules/nf-core/muse/sump/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "muse"
tag "muse/sump"

test("human - txt") {

config "./wes.config"

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/muse/MuSE-call.chr21.hg38.paired_end.recal.MuSE.txt', checkIfExists: true)
]
input[1] = [
[ id:'reference' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true)
]
"""
}
}

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

}

test("human - txt - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/muse/MuSE-call.chr21.hg38.paired_end.recal.MuSE.txt', checkIfExists: true)
]
input[1] = [
[ id:'reference' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true)
]
"""
}
}

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

}

}
68 changes: 68 additions & 0 deletions modules/nf-core/muse/sump/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"human - txt - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,c09df78eaed694c69858185c8e082048"
],
"vcf": [
[
{
"id": "test"
},
"test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,c09df78eaed694c69858185c8e082048"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-15T10:47:30.297712631"
},
"human - txt": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.vcf:md5,9379bf3ff498d19aea55f1e5f1f8bfe8"
]
],
"1": [
"versions.yml:md5,c09df78eaed694c69858185c8e082048"
],
"vcf": [
[
{
"id": "test"
},
"test.vcf:md5,9379bf3ff498d19aea55f1e5f1f8bfe8"
]
],
"versions": [
"versions.yml:md5,c09df78eaed694c69858185c8e082048"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-15T10:47:24.028424069"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/muse/sump/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
muse/sump:
- "modules/nf-core/muse/sump/**"
4 changes: 4 additions & 0 deletions modules/nf-core/muse/sump/tests/wes.config
SPPearce marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
process {
withName: 'MUSE_SUMP' {
ext.args = '-E' }
}
4 changes: 4 additions & 0 deletions modules/nf-core/muse/sump/tests/wgs.config
SPPearce marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
process {
withName: 'MUSE_SUMP' {
ext.args = '-G' }
}
Loading