Skip to content

Commit

Permalink
NARFMAP segfault (#4895)
Browse files Browse the repository at this point in the history
* test(narfmap): Add segfault test

* fix(narfmap): Clean up log error

* test(narfmap): Should segfault

* chore(narfmap): Bump to 1.4.2

* test(narfmap): Mark test as passing

bioinformaticsorphanage/NARFMAP#10

* style: Add extra tag for nf-core/lint

* test: Update all the snapshot declarations

* chore: Add a TODO for poddar's test
  • Loading branch information
edmundmiller authored Jul 8, 2024
1 parent 1ceaa8b commit ccedf37
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 41 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/narfmap/align/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- defaults
dependencies:
# renovate: datasource=conda depName=bioconda/narfmap
- narfmap=1.4.0
- narfmap=1.4.2
# renovate: datasource=conda depName=bioconda/samtools
- samtools=1.18
- pigz=2.8
6 changes: 3 additions & 3 deletions modules/nf-core/narfmap/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ process NARFMAP_ALIGN {
// TODO Add a singularity image
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'nf-core/modules/narfmap_align:narfmap--8a04bcf8bd9b6242':
'nf-core/modules/narfmap_align:narfmap--8a04bcf8bd9b6242' }"
'oras://community.wave.seqera.io/library/narfmap_align:8bad41386eab9997':
'community.wave.seqera.io/library/narfmap_align:517a1fed8e4e84c1' }"

input:
tuple val(meta) , path(reads)
Expand Down Expand Up @@ -34,7 +34,7 @@ process NARFMAP_ALIGN {
$args \\
--num-threads $task.cpus \\
$reads_command \\
2> ${prefix}.narfmap.log \\
2> >(tee ${prefix}.narfmap.log >&2) \\
| samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam -
cat <<-END_VERSIONS > versions.yml
Expand Down
39 changes: 26 additions & 13 deletions modules/nf-core/narfmap/align/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ nextflow_process {
tag "modules_nfcore"
tag "narfmap"
tag "narfmap/align"
tag "narfmap/hashtable"

test("sarscov2 - fastq, hashtable, false") {

Expand Down Expand Up @@ -41,10 +42,12 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert snapshot(
process.out.bam,
process.out.versions,
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
).match()
}
)
}

Expand Down Expand Up @@ -83,10 +86,12 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert snapshot(
process.out.bam,
process.out.versions,
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
).match()
}
)
}

Expand Down Expand Up @@ -128,10 +133,12 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert snapshot(
process.out.bam,
process.out.versions,
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
).match()
}
)
}

Expand Down Expand Up @@ -173,10 +180,12 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert snapshot(
process.out.bam,
process.out.versions,
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
).match()
}
)
}

Expand Down Expand Up @@ -218,10 +227,12 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert snapshot(
process.out.bam,
process.out.versions,
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
file(process.out.versions[0]).name
).match() }
).match()
}
)
}

Expand Down Expand Up @@ -264,10 +275,12 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert snapshot(
process.out.bam,
process.out.versions,
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).name,
file(process.out.versions[0]).name
).match() }
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
).match()
}
)
}

Expand Down
128 changes: 110 additions & 18 deletions modules/nf-core/narfmap/align/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"homo_sapiens - [fastq1, fastq2], hashtable, true": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test.bam:md5,5c407c8e621fc931af17a585526598bf"
]
],
[
"versions.yml:md5,f7f7afeeca9aecd25ef825978aac55d7"
],
"test.bam",
[
"decompHashTableCtxInit...",
Expand All @@ -9,21 +21,53 @@
"decompHashTableExtIndex...",
"decompHashTableAutoHits...",
"decompHashTableSetFlags..."
],
"versions.yml"
]
],
"timestamp": "2023-11-23T10:12:03.844836279"
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-08T11:45:10.095839411"
},
"sarscov2 - [fastq1, fastq2], hashtable, true - stub": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[
"versions.yml:md5,f7f7afeeca9aecd25ef825978aac55d7"
],
"test.bam",
"test.log",
"versions.yml"
[

]
],
"timestamp": "2023-11-22T13:41:18.016853266"
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-08T11:45:22.364107512"
},
"sarscov2 - fastq, hashtable, false": {
"content": [
[
[
{
"id": "test",
"single_end": true
},
"test.bam:md5,ea3a6f419b6c8f91e99603058c608124"
]
],
[
"versions.yml:md5,f7f7afeeca9aecd25ef825978aac55d7"
],
"test.bam",
[
"decompHashTableCtxInit...",
Expand All @@ -32,13 +76,28 @@
"decompHashTableExtIndex...",
"decompHashTableAutoHits...",
"decompHashTableSetFlags..."
],
"versions.yml"
]
],
"timestamp": "2023-11-23T10:11:33.956661024"
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-08T11:43:57.96792573"
},
"sarscov2 - fastq, hashtable, true": {
"content": [
[
[
{
"id": "test",
"single_end": true
},
"test.bam:md5,e2632fce5442e05210edd516715489c4"
]
],
[
"versions.yml:md5,f7f7afeeca9aecd25ef825978aac55d7"
],
"test.bam",
[
"decompHashTableCtxInit...",
Expand All @@ -47,13 +106,28 @@
"decompHashTableExtIndex...",
"decompHashTableAutoHits...",
"decompHashTableSetFlags..."
],
"versions.yml"
]
],
"timestamp": "2023-11-23T10:11:40.270598375"
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-08T11:44:17.486586239"
},
"sarscov2 - [fastq1, fastq2], hashtable, false": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test.bam:md5,ef0c12ae27778b906fd4f822ef7ce074"
]
],
[
"versions.yml:md5,f7f7afeeca9aecd25ef825978aac55d7"
],
"test.bam",
[
"decompHashTableCtxInit...",
Expand All @@ -62,13 +136,28 @@
"decompHashTableExtIndex...",
"decompHashTableAutoHits...",
"decompHashTableSetFlags..."
],
"versions.yml"
]
],
"timestamp": "2023-11-23T10:11:46.928978876"
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-08T11:44:48.178604348"
},
"sarscov2 - [fastq1, fastq2], hashtable, true": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test.bam:md5,54965e6a11a9c31b1ae3c7e896c96c32"
]
],
[
"versions.yml:md5,f7f7afeeca9aecd25ef825978aac55d7"
],
"test.bam",
[
"decompHashTableCtxInit...",
Expand All @@ -77,9 +166,12 @@
"decompHashTableExtIndex...",
"decompHashTableAutoHits...",
"decompHashTableSetFlags..."
],
"versions.yml"
]
],
"timestamp": "2023-11-23T10:11:53.506727278"
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-08T11:44:55.858525101"
}
}
67 changes: 67 additions & 0 deletions modules/nf-core/narfmap/align/tests/segfault.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
nextflow_process {

name "Test Process NARFMAP_ALIGN"
script "../main.nf"
process "NARFMAP_ALIGN"
tag "modules"
tag "modules_nfcore"
tag "narfmap"
tag "narfmap/align"
tag "narfmap/hashtable"
tag "bug"

test("This should segfault") {

setup {
run("NARFMAP_HASHTABLE") {
script "../../hashtable/main.nf"
process {
"""
input[0] = [
[id:'test'],
file('https://raw.githubusercontent.com/nf-core/test-datasets/nascent/reference/GRCh38_chr21.fa', checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file('https://raw.githubusercontent.com/nf-core/test-datasets/nascent/testdata/SRX882903_T2.fastq.gz', checkIfExists: true)
]
input[1] = NARFMAP_HASHTABLE.out.hashmap
input[2] = false //sort
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(
process.out.bam,
process.out.versions,
file(process.out.bam[0][1]).name,
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
).match()
}
)
}

}

// TODO
// https://nfcore.slack.com/archives/CGFUX04HZ/p1718268624579699?thread_ts=1718108323.285709&cid=CGFUX04HZ
// https://ftp.ncbi.nlm.nih.gov/ReferenceSamples/giab/data/AshkenazimTrio/HG002_NA24385_son/NIST_HiSeq_HG002_Homogeneity-10953946/HG002_HiSeq300x_fastq/140528_D00360_0018_AH8VC6ADXX/Project_RM8391_RM8392/Sample_2A1/2A1_CGATGT_L001_R1_001.fastq.gz
// https://ftp.ncbi.nlm.nih.gov/ReferenceSamples/giab/data/AshkenazimTrio/HG002_NA24385_son/NIST_HiSeq_HG002_Homogeneity-10953946/HG002_HiSeq300x_fastq/140528_D00360_0018_AH8VC6ADXX/Project_RM8391_RM8392/Sample_2A1/2A1_CGATGT_L001_R2_001.fastq.gz
// {{dragen}} \
// -r /home/tigem/h.poddar/short_reads_pipelines/ref_genome/GRCh37/hash/ \
// -1 /home/tigem/h.poddar/DRAGMAP/2A1_CGATGT_L001_R1_001.fastq.gz \
// -2 /home/tigem/h.poddar/DRAGMAP/2A1_CGATGT_L001_R2_001.fastq.gz \
// | samtools view -h -O BAM - > aligned.bam

}
Loading

0 comments on commit ccedf37

Please sign in to comment.