Skip to content

Commit

Permalink
Added stub logic and test to fastq_fastqc_umitools_fastp
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp committed Jun 21, 2024
1 parent 0aa157a commit 026bc27
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 0 deletions.
6 changes: 6 additions & 0 deletions subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ include { FASTP } from '../../../modules/nf-core/fastp/main'
import groovy.json.JsonSlurper

def getFastpReadsAfterFiltering(json_file) {

if ( workflow.stubRun ) { return 0 }

def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary')
return json['after_filtering']['total_reads'].toLong()
}

def getFastpAdapterSequence(json_file){

if ( workflow.stubRun ) { return "" }

def Map json = (Map) new JsonSlurper().parseText(json_file.text)
try{
adapter = json['adapter_cutting']['read1_adapter_sequence']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,4 +559,49 @@ nextflow_workflow {
)
}
}

test("sarscov2 paired-end [fastq] - stub") {

options '-stub'

when {
workflow {
"""
skip_fastqc = false
with_umi = false
skip_umi_extract = false
umi_discard_read = 1
skip_trimming = false
adapter_fasta = []
save_trimmed_fail = false
save_merged = false
min_trimmed_reads = 1
input[0] = Channel.of([
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
])
input[1] = skip_fastqc
input[2] = with_umi
input[3] = skip_umi_extract
input[4] = umi_discard_read
input[5] = skip_trimming
input[6] = adapter_fasta
input[7] = save_trimmed_fail
input[8] = save_merged
input[9] = min_trimmed_reads
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(workflow.out).match() }
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -545,5 +545,186 @@
"nextflow": "24.04.2"
},
"timestamp": "2024-06-10T15:08:32.267769943"
},
"sarscov2 paired-end [fastq] - stub": {
"content": [
{
"0": [

],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"10": [
[
{
"id": "test",
"single_end": false
},
0
]
],
"11": [

],
"12": [

],
"13": [
"versions.yml:md5,85bd0117e5778fff18e3920972a296ad",
"versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e"
],
"2": [
[
{
"id": "test",
"single_end": false
},
"test.zip:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [

],
"4": [
[
{
"id": "test",
"single_end": false
},
""
]
],
"5": [
[
{
"id": "test",
"single_end": false
},
"test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"6": [
[
{
"id": "test",
"single_end": false
},
"test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"7": [
[
{
"id": "test",
"single_end": false
},
"test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"8": [

],
"9": [

],
"adapter_seq": [
[
{
"id": "test",
"single_end": false
},
""
]
],
"fastqc_raw_html": [
[
{
"id": "test",
"single_end": false
},
"test.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"fastqc_raw_zip": [
[
{
"id": "test",
"single_end": false
},
"test.zip:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"fastqc_trim_html": [

],
"fastqc_trim_zip": [

],
"reads": [

],
"trim_html": [
[
{
"id": "test",
"single_end": false
},
"test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"trim_json": [
[
{
"id": "test",
"single_end": false
},
"test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"trim_log": [
[
{
"id": "test",
"single_end": false
},
"test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"trim_read_count": [
[
{
"id": "test",
"single_end": false
},
0
]
],
"trim_reads_fail": [

],
"trim_reads_merged": [

],
"umi_log": [

],
"versions": [
"versions.yml:md5,85bd0117e5778fff18e3920972a296ad",
"versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-21T12:21:48.845872"
}
}

0 comments on commit 026bc27

Please sign in to comment.