diff --git a/modules.json b/modules.json index fe81c8d6..046bb78f 100644 --- a/modules.json +++ b/modules.json @@ -125,7 +125,7 @@ }, "homer/findpeaks": { "branch": "master", - "git_sha": "b108745a1d59778e21577c217a963e17b8ba9bc2", + "git_sha": "cac282aeb4099300e04b60167a3a12d8c96c4978", "installed_by": ["homer_groseq"] }, "homer/maketagdirectory": { @@ -315,7 +315,7 @@ }, "homer_groseq": { "branch": "master", - "git_sha": "b108745a1d59778e21577c217a963e17b8ba9bc2", + "git_sha": "cac282aeb4099300e04b60167a3a12d8c96c4978", "installed_by": ["subworkflows"] }, "utils_nextflow_pipeline": { diff --git a/modules/nf-core/homer/findpeaks/tests/main.nf.test b/modules/nf-core/homer/findpeaks/tests/main.nf.test index a2263990..a72a0fa5 100644 --- a/modules/nf-core/homer/findpeaks/tests/main.nf.test +++ b/modules/nf-core/homer/findpeaks/tests/main.nf.test @@ -8,6 +8,7 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "homer" + tag "unzip" tag "homer/findpeaks" tag "homer/maketagdirectory" @@ -27,6 +28,20 @@ nextflow_process { """ } } + run("UNZIP") { + script "../../../unzip/main.nf" + process { + """ + url = 'https://raw.githubusercontent.com/nf-core/test-datasets/nascent/reference/uniqmap.GRCh38_chr21.50nt.zip' + + input[0] = [ + [:], + file(url, checkIfExists: true) + ] + """ + + } + } } test("sarscov2 - tagdir") { @@ -69,6 +84,31 @@ nextflow_process { ) } } - // TODO Test uniqmap. Might need to make a small uniqmap but that could take a day or two. - // See https://github.com/Functional-Genomics-Lab/homer-uniqmap-nf if you're feeling adventurous! + + test("sarscov2 - tagdir - uniqmap") { + + tag "uniqmap" + + when { + process { + """ + input[0] = HOMER_MAKETAGDIRECTORY.out.tagdir + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out, + // FIXME These are empty? + path(process.out.txt.get(0).get(1)).readLines()[31], + path(process.out.txt.get(0).get(1)).readLines()[33], + ).match() + } + ) + } + } } \ No newline at end of file diff --git a/modules/nf-core/homer/findpeaks/tests/main.nf.test.snap b/modules/nf-core/homer/findpeaks/tests/main.nf.test.snap index e2a44d5b..c658f18a 100644 --- a/modules/nf-core/homer/findpeaks/tests/main.nf.test.snap +++ b/modules/nf-core/homer/findpeaks/tests/main.nf.test.snap @@ -64,5 +64,40 @@ "nextflow": "24.03.0" }, "timestamp": "2024-05-17T13:56:22.119853182" + }, + "sarscov2 - tagdir - uniqmap": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test-uniqmap.GRCh38_chr21.peaks.txt:md5,d96e7bba4f4fe827a18acae200b422a4" + ] + ], + "1": [ + "versions.yml:md5,12c3e88a3eeb96208a1d352504ebebfa" + ], + "txt": [ + [ + { + "id": "test" + }, + "test-uniqmap.GRCh38_chr21.peaks.txt:md5,d96e7bba4f4fe827a18acae200b422a4" + ] + ], + "versions": [ + "versions.yml:md5,12c3e88a3eeb96208a1d352504ebebfa" + ] + }, + "# uniqMapDirectory = uniqmap.GRCh38_chr21.50nt", + "# cmd = findPeaks test_tagdir -style factor -o test-uniqmap.GRCh38_chr21.peaks.txt -uniqmap uniqmap.GRCh38_chr21.50nt" + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-07T18:32:39.16634" } } \ No newline at end of file diff --git a/subworkflows/nf-core/homer_groseq/tests/main.nf.test b/subworkflows/nf-core/homer_groseq/tests/main.nf.test index 3461de03..48e75981 100644 --- a/subworkflows/nf-core/homer_groseq/tests/main.nf.test +++ b/subworkflows/nf-core/homer_groseq/tests/main.nf.test @@ -72,7 +72,11 @@ nextflow_workflow { ) } } - test("Test files from tutorial") { + + test("Test files from GROseq tutorial with uniqmap") { + + tag "uniqmap" + config "./bed.config" when { @@ -80,11 +84,11 @@ nextflow_workflow { """ input[0] = [ [ id: 'test' ], - file('ftp://ftp.ncbi.nlm.nih.gov/geo/samples/GSM340nnn/GSM340901/suppl/GSM340901_lib1_aligned.bed.gz', checkIfExists: true), - file('ftp://ftp.ncbi.nlm.nih.gov/geo/samples/GSM340nnn/GSM340902/suppl/GSM340902_lib2_aligned.bed.gz', checkIfExists: true), + [file('ftp://ftp.ncbi.nlm.nih.gov/geo/samples/GSM340nnn/GSM340901/suppl/GSM340901_lib1_aligned.bed.gz', checkIfExists: true), + file('ftp://ftp.ncbi.nlm.nih.gov/geo/samples/GSM340nnn/GSM340902/suppl/GSM340902_lib2_aligned.bed.gz', checkIfExists: true)], ] input[1] = file('https://hgdownload.soe.ucsc.edu/goldenPath/hg18/chromosomes/chr14.fa.gz', checkIfExists: true) - input[2] = [] + input[2] = file('https://raw.githubusercontent.com/nf-core/test-datasets/nascent/reference/uniqmap.GRCh38_chr21.50nt.zip', checkIfExists: true) """ } } @@ -97,14 +101,14 @@ nextflow_workflow { path(workflow.out.bed_graph.get(0).get(1)).linesGzip.size(), workflow.out.peaks, workflow.out.bed, + path(workflow.out.bed.get(0).get(1)).readLines()[30], + path(workflow.out.bed.get(0).get(1)).readLines()[32], path(workflow.out.versions.get(0)).yaml, ).match() }, ) } } - // TODO Test uniqmap - test("sarscov2 - stub") { options "-stub" diff --git a/subworkflows/nf-core/homer_groseq/tests/main.nf.test.snap b/subworkflows/nf-core/homer_groseq/tests/main.nf.test.snap index ecb37fde..61e8eb64 100644 --- a/subworkflows/nf-core/homer_groseq/tests/main.nf.test.snap +++ b/subworkflows/nf-core/homer_groseq/tests/main.nf.test.snap @@ -75,15 +75,15 @@ }, "timestamp": "2024-11-23T20:47:40.376043" }, - "Test files from tutorial": { + "Should run HOMER_GROSEQ with BED input": { "content": [ - 7856998, + 6, [ [ { "id": "test" }, - "test.peaks.txt:md5,312199a96a41f67fe81b91289fefc6e1" + "test.peaks.txt:md5,0b0b174b135fd5404a9b462e27ab4ce1" ] ], [ @@ -91,7 +91,7 @@ { "id": "test" }, - "test.bed:md5,45b36116aa3f75ddd4f655f97ab8dfd6" + "test.bed:md5,0b0b174b135fd5404a9b462e27ab4ce1" ] ], { @@ -104,17 +104,17 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-24T15:36:33.428434" + "timestamp": "2024-11-23T20:47:47.733612" }, - "Should run HOMER_GROSEQ with BED input": { + "Test files from GROseq tutorial with uniqmap": { "content": [ - 6, + 15368354, [ [ { "id": "test" }, - "test.peaks.txt:md5,0b0b174b135fd5404a9b462e27ab4ce1" + "test-uniqmap.GRCh38_chr21.50nt.peaks.txt:md5,3220d07ce56785d77045282345ddf1cd" ] ], [ @@ -122,9 +122,11 @@ { "id": "test" }, - "test.bed:md5,0b0b174b135fd5404a9b462e27ab4ce1" + "test.bed:md5,49433f826697cd237dfdb740a0cb2c54" ] ], + "# uniqMapDirectory = uniqmap.GRCh38_chr21.50nt.zip", + "# cmd = findPeaks test_tagdir -o test-uniqmap.GRCh38_chr21.50nt.peaks.txt -uniqmap uniqmap.GRCh38_chr21.50nt.zip", { "HOMER_GROSEQ:HOMER_POS2BED": { "homer": 4.11 @@ -133,8 +135,8 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.1" + "nextflow": "24.10.2" }, - "timestamp": "2024-11-23T20:47:47.733612" + "timestamp": "2024-12-07T17:59:14.024175" } } \ No newline at end of file diff --git a/workflows/tests/inputs/uniqmap/main.nf.test b/workflows/tests/inputs/uniqmap/main.nf.test new file mode 100644 index 00000000..04db908c --- /dev/null +++ b/workflows/tests/inputs/uniqmap/main.nf.test @@ -0,0 +1,54 @@ +nextflow_pipeline { + + name "HOMER Uniqmap" + script "../../../../main.nf" + tag "input" + tag "homer" + + test("Should run with an zipped uniqmap") { + + config "./nextflow.config" + + when { + params { + outdir = "$outputDir" + use_homer_uniqmap = true + homer_uniqmap = 'https://raw.githubusercontent.com/nf-core/test-datasets/nascent/reference/uniqmap.GRCh38_chr21.50nt.zip' + skip_grohmm = true + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(removeNextflowVersion("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml")).match("software_versions") }, + // Files should have -uniqmap in the header + { assert path("$outputDir/transcript_identification/homer/cd4.bed").readLines()[18].contains("uniqMapDirectory = uniqmap.GRCh38_chr21.50nt") }, + { assert path("$outputDir/transcript_identification/homer/cd4.bed").readLines()[20].contains("-uniqmap") }, + { assert path("$outputDir/transcript_identification/homer/jurkat.bed").readLines()[18].contains("uniqMapDirectory = uniqmap.GRCh38_chr21.50nt") }, + { assert path("$outputDir/transcript_identification/homer/jurkat.bed").readLines()[20].contains("-uniqmap") }, + // TODO Test for uniqmap unzip process + // { assert workflow.trace.tasks().find { it.process == "UNZIP" } }, + { assert snapshot( + workflow.trace.tasks().size(), + path("$outputDir/transcript_identification/homer/cd4.bed").readLines()[18], + path("$outputDir/transcript_identification/homer/cd4.bed").readLines()[20], + path("$outputDir/transcript_identification/homer/jurkat.bed").readLines()[18], + path("$outputDir/transcript_identification/homer/jurkat.bed").readLines()[20], + path("$outputDir/transcript_identification/homer/cd4.bed"), + path("$outputDir/transcript_identification/homer/jurkat.bed"), + path("$outputDir/transcript_identification/homer/cd4-uniqmap.GRCh38_chr21.peaks.txt"), + path("$outputDir/transcript_identification/homer/jurkat-uniqmap.GRCh38_chr21.peaks.txt"), + path("$outputDir/transcript_identification/intersect/").list(), + path("$outputDir/transcript_identification/filtered/").list(), + // FIXME Not determinstic because of the order of files + // Add to the other tests when fixed + // path("$outputDir/quantification/").list(), + path("$outputDir/multiqc/multiqc_report.html").exists(), + ).match("output_files") + }, + ) + } + } + // TODO Check for running with unzipped uniqmap +} diff --git a/workflows/tests/inputs/uniqmap/main.nf.test.snap b/workflows/tests/inputs/uniqmap/main.nf.test.snap new file mode 100644 index 00000000..e194f434 --- /dev/null +++ b/workflows/tests/inputs/uniqmap/main.nf.test.snap @@ -0,0 +1,109 @@ +{ + "output_files": { + "content": [ + 78, + "# uniqMapDirectory = uniqmap.GRCh38_chr21.50nt", + "# cmd = findPeaks cd4_tagdir -style groseq -o cd4-uniqmap.GRCh38_chr21.peaks.txt -uniqmap uniqmap.GRCh38_chr21.50nt", + "# uniqMapDirectory = uniqmap.GRCh38_chr21.50nt", + "# cmd = findPeaks jurkat_tagdir -style groseq -o jurkat-uniqmap.GRCh38_chr21.peaks.txt -uniqmap uniqmap.GRCh38_chr21.50nt", + "cd4.bed:md5,bbe77431f7c1ac833d1f939012435962", + "jurkat.bed:md5,98dd0b5dde7b11c0604b35c391754c9d", + "cd4-uniqmap.GRCh38_chr21.peaks.txt:md5,bbe77431f7c1ac833d1f939012435962", + "jurkat-uniqmap.GRCh38_chr21.peaks.txt:md5,98dd0b5dde7b11c0604b35c391754c9d", + [ + "cd4_intersect.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "jurkat_intersect.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "cd4_filtered.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "jurkat_filtered.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + true + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-21T07:55:14.410658" + }, + "software_versions": { + "content": [ + { + "BBMAP_PILEUP": { + "bbmap": 39.01, + "samtools": "1.16.1", + "pigz": 2.6 + }, + "BEDTOOLS_GENOMECOV_MINUS": { + "bedtools": "2.31.1" + }, + "BEDTOOLS_GENOMECOV_PLUS": { + "bedtools": "2.31.1" + }, + "BEDTOOLS_INTERSECT": { + "bedtools": "2.31.1" + }, + "BEDTOOLS_INTERSECT_FILTER": { + "bedtools": "2.31.1" + }, + "BWA_INDEX": { + "bwa": "0.7.18-r1243-dirty" + }, + "BWA_MEM": { + "bwa": "0.7.18-r1243-dirty", + "samtools": 1.2 + }, + "CUSTOM_GETCHROMSIZES": { + "getchromsizes": 1.2 + }, + "DEEPTOOLS_BAMCOVERAGE_MINUS": { + "deeptools": "3.5.1" + }, + "DEEPTOOLS_BAMCOVERAGE_PLUS": { + "deeptools": "3.5.1" + }, + "FASTP": { + "fastp": "0.23.4" + }, + "FASTQC": { + "fastqc": "0.12.1" + }, + "GTF2BED": { + "perl": "5.26.2" + }, + "PRESEQ_CCURVE": { + "preseq": "3.1.1" + }, + "PRESEQ_LCEXTRAP": { + "preseq": "3.1.1" + }, + "RSEQC_INFEREXPERIMENT": { + "rseqc": "5.0.2" + }, + "RSEQC_READDISTRIBUTION": { + "rseqc": "5.0.2" + }, + "RSEQC_READDUPLICATION": { + "rseqc": "5.0.2" + }, + "SAMTOOLS_MERGE": { + "samtools": 1.21 + }, + "SUBREAD_FEATURECOUNTS_GENE": { + "subread": "2.0.1" + }, + "UNZIP": { + "7za": 16.02 + }, + "Workflow": { + "nf-core/nascent": "v2.3.0dev" + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-21T08:17:33.996307" + } +} \ No newline at end of file diff --git a/workflows/tests/inputs/uniqmap/nextflow.config b/workflows/tests/inputs/uniqmap/nextflow.config new file mode 100644 index 00000000..a3d80f05 --- /dev/null +++ b/workflows/tests/inputs/uniqmap/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: PINTS_CALLER { + ext.when = false + } +}