Skip to content

Commit

Permalink
Merge pull request #331 from danilodileo/update-config-demanging-proj
Browse files Browse the repository at this point in the history
Update config demanging proj + add new nf-tests
  • Loading branch information
danilodileo authored Feb 6, 2025
2 parents 5bd9c4f + e7dd260 commit da272d0
Show file tree
Hide file tree
Showing 16 changed files with 519 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ testing/
testing*
*.pyc
null/
.nf-test*
30 changes: 30 additions & 0 deletions .nf-test.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Feb-05 20:06:02.260 [main] INFO com.askimed.nf.test.App - nf-test 0.9.0
Feb-05 20:06:02.316 [main] INFO com.askimed.nf.test.App - Arguments: [test, --profile, test_transdecoder,singularity, ./tests/test_transdecoder.nf.test]
Feb-05 20:06:06.067 [main] INFO com.askimed.nf.test.App - Nextflow Version: 24.10.4
Feb-05 20:06:06.071 [main] INFO com.askimed.nf.test.commands.RunTestsCommand - Load config from file /cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo/nf-test.config...
Feb-05 20:06:13.221 [main] INFO com.askimed.nf.test.lang.dependencies.DependencyResolver - Loaded 136 files from directory /cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo in 5.363 sec
Feb-05 20:06:13.226 [main] INFO com.askimed.nf.test.lang.dependencies.DependencyResolver - Found 1 tests.
Feb-05 20:06:13.227 [main] DEBUG com.askimed.nf.test.lang.dependencies.DependencyResolver - Found tests: [/cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo/tests/test_transdecoder.nf.test]
Feb-05 20:06:13.227 [main] INFO com.askimed.nf.test.commands.RunTestsCommand - Detected 1 test files.
Feb-05 20:06:13.957 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Started test plan
Feb-05 20:06:13.958 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Running testsuite 'Test pipeline' from file '/cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo/tests/test_transdecoder.nf.test'.
Feb-05 20:06:13.958 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Run test '994b2388: Run with profile test transdecoder'. type: com.askimed.nf.test.lang.pipeline.PipelineTest
Feb-05 20:12:02.732 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Init new snapshot file '/cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo/tests/test_transdecoder.nf.test.snap'
Feb-05 20:12:02.735 [main] DEBUG com.askimed.nf.test.lang.extensions.Snapshot - Snapshot 'SAMPLE1_PE_1_val_1_fastqc.html' not found.
Feb-05 20:12:02.748 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Created snapshot 'SAMPLE1_PE_1_val_1_fastqc.html'
Feb-05 20:12:02.854 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Wrote snapshots to file '/cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo/tests/test_transdecoder.nf.test.snap'
Feb-05 20:12:02.855 [main] DEBUG com.askimed.nf.test.lang.extensions.Snapshot - Snapshot 'megahit_assembly.log' not found.
Feb-05 20:12:02.855 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Created snapshot 'megahit_assembly.log'
Feb-05 20:12:02.882 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Wrote snapshots to file '/cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo/tests/test_transdecoder.nf.test.snap'
Feb-05 20:12:02.884 [main] DEBUG com.askimed.nf.test.lang.extensions.Snapshot - Snapshot 'SAMPLE1_PE.bbmap.log' not found.
Feb-05 20:12:02.884 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Created snapshot 'SAMPLE1_PE.bbmap.log'
Feb-05 20:12:02.910 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Wrote snapshots to file '/cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo/tests/test_transdecoder.nf.test.snap'
Feb-05 20:12:02.911 [main] DEBUG com.askimed.nf.test.lang.extensions.Snapshot - Snapshot 'SAMPLE1_PE.featureCounts.tsv.summary' not found.
Feb-05 20:12:02.911 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Created snapshot 'SAMPLE1_PE.featureCounts.tsv.summary'
Feb-05 20:12:03.190 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Wrote snapshots to file '/cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo/tests/test_transdecoder.nf.test.snap'
Feb-05 20:12:03.191 [main] DEBUG com.askimed.nf.test.lang.extensions.Snapshot - Snapshot 'multiqc_report.html' not found.
Feb-05 20:12:03.192 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Created snapshot 'multiqc_report.html'
Feb-05 20:12:03.317 [main] DEBUG com.askimed.nf.test.lang.extensions.SnapshotFile - Wrote snapshots to file '/cfs/klemming/projects/supr/snic2020-16-76/ddl/dev/metatdenovo/tests/test_transdecoder.nf.test.snap'
Feb-05 20:12:03.327 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Test '994b2388: Run with profile test transdecoder' finished. status: PASSED
Feb-05 20:12:03.342 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Testsuite 'Test pipeline' finished. snapshot file: true, skipped tests: false, failed tests: false
Feb-05 20:12:03.346 [main] INFO com.askimed.nf.test.core.TestExecutionEngine - Executed 1 tests. 0 tests failed. Done!
2 changes: 1 addition & 1 deletion conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ process {
}
withLabel:error_retry {
errorStrategy = 'retry'
maxRetries = 2
maxRetries = 3
}
}
2 changes: 1 addition & 1 deletion modules/local/eggnog/mapper.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process EGGNOG_MAPPER {
tag "$meta.id"
label 'process_medium'
label 'process_high'

conda "bioconda::eggnog-mapper=2.1.9"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
Expand Down
2 changes: 1 addition & 1 deletion modules/local/kofamscan/scan.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process KOFAMSCAN_SCAN {
tag "$meta.id"
label 'process_medium'
label 'process_high'

conda "bioconda::kofamscan=1.3.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
Expand Down
40 changes: 40 additions & 0 deletions test_spades.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
nextflow_pipeline {
name "Test pipeline"
script "../main.nf"
tag "PIPELINE"

test("Run with profile test") {

when {
params {
outdir = "$outputDir"
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv'
skip_eukulele = true
skip_eggnog = true
skip_kofamscan = true
}
}

then {
assertAll(
{ assert workflow.success },
{ assert new File("$outputDir/trimgalore/SAMPLE1_PE_1.fastq.gz_trimming_report.txt").exists() },
{ assert new File("$outputDir/trimgalore/fastqc/SAMPLE1_PE_1_val_1_fastqc.html").exists() },
{ assert snapshot(path("$outputDir/trimgalore/fastqc/SAMPLE1_PE_1_val_1_fastqc.html")).match("SAMPLE1_PE_1_val_1_fastqc.html") },
{ assert new File("$outputDir/megahit/megahit_out/megahit_assembly.log").exists() },
{ assert snapshot(path("$outputDir/megahit/megahit_out/megahit_assembly.log")).match("megahit_assembly.log") },
{ assert new File("$outputDir/prodigal/megahit.prodigal.gff.gz").exists() },
{ assert new File("$outputDir/samtools/SAMPLE1_PE.sorted.bam.bai").exists() },
{ assert new File("$outputDir/bbmap/logs/SAMPLE1_PE.bbmap.log").exists() },
{ assert snapshot(path("$outputDir/bbmap/logs/SAMPLE1_PE.bbmap.log")).match("SAMPLE1_PE.bbmap.log") },
{ assert new File("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.tsv.summary").exists() },
{ assert snapshot(path("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.tsv.summary")).match("SAMPLE1_PE.featureCounts.tsv.summary") },
{ assert new File("$outputDir/summary_tables/megahit.prodigal.counts.tsv.gz").exists() },
{ assert new File("$outputDir/summary_tables/megahit.prodigal.overall_stats.tsv.gz").exists() },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert snapshot(path("$outputDir/multiqc/multiqc_report.html")).match("multiqc_report.html") },
{ assert new File("$outputDir/pipeline_info/nf_core_metatdenovo_software_mqc_versions.yml").exists() }
)
}
}
}
13 changes: 9 additions & 4 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,25 @@ nextflow_pipeline {
}

then {
assert workflow.success

assertAll(
{ assert workflow.success },
{ assert new File("$outputDir/trimgalore/SAMPLE1_PE_1.fastq.gz_trimming_report.txt").exists() },
{ assert new File("$outputDir/trimgalore/fastqc/SAMPLE1_PE_1_val_1_fastqc.html").exists() },
{ assert snapshot(path("$outputDir/trimgalore/fastqc/SAMPLE1_PE_1_val_1_fastqc.html")).match("SAMPLE1_PE_1_val_1_fastqc.html") },
{ assert new File("$outputDir/megahit/megahit_out/megahit_assembly.log").exists() },
{ assert snapshot(path("$outputDir/megahit/megahit_out/megahit_assembly.log")).match("megahit_assembly.log") },
{ assert new File("$outputDir/prodigal/megahit.prodigal.gff.gz").exists() },
{ assert new File("$outputDir/samtools/SAMPLE1_PE.sorted.bam.bai").exists() },
{ assert new File("$outputDir/bbmap/logs/SAMPLE1_PE.bbmap.log").exists() },
{ assert new File("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.txt.summary").exists() },
{ assert snapshot(path("$outputDir/bbmap/logs/SAMPLE1_PE.bbmap.log")).match("SAMPLE1_PE.bbmap.log") },
{ assert new File("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.tsv.summary").exists() },
{ assert snapshot(path("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.tsv.summary")).match("SAMPLE1_PE.featureCounts.tsv.summary") },
{ assert new File("$outputDir/summary_tables/megahit.prodigal.counts.tsv.gz").exists() },
{ assert new File("$outputDir/summary_tables/megahit.prodigal.overall_stats.tsv.gz").exists() },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert snapshot(path("$outputDir/multiqc/multiqc_report.html")).match("multiqc_report.html") },
{ assert new File("$outputDir/pipeline_info/nf_core_metatdenovo_software_mqc_versions.yml").exists() }
)
)
}
}
}
52 changes: 52 additions & 0 deletions tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"SAMPLE1_PE_1_val_1_fastqc.html": {
"content": [
"SAMPLE1_PE_1_val_1_fastqc.html:md5,4a2445318c2fb2e0438601bf5802388f"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T15:22:21.807677"
},
"SAMPLE1_PE.bbmap.log": {
"content": [
"SAMPLE1_PE.bbmap.log:md5,7a1855a6bf9e89bcba71ac9119e0a59b"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T16:11:45.667931"
},
"megahit_assembly.log": {
"content": [
"megahit_assembly.log:md5,4f08320f9647b3df461f7b1d6d86896a"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T16:11:45.651224"
},
"multiqc_report.html": {
"content": [
"multiqc_report.html:md5,58f356495cc357bc874ccd69d84fdde5"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T16:11:45.692642"
},
"SAMPLE1_PE.featureCounts.tsv.summary": {
"content": [
"SAMPLE1_PE.featureCounts.tsv.summary:md5,48f9b5ecdad2ef9b2fd7f4a6efef1cff"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T16:11:45.679723"
}
}
44 changes: 44 additions & 0 deletions tests/test_filter.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
nextflow_pipeline {
name "Test pipeline"
script "../main.nf"
tag "test_filter"
tag "PIPELINE"

test("Test with BBDuk option active") {

when {
params {
outdir = "$outputDir"
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv'
sequence_filter = 'https://github.com/nf-core/test-datasets/raw/metatdenovo/test_data/rrna.fna.gz'
skip_eukulele = true
skip_eggnog = true
skip_kofamscan = true
}
}

then {
assertAll(
{ assert workflow.success },
{ assert new File("$outputDir/trimgalore/SAMPLE1_PE_1.fastq.gz_trimming_report.txt").exists() },
{ assert new File("$outputDir/trimgalore/fastqc/SAMPLE1_PE_1_val_1_fastqc.html").exists() },
{ assert snapshot(path("$outputDir/trimgalore/fastqc/SAMPLE1_PE_1_val_1_fastqc.html")).match("SAMPLE1_PE_1_val_1_fastqc.html") },
{ assert new File("$outputDir/bbmap/bbduk/SAMPLE1_PE_1.fastq.gz").exists() },
{ assert snapshot(path("$outputDir/bbmap/bbduk/SAMPLE1_PE_1.fastq.gz")).match("SAMPLE1_PE_1.fastq.gz") },
{ assert new File("$outputDir/megahit/megahit_out/megahit_assembly.log").exists() },
{ assert snapshot(path("$outputDir/megahit/megahit_out/megahit_assembly.log")).match("megahit_assembly.log") },
{ assert new File("$outputDir/prodigal/megahit.prodigal.gff.gz").exists() },
{ assert new File("$outputDir/samtools/SAMPLE1_PE.sorted.bam.bai").exists() },
{ assert new File("$outputDir/bbmap/logs/SAMPLE1_PE.bbmap.log").exists() },
{ assert snapshot(path("$outputDir/bbmap/logs/SAMPLE1_PE.bbmap.log")).match("SAMPLE1_PE.bbmap.log") },
{ assert new File("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.tsv.summary").exists() },
{ assert snapshot(path("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.tsv.summary")).match("SAMPLE1_PE.featureCounts.tsv.summary") },
{ assert new File("$outputDir/summary_tables/megahit.prodigal.counts.tsv.gz").exists() },
{ assert new File("$outputDir/summary_tables/megahit.prodigal.overall_stats.tsv.gz").exists() },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert snapshot(path("$outputDir/multiqc/multiqc_report.html")).match("multiqc_report.html") },
{ assert new File("$outputDir/pipeline_info/nf_core_metatdenovo_software_mqc_versions.yml").exists() }
)
}
}
}
62 changes: 62 additions & 0 deletions tests/test_filter.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"SAMPLE1_PE_1_val_1_fastqc.html": {
"content": [
"SAMPLE1_PE_1_val_1_fastqc.html:md5,4a2445318c2fb2e0438601bf5802388f"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T17:42:19.895539"
},
"SAMPLE1_PE.bbmap.log": {
"content": [
"SAMPLE1_PE.bbmap.log:md5,bc644267bb359b1caab7dfb395abf609"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T17:42:21.854677"
},
"megahit_assembly.log": {
"content": [
"megahit_assembly.log:md5,b495c5f8f0ddc3ede5ebdba0a8a98fb9"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T17:42:21.210744"
},
"multiqc_report.html": {
"content": [
"multiqc_report.html:md5,9dea8eab69326e0f2da39372a97c7b41"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T17:42:23.257939"
},
"SAMPLE1_PE_1.fastq.gz": {
"content": [
"SAMPLE1_PE_1.fastq.gz:md5,6892ff76d326d45633c5c35cecdc04d5"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T17:42:20.022742"
},
"SAMPLE1_PE.featureCounts.tsv.summary": {
"content": [
"SAMPLE1_PE.featureCounts.tsv.summary:md5,72b2b4d49ed31379b4165c28977f195c"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T17:42:22.510011"
}
}
41 changes: 41 additions & 0 deletions tests/test_prokka.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
nextflow_pipeline {
name "Test pipeline"
script "../main.nf"
tag "PIPELINE"

test("Run with profile test_prokka") {

when {
params {
outdir = "$outputDir"
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv'
orf_caller = 'prokka'
skip_eukulele = true
skip_eggnog = true
skip_kofamscan = true
}
}

then {
assertAll(
{ assert workflow.success },
{ assert new File("$outputDir/trimgalore/SAMPLE1_PE_1.fastq.gz_trimming_report.txt").exists() },
{ assert new File("$outputDir/trimgalore/fastqc/SAMPLE1_PE_1_val_1_fastqc.html").exists() },
{ assert snapshot(path("$outputDir/trimgalore/fastqc/SAMPLE1_PE_1_val_1_fastqc.html")).match("SAMPLE1_PE_1_val_1_fastqc.html") },
{ assert new File("$outputDir/megahit/megahit_out/megahit_assembly.log").exists() },
{ assert snapshot(path("$outputDir/megahit/megahit_out/megahit_assembly.log")).match("megahit_assembly.log") },
{ assert new File("$outputDir/prokka/prokka.faa.gz").exists() },
{ assert new File("$outputDir/samtools/SAMPLE1_PE.sorted.bam.bai").exists() },
{ assert new File("$outputDir/bbmap/logs/SAMPLE1_PE.bbmap.log").exists() },
{ assert snapshot(path("$outputDir/bbmap/logs/SAMPLE1_PE.bbmap.log")).match("SAMPLE1_PE.bbmap.log") },
{ assert new File("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.tsv.summary").exists() },
{ assert snapshot(path("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.tsv.summary")).match("SAMPLE1_PE.featureCounts.tsv.summary") },
{ assert new File("$outputDir/summary_tables/megahit.prokka.counts.tsv.gz").exists() },
{ assert new File("$outputDir/summary_tables/megahit.prokka.overall_stats.tsv.gz").exists() },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert snapshot(path("$outputDir/multiqc/multiqc_report.html")).match("multiqc_report.html") },
{ assert new File("$outputDir/pipeline_info/nf_core_metatdenovo_software_mqc_versions.yml").exists() }
)
}
}
}
52 changes: 52 additions & 0 deletions tests/test_prokka.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"SAMPLE1_PE_1_val_1_fastqc.html": {
"content": [
"SAMPLE1_PE_1_val_1_fastqc.html:md5,4a2445318c2fb2e0438601bf5802388f"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T18:40:54.435147"
},
"SAMPLE1_PE.bbmap.log": {
"content": [
"SAMPLE1_PE.bbmap.log:md5,9d3840f99ed53f2350c1a832b283ca19"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T18:40:54.577197"
},
"megahit_assembly.log": {
"content": [
"megahit_assembly.log:md5,50f576b8c27efc87fa5363b4bebee1eb"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T18:40:54.534159"
},
"multiqc_report.html": {
"content": [
"multiqc_report.html:md5,81e95347843e231c2aa43509396f37a0"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T18:40:54.706469"
},
"SAMPLE1_PE.featureCounts.tsv.summary": {
"content": [
"SAMPLE1_PE.featureCounts.tsv.summary:md5,0e7c167fc69769bb19a5144bccb2b48b"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-05T18:40:54.606832"
}
}
Loading

0 comments on commit da272d0

Please sign in to comment.