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
22 changes: 2 additions & 20 deletions modules/nf-core/chromap/chromap/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ process CHROMAP_CHROMAP {

input:
tuple val(meta), path(reads)
tuple val(meta2), path(fasta)
tuple val(meta2), path(fasta), path(fai)
tuple val(meta3), path(index)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what is this index?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because the subworkflow provide it.
I could also do a .map{ } to remove it for this process call, but I find it cleaner to always have the fasta index with the fasta in the channels.
What do you think ?

path barcodes
path whitelist
Expand All @@ -21,7 +21,7 @@ process CHROMAP_CHROMAP {
tuple val(meta), path("*.bam") , optional:true, emit: bam
tuple val(meta), path("*.tagAlign.gz"), optional:true, emit: tagAlign
tuple val(meta), path("*.pairs.gz") , optional:true, emit: pairs
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('chromap'), eval("chromap --version 2>&1"), topic: versions, emit: versions_chromap

when:
task.ext.when == null || task.ext.when
Expand Down Expand Up @@ -65,12 +65,6 @@ process CHROMAP_CHROMAP {
-o ${prefix}.${file_extension}

$compression_cmds

cat <<-END_VERSIONS > versions.yml
"${task.process}":
chromap: \$(echo \$(chromap --version 2>&1))
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
} else {
"""
Expand All @@ -84,12 +78,6 @@ process CHROMAP_CHROMAP {
-o ${prefix}.${file_extension}

$compression_cmds

cat <<-END_VERSIONS > versions.yml
"${task.process}":
chromap: \$(echo \$(chromap --version 2>&1))
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
}

Expand All @@ -100,11 +88,5 @@ process CHROMAP_CHROMAP {
touch ${prefix}.bam
echo "" | gzip > ${prefix}.tagAlign.gz
echo "" | gzip > ${prefix}.pairs.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
chromap: \$(echo \$(chromap --version 2>&1))
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
}
34 changes: 27 additions & 7 deletions modules/nf-core/chromap/chromap/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ tools:
homepage: https://github.com/haowenz/chromap
documentation: https://github.com/haowenz/chromap
tool_dev_url: https://github.com/haowenz/chromap
licence: ["GPL v3"]
licence:
- "GPL v3"
identifier: ""
input:
- - meta:
Expand All @@ -44,6 +45,11 @@ input:
description: |
The fasta reference file.
ontologies: []
- fai:
type: file
description: |
The fasta reference file index.
ontologies: []
- - meta3:
type: map
description: |
Expand Down Expand Up @@ -122,13 +128,27 @@ output:
pattern: "*.pairs.gz"
ontologies:
- edam: http://edamontology.org/format_3989 # GZIP format
versions_chromap:
- - ${task.process}:
type: string
description: The name of the process
- chromap:
type: string
description: The name of the tool
- chromap --version 2>&1:
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- chromap:
type: string
description: The name of the tool
- chromap --version 2>&1:
type: eval
description: The expression to obtain the version of the tool
authors:
- "@mahesh-panchal"
- "@joseespinosa"
Expand Down
20 changes: 12 additions & 8 deletions modules/nf-core/chromap/chromap/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ nextflow_process {
]
input[1] = [
[:],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)
]
input[2] = CHROMAP_INDEX.out.index
input[3] = []
Expand All @@ -52,7 +53,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand All @@ -71,7 +72,8 @@ nextflow_process {
]
input[1] = [
[:],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)
]
input[2] = CHROMAP_INDEX.out.index
input[3] = []
Expand All @@ -85,7 +87,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand All @@ -108,7 +110,8 @@ nextflow_process {
]
input[1] = [
[:],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)
]
input[2] = CHROMAP_INDEX.out.index
input[3] = []
Expand All @@ -126,7 +129,7 @@ nextflow_process {
assert snapshot(
bam(process.out.bam[0][1]).getHeaderMD5(),
bam(process.out.bam[0][1]).getReadsMD5(),
process.out.versions
process.out.findAll { key, val -> key.startsWith('versions') }
)
}
)
Expand All @@ -147,7 +150,8 @@ nextflow_process {
]
input[1] = [
[:],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
[]
]
input[2] = CHROMAP_INDEX.out.index
input[3] = []
Expand All @@ -161,7 +165,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand Down
129 changes: 30 additions & 99 deletions modules/nf-core/chromap/chromap/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,6 @@
"sarscov2 - single_end": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.bed.gz:md5,b23aa9dae812fe84c308df6e18d850be"
]
],
"1": [

],
"2": [

],
"3": [

],
"4": [
"versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7"
],
"bam": [

],
Expand All @@ -41,41 +20,24 @@
"tagAlign": [

],
"versions": [
"versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7"
"versions_chromap": [
[
"CHROMAP_CHROMAP",
"chromap",
"0.2.6-r490"
]
]
}
],
"timestamp": "2026-03-23T20:43:54.016775225",
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-08-05T17:49:22.798324749"
"nf-test": "0.9.4",
"nextflow": "26.02.0"
}
},
"sarscov2 - paired_end ": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.bed.gz:md5,f658c1e94adef751ad08e132aac92712"
]
],
"1": [

],
"2": [

],
"3": [

],
"4": [
"versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7"
],
"bam": [

],
Expand All @@ -94,59 +56,24 @@
"tagAlign": [

],
"versions": [
"versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7"
"versions_chromap": [
[
"CHROMAP_CHROMAP",
"chromap",
"0.2.6-r490"
]
]
}
],
"timestamp": "2026-03-23T20:44:03.474089743",
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-08-05T17:49:29.530097947"
"nf-test": "0.9.4",
"nextflow": "26.02.0"
}
},
"sarscov2 - single_end - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"1": [
[
{
"id": "test",
"single_end": true
},
"test.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
[
{
"id": "test",
"single_end": true
},
"test.tagAlign.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"3": [
[
{
"id": "test",
"single_end": true
},
"test.pairs.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"4": [
"versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7"
],
"bam": [
[
{
Expand Down Expand Up @@ -183,15 +110,19 @@
"test.tagAlign.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions": [
"versions.yml:md5,e3ece11a3651bd28b0ea714f94f09da7"
"versions_chromap": [
[
"CHROMAP_CHROMAP",
"chromap",
"0.2.6-r490"
]
]
}
],
"timestamp": "2026-03-23T20:44:20.71658166",
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-08-05T17:49:42.086410229"
"nf-test": "0.9.4",
"nextflow": "26.02.0"
}
}
}
3 changes: 0 additions & 3 deletions subworkflows/nf-core/fastq_align_chromap/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ workflow FASTQ_ALIGN_CHROMAP {
ch_pairs_chr_order // channel (optional): [ pairs_chr_order ]

main:
ch_versions = channel.empty()

//
// Map reads with CHROMAP
//
CHROMAP_CHROMAP(ch_reads, ch_fasta_fai, ch_index, ch_barcodes, ch_whitelist, ch_chr_order, ch_pairs_chr_order)
ch_versions = ch_versions.mix(CHROMAP_CHROMAP.out.versions)

//
// Sort, index BAM file and run samtools stats, flagstat and idxstats
Expand All @@ -35,5 +33,4 @@ workflow FASTQ_ALIGN_CHROMAP {
stats = BAM_SORT_STATS_SAMTOOLS.out.stats // channel: [ val(meta), [ stats ] ]
flagstat = BAM_SORT_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), [ flagstat ] ]
idxstats = BAM_SORT_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), [ idxstats ] ]
versions = ch_versions // path: versions.yml
}
4 changes: 0 additions & 4 deletions subworkflows/nf-core/fastq_align_chromap/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ output:
type: file
description: File containing samtools idxstats output
pattern: "*.{idxstats}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@JoseEspinosa"
maintainers:
Expand Down
Loading
Loading