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

Added new module: msisensorpro/msitumoronly #6350

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions modules/nf-core/msisensorpro/msitumoronly/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: msisensorpro_msitumoronly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: msisensorpro_msitumoronly

channels:
- conda-forge
- bioconda
- defaults
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- defaults

dependencies:
- bioconda::msisensor-pro=1.2.0
61 changes: 61 additions & 0 deletions modules/nf-core/msisensorpro/msitumoronly/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
process MSISENSORPRO_MSITUMORONLY {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/msisensor-pro:1.2.0--hfc31af2_0' :
'biocontainers/msisensor-pro:1.2.0--hfc31af2_0' }"

input:
tuple val(meta) , path(tumor), path(tumor_index), path(intervals)
tuple val(meta2), path (fasta)
tuple val(meta3), path (msisensor_baseline)

output:
tuple val(meta), path("${prefix}") , emit: output_report
tuple val(meta), path("${prefix}_dis") , emit: output_dis
tuple val(meta), path("${prefix}_all") , emit: output_all
tuple val(meta), path("${prefix}_unstable"), emit: output_unstable
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because I am curious: I always see it the other way around (so that you need two times def and otherwise you run into errors). Has this changed? Is there any part of the docs you can point me to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too, I simply copy pasted it from other modules indeed.

def fasta = fasta ? "-g ${fasta}" : ""
def intervals = intervals ? "-e ${intervals} " : ""
"""
msisensor-pro \\
pro \\
-d ${msisensor_baseline} \\
-t ${tumor} \\
${fasta} \\
-o $prefix \\
-b ${task.cpus} \\
${intervals} \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
msisensor-pro: \$(msisensor-pro 2>&1 | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p')
END_VERSIONS
"""
famosab marked this conversation as resolved.
Show resolved Hide resolved

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

"""
mkdir ${prefix}
mkdir ${prefix}_dis
mkdir ${prefix}_all
mkdir ${prefix}_unstable

cat <<-END_VERSIONS > versions.yml
"${task.process}":
msisensor-pro: \$(msisensor-pro 2>&1 | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p')
END_VERSIONS
"""
}
68 changes: 68 additions & 0 deletions modules/nf-core/msisensorpro/msitumoronly/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: msisensorpro_msitumoronly
description: MSIsensor-pro evaluates Microsatellite Instability (MSI) for cancer patients with next generation sequencing data. It accepts the whole genome sequencing, whole exome sequencing and target region (panel) sequencing data as input
keywords:
- micro-satellite-scan
- msisensor-pro
- msi
- somatic
- tumor-only
tools:
- msisensorpro:
description: Microsatellite Instability (MSI) detection using high-throughput sequencing data.
homepage: https://github.com/xjtu-omics/msisensor-pro
documentation: https://github.com/xjtu-omics/msisensor-pro/wiki
tool_dev_url: https://github.com/xjtu-omics/msisensor-pro
doi: "10.1016/j.gpb.2020.02.001"
licence: ["Custom Licence"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- tumor:
type: file
description: BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"
- tumor_index:
type: file
description: BAM/CRAM/SAM index file
pattern: "*.{bai,crai,sai}"
- intervals:
type: file
description: bed file containing interval information, optional
pattern: "*.{bed}"
- fasta:
type: file
description: Reference genome
pattern: "*.{fasta}"
- msisensor_baseline:
type: file
description: File containing custom list of msi regions from a panel of normals to be used as a baseline
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- output_report:
type: file
description: File containing final report with all detected microsatellites, unstable somatic microsatellites, msi score
- output_dis:
type: file
description: File containing distribution results
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look like folders not files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are files indeed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then the stub needs to touch the files not mkdir them.

- output_all:
type: file
description: File containing all sites
- output_unstable:
type: file
description: File containing unstable sites
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@FriederikeHanssen"
- "@bounlu"
maintainers:
- "@FriederikeHanssen"
76 changes: 76 additions & 0 deletions modules/nf-core/msisensorpro/msitumoronly/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "msisensorpro"
tag "msisensorpro/msitumoronly"

test("human - cram") {

when {
process {
"""
input[0] = [// meta map
[ id:'test'],
file('https://github.com/xjtu-omics/msisensor-pro/raw/c85d51030777585ad6ab669d2f4c8e46d23f4cd8/demo/data/data4test/test_tumor_sorted.cram'),
//file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true),
file('https://github.com/xjtu-omics/msisensor-pro/raw/c85d51030777585ad6ab669d2f4c8e46d23f4cd8/demo/data/data4test/test_tumor_sorted.cram.crai'),
//file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true),
[]
]
input[1] = [ [ id:'reference' ], // meta map
file('https://raw.githubusercontent.com/xjtu-omics/msisensor-pro/c85d51030777585ad6ab669d2f4c8e46d23f4cd8/demo/data/reference/reference.fa', checkIfExists: true)
]
input[2] = [ [ id:'baseline' ], // meta map
file('https://raw.githubusercontent.com/xjtu-omics/msisensor-pro/c85d51030777585ad6ab669d2f4c8e46d23f4cd8/data/GRCh38.baseline_TCGA.tsv', checkIfExists: true)
]
"""
}
}

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

}

test("human - cram - stub") {

options "-stub"

when {
process {
"""
input[0] = [// meta map
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true),
[]
]
input[1] = [ [ id:'reference' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
]
input[2] = [ [ id:'baseline' ], // meta map
file('https://raw.githubusercontent.com/xjtu-omics/msisensor-pro/c85d51030777585ad6ab669d2f4c8e46d23f4cd8/data/GRCh38.baseline_TCGA.tsv', checkIfExists: true)
]
"""
}
}

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

}

}
84 changes: 84 additions & 0 deletions modules/nf-core/msisensorpro/msitumoronly/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"human - cram - stub": {
"content": [
{
"0": [

],
"1": [

],
"2": [

],
"3": [

],
"4": [

],
"output_all": [

],
"output_dis": [

],
"output_report": [

],
"output_unstable": [

],
"versions": [

]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-02T11:32:08.214756"
},
"human - cram": {
"content": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks completely empty? Probably because of the prefix issue

{
"0": [

],
"1": [

],
"2": [

],
"3": [

],
"4": [

],
"output_all": [

],
"output_dis": [

],
"output_report": [

],
"output_unstable": [

],
"versions": [

]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-02T11:31:59.733765"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/msisensorpro/msitumoronly/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
msisensorpro/msitumoronly:
- "modules/nf-core/msisensorpro/msitumoronly/**"
Loading