diff --git a/tests/modules/mapping/gem/main.index.nf.test b/tests/modules/mapping/gem/main.index.nf.test new file mode 100644 index 0000000..9841afc --- /dev/null +++ b/tests/modules/mapping/gem/main.index.nf.test @@ -0,0 +1,65 @@ +nextflow_process { + + name "Test Process index" + script "modules/mapping/gem/main.nf" + process "index" + + tag "module" + + test("Should create index using GEM (compressed references)") { + + when { + process { + """ + input[0] = file("${baseDir}/data/genome.fa.gz") + input[1] = file("${baseDir}/data/annotation.gtf.gz") + """ + } + } + + then { + assert process.success + with(process.out) { + def genomeDir = get(0)[0] + assert path(genomeDir).list().size() == 7 + assert snapshot( + path("${genomeDir}/genome_index.gem"), + path("${genomeDir}/transcript_index.junctions"), + path("${genomeDir}/transcript_index.junctions.fa"), + path("${genomeDir}/transcript_index.junctions.gem"), + path("${genomeDir}/transcript_index.junctions.keys"), + ).match() + } + } + + } + + test("Should create index using GEM (uncompressed references)") { + + when { + process { + """ + input[0] = file("${baseDir}/data/genome.fa") + input[1] = file("${baseDir}/data/annotation.gtf") + """ + } + } + + then { + assert process.success + with(process.out) { + def genomeDir = get(0)[0] + assert path(genomeDir).list().size() == 7 + assert snapshot( + path("${genomeDir}/genome_index.gem"), + path("${genomeDir}/transcript_index.junctions"), + path("${genomeDir}/transcript_index.junctions.fa"), + path("${genomeDir}/transcript_index.junctions.gem"), + path("${genomeDir}/transcript_index.junctions.keys"), + ).match() + } + } + + } + +} diff --git a/tests/modules/mapping/gem/main.index.nf.test.snap b/tests/modules/mapping/gem/main.index.nf.test.snap new file mode 100644 index 0000000..47c564f --- /dev/null +++ b/tests/modules/mapping/gem/main.index.nf.test.snap @@ -0,0 +1,30 @@ +{ + "Should create index using GEM (compressed references)": { + "content": [ + "genome_index.gem:md5,ebd155f05251ace3a35ce3edd8816211", + "transcript_index.junctions:md5,a0433e39f0c35e798609ff15332e12d4", + "transcript_index.junctions.fa:md5,be0a28c75266e6969c11e308341810ae", + "transcript_index.junctions.gem:md5,b53971e7b5358fd8cae8bb7f2a4a729d", + "transcript_index.junctions.keys:md5,34985e55c280acd027d2dd32906ad59c" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-02T09:01:47.328374722" + }, + "Should create index using GEM (uncompressed references)": { + "content": [ + "genome_index.gem:md5,ebd155f05251ace3a35ce3edd8816211", + "transcript_index.junctions:md5,a0433e39f0c35e798609ff15332e12d4", + "transcript_index.junctions.fa:md5,be0a28c75266e6969c11e308341810ae", + "transcript_index.junctions.gem:md5,b53971e7b5358fd8cae8bb7f2a4a729d", + "transcript_index.junctions.keys:md5,34985e55c280acd027d2dd32906ad59c" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-02T09:02:27.226869622" + } +} \ No newline at end of file diff --git a/tests/modules/mapping/gem/main.map.nf.test b/tests/modules/mapping/gem/main.map.nf.test new file mode 100644 index 0000000..09aacad --- /dev/null +++ b/tests/modules/mapping/gem/main.map.nf.test @@ -0,0 +1,79 @@ +nextflow_process { + + name "Test Process map" + script "modules/mapping/gem/main.nf" + process "map" + + tag "module" + + setup { + run("index") { + script "modules/mapping/gem/main.nf" + process { + """ + input[0] = file("${baseDir}/data/genome.fa") + input[1] = file("${baseDir}/data/annotation.gtf") + """ + } + } + } + + test("Should align reads to the reference using GEM (compressed annotation)") { + + when { + params { + maxMismatches = 4 + maxMultimaps = 10 + } + process { + """ + def fastqs = file("${baseDir}/data/test1_*.fastq.gz") + def qScore = fastq(fastqs[0]).qualityScore() + input[0] = file("${baseDir}/data/annotation.gtf.gz") + input[1] = index.out + input[2] = Channel.from( + [ + [ "sample1", "test1", fastqs, "fastq", ["fqRd1", "fqRd2"], qScore] + ] + ) + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + + } + + test("Should align reads to the reference using GEM (uncompressed annotation)") { + + when { + params { + maxMismatches = 4 + maxMultimaps = 10 + } + process { + """ + def fastqs = file("${baseDir}/data/test1_*.fastq.gz") + def qScore = fastq(fastqs[0]).qualityScore() + input[0] = file("${baseDir}/data/annotation.gtf") + input[1] = index.out + input[2] = Channel.from( + [ + [ "sample1", "test1", fastqs, "fastq", ["fqRd1", "fqRd2"], qScore] + ] + ) + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + + } + +} diff --git a/tests/modules/mapping/gem/main.map.nf.test.snap b/tests/modules/mapping/gem/main.map.nf.test.snap new file mode 100644 index 0000000..4e82cd3 --- /dev/null +++ b/tests/modules/mapping/gem/main.map.nf.test.snap @@ -0,0 +1,140 @@ +{ + "Should align reads to the reference using GEM (compressed annotation)": { + "content": [ + { + "0": [ + [ + "sample1", + "test1", + "sample1_m4_n10_toGenome.bam:md5,48faeddd5179ce7b5d629ad937851b45", + "bam", + "GenomeAlignments", + true + ] + ], + "1": [ + + ], + "2": [ + [ + "sample1", + "test1", + "sample1_m4_n10_toGenome.bam.bai:md5,f0b712d99d68ae3132bdb287ed5a5e5d", + "bai", + "GenomeAlignmentsIndex", + true + ] + ], + "3": [ + + ], + "4": [ + + ], + "genomeAlignments": [ + [ + "sample1", + "test1", + "sample1_m4_n10_toGenome.bam:md5,48faeddd5179ce7b5d629ad937851b45", + "bam", + "GenomeAlignments", + true + ] + ], + "genomeAlignmentsIndices": [ + [ + "sample1", + "test1", + "sample1_m4_n10_toGenome.bam.bai:md5,f0b712d99d68ae3132bdb287ed5a5e5d", + "bai", + "GenomeAlignmentsIndex", + true + ] + ], + "junctions": [ + + ], + "stats": [ + + ], + "transcriptomeAlignments": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-02T08:54:34.740923082" + }, + "Should align reads to the reference using GEM (uncompressed annotation)": { + "content": [ + { + "0": [ + [ + "sample1", + "test1", + "sample1_m4_n10_toGenome.bam:md5,48faeddd5179ce7b5d629ad937851b45", + "bam", + "GenomeAlignments", + true + ] + ], + "1": [ + + ], + "2": [ + [ + "sample1", + "test1", + "sample1_m4_n10_toGenome.bam.bai:md5,f0b712d99d68ae3132bdb287ed5a5e5d", + "bai", + "GenomeAlignmentsIndex", + true + ] + ], + "3": [ + + ], + "4": [ + + ], + "genomeAlignments": [ + [ + "sample1", + "test1", + "sample1_m4_n10_toGenome.bam:md5,48faeddd5179ce7b5d629ad937851b45", + "bam", + "GenomeAlignments", + true + ] + ], + "genomeAlignmentsIndices": [ + [ + "sample1", + "test1", + "sample1_m4_n10_toGenome.bam.bai:md5,f0b712d99d68ae3132bdb287ed5a5e5d", + "bai", + "GenomeAlignmentsIndex", + true + ] + ], + "junctions": [ + + ], + "stats": [ + + ], + "transcriptomeAlignments": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-02T08:55:30.059497532" + } +} \ No newline at end of file diff --git a/tests/modules/mapping/star/main.index.nf.test b/tests/modules/mapping/star/main.index.nf.test index 466c4f8..029b2f8 100644 --- a/tests/modules/mapping/star/main.index.nf.test +++ b/tests/modules/mapping/star/main.index.nf.test @@ -6,7 +6,7 @@ nextflow_process { tag "module" - test("Should index compressed references") { + test("Should create index using STAR (compressed references)") { when { params { @@ -47,7 +47,7 @@ nextflow_process { } - test("Should index uncompressed references") { + test("Should create index using STAR (uncompressed references)") { when { params { diff --git a/tests/modules/mapping/star/main.index.nf.test.snap b/tests/modules/mapping/star/main.index.nf.test.snap index 1ac2c66..dba0439 100644 --- a/tests/modules/mapping/star/main.index.nf.test.snap +++ b/tests/modules/mapping/star/main.index.nf.test.snap @@ -1,5 +1,5 @@ { - "Should index compressed references": { + "Should create index using STAR (compressed references)": { "content": [ "Genome:md5,7ede3c93094305c2b5c18e2f52110194", "SA:md5,66c24435d4e28eeddb6a5014ac90c4ef", @@ -23,7 +23,7 @@ }, "timestamp": "2024-04-17T17:20:31.357378" }, - "Should index uncompressed references": { + "Should create index using STAR (uncompressed references)": { "content": [ "Genome:md5,7ede3c93094305c2b5c18e2f52110194", "SA:md5,66c24435d4e28eeddb6a5014ac90c4ef", @@ -47,4 +47,4 @@ }, "timestamp": "2024-04-17T17:20:43.134729" } -} \ No newline at end of file +} diff --git a/tests/modules/mapping/star/main.map.nf.test b/tests/modules/mapping/star/main.map.nf.test index d5955f1..a12090b 100644 --- a/tests/modules/mapping/star/main.map.nf.test +++ b/tests/modules/mapping/star/main.map.nf.test @@ -18,11 +18,10 @@ nextflow_process { } } - test("Should align reads to the reference with compressed annotation") { + test("Should align reads to the reference using STAR (compressed annotation)") { when { params { - mappingTool = "STAR" sjOverHang = 100 quantificationTool = "RSEM" maxMismatches = 4 @@ -53,11 +52,10 @@ nextflow_process { } - test("Should align reads to the reference with uncompressed annotation") { + test("Should align reads to the reference using STAR (uncompressed annotation)") { when { params { - mappingTool = "STAR" sjOverHang = 100 quantificationTool = "RSEM" maxMismatches = 4 diff --git a/tests/modules/mapping/star/main.map.nf.test.snap b/tests/modules/mapping/star/main.map.nf.test.snap index 87be468..cc27f6e 100644 --- a/tests/modules/mapping/star/main.map.nf.test.snap +++ b/tests/modules/mapping/star/main.map.nf.test.snap @@ -1,5 +1,5 @@ { - "Should align reads to the reference with uncompressed annotation": { + "Should align reads to the reference using STAR (uncompressed annotation)": { "content": [ [ [ @@ -12,7 +12,7 @@ ] ], [ - + ], [ [ @@ -41,7 +41,7 @@ }, "timestamp": "2024-04-23T23:19:28.403716" }, - "Should align reads to the reference with compressed annotation": { + "Should align reads to the reference using STAR (compressed annotation)": { "content": [ [ [ @@ -54,7 +54,7 @@ ] ], [ - + ], [ [ @@ -83,4 +83,4 @@ }, "timestamp": "2024-04-23T23:11:13.889531" } -} \ No newline at end of file +}