Skip to content
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
11 changes: 9 additions & 2 deletions modules/nf-core/poolsnp/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@ nextflow_process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
]
input[1] = [
[ ],
[ ]
]
input[2] = [
[ id: 'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)
]
input[3] = [
[ id: 'fasta'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/samtools/mpileup/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ channels:
- bioconda
dependencies:
# renovate: datasource=conda depName=bioconda/htslib
- bioconda::htslib=1.22.1
- bioconda::htslib=1.23
# renovate: datasource=conda depName=bioconda/samtools
- bioconda::samtools=1.22.1
- bioconda::samtools=1.23
12 changes: 7 additions & 5 deletions modules/nf-core/samtools/mpileup/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ process SAMTOOLS_MPILEUP {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/samtools:1.22.1--h96c455f_0' :
'biocontainers/samtools:1.22.1--h96c455f_0' }"
'https://depot.galaxyproject.org/singularity/samtools:1.23--h96c455f_0' :
'biocontainers/samtools:1.23--h96c455f_0' }"

input:
tuple val(meta), path(input), path(intervals)
tuple val(meta2), path(fasta)
tuple val(meta), path(input) // sam/bam/cram
tuple val(meta), path(index) // csi/bai/crai - optional, only required when using '-r'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you want:
tuple val(meta), path(input), path(index), path(intervals)
as the input tuple.

tuple val(meta), path(intervals) // optional
tuple val(meta2), path(fasta) // optional

output:
tuple val(meta), path("*.mpileup.gz"), emit: mpileup
tuple val("${task.process}"), val('samtools'), eval('samtools --version | head -1 | sed -e "s/samtools //"'), emit: versions_samtools, topic: versions
tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), emit: versions_samtools, topic: versions

when:
task.ext.when == null || task.ext.when
Expand Down
48 changes: 32 additions & 16 deletions modules/nf-core/samtools/mpileup/meta.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: samtools_mpileup
description: Generate text pileup output for one or multiple BAM files. Each input file produces a separate group of pileup columns in the output.
description: Generate text pileup output for one or multiple BAM files. Each
input file produces a separate group of pileup columns in the output.
keywords:
- mpileup
- bam
Expand Down Expand Up @@ -27,19 +28,35 @@ input:
description: BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"
ontologies: []
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- index:
type: file
description: CSI/BAI/CRAI file. Optional. Only required when using the
'-r' parameter.
pattern: "*.{bam,cram,sam}"
ontologies: []
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- intervals:
type: file
description: Interval FILE
description: Interval FILE. Optional.
pattern: "*.bed"
ontologies: []
- - meta2:
type: map
description: |
Groovy Map containing sample information
Groovy Map containing reference information
e.g. [ id:'test' ]
- fasta:
type: file
description: FASTA reference file
description: FASTA reference file. Optional.
pattern: "*.{fasta,fa}"
ontologies: []
output:
Expand All @@ -57,28 +74,27 @@ output:
versions_samtools:
- - ${task.process}:
type: string
description: Name of the process
description: The process the versions were collected from
- samtools:
type: string
description: Name of the tool
- samtools --version | head -1 | sed -e "s/samtools //":
type: eval
description: The expression to obtain the version of the tool

description: The tool name
- "samtools version | sed '1!d;s/.* //'":
type: string
description: The command used to generate the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: Name of the process
description: The process the versions were collected from
- samtools:
type: string
description: Name of the tool
- samtools --version | head -1 | sed -e "s/samtools //":
type: eval
description: The expression to obtain the version of the tool

description: The tool name
- "samtools version | sed '1!d;s/.* //'":
type: string
description: The command used to generate the version of the tool
authors:
- "@drpatelh"
- "@joseespinosa"
maintainers:
- "@joseespinosa"
- "@krannich479"
55 changes: 45 additions & 10 deletions modules/nf-core/samtools/mpileup/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ nextflow_process {
tag "samtools"
tag "samtools/mpileup"

test("bam_bed") {
test("bam - no fasta") {

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
[]
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
]
input[1] = [[],[]]
input[2] = [[],[]]
input[3] = [[],[]]
"""
}
}
Expand All @@ -32,17 +33,18 @@ nextflow_process {
}
}

test("bam_bed_fasta") {
test("bam - fasta") {

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
[]
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
]
input[1] = [
input[1] = [[],[]]
input[2] = [[],[]]
input[3] = [
[ id: 'fasta'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
Expand All @@ -58,17 +60,50 @@ nextflow_process {
}
}

test("bam_bed --stub") {
test("bam - region - bai") {
config "./nextflow.config"

when {
params {
module_args = "-r MT192765.1"
module_prefix = "test"
}
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
]
input[1] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true)
]
input[2] = [[],[]]
input[3] = [[],[]]
"""
}
}

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

test("bam - stub") {
options '-stub'
when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
[]
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
]
input[1] = [[],[]]
input[2] = [[],[]]
input[3] = [[],[]]
"""
}
}
Expand Down
Loading
Loading