Skip to content

Commit

Permalink
Now emitting trimmed reads
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp committed Jun 21, 2024
1 parent 5cab379 commit f7c9361
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 12 deletions.
6 changes: 3 additions & 3 deletions subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ include { FASTP } from '../../../modules/nf-core/fastp/main'
//
import groovy.json.JsonSlurper

def getFastpReadsAfterFiltering(json_file) {
def getFastpReadsAfterFiltering(json_file, min_num_reads) {

if ( workflow.stubRun ) { return 0 }
if ( workflow.stubRun ) { return min_num_reads }

def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary')
return json['after_filtering']['total_reads'].toLong()
Expand Down Expand Up @@ -115,7 +115,7 @@ workflow FASTQ_FASTQC_UMITOOLS_FASTP {
.out
.reads
.join(trim_json)
.map { meta, reads, json -> [ meta, reads, getFastpReadsAfterFiltering(json) ] }
.map { meta, reads, json -> [ meta, reads, getFastpReadsAfterFiltering(json, min_trimmed_reads.toLong()) ] }
.set { ch_num_trimmed_reads }

ch_num_trimmed_reads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,16 @@
"content": [
{
"0": [

[
{
"id": "test",
"single_end": false
},
[
"test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
"1": [
[
Expand All @@ -567,17 +576,30 @@
"id": "test",
"single_end": false
},
0
1
]
],
"11": [

[
{
"id": "test",
"single_end": false
},
"test.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"12": [

[
{
"id": "test",
"single_end": false
},
"test.zip:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"13": [
"versions.yml:md5,85bd0117e5778fff18e3920972a296ad",
"versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0",
"versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e"
],
"2": [
Expand Down Expand Up @@ -662,13 +684,34 @@
]
],
"fastqc_trim_html": [

[
{
"id": "test",
"single_end": false
},
"test.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"fastqc_trim_zip": [

[
{
"id": "test",
"single_end": false
},
"test.zip:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"reads": [

[
{
"id": "test",
"single_end": false
},
[
"test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
"trim_html": [
[
Expand Down Expand Up @@ -703,7 +746,7 @@
"id": "test",
"single_end": false
},
0
1
]
],
"trim_reads_fail": [
Expand All @@ -717,6 +760,7 @@
],
"versions": [
"versions.yml:md5,85bd0117e5778fff18e3920972a296ad",
"versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0",
"versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e"
]
}
Expand All @@ -725,6 +769,6 @@
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-21T12:21:48.845872"
"timestamp": "2024-06-21T14:46:58.329605"
}
}

0 comments on commit f7c9361

Please sign in to comment.