Skip to content

Commit

Permalink
refactor: filtering strategy bbduk CDCgov#147
Browse files Browse the repository at this point in the history
  • Loading branch information
slsevilla committed Mar 31, 2024
1 parent 47a0c5c commit 5221309
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 0 additions & 4 deletions modules/local/bbduk.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ process BBDUK {
tuple val(meta), path('*.log') , emit: log
path "versions.yml" , emit: versions

when:
//if the files are not corrupt and there are equal number of reads in each file then run bbduk
"${fairy_outcome[0]}" == "PASSED: File ${meta.id}_R1 is not corrupt." && "${fairy_outcome[1]}" == "PASSED: File ${meta.id}_R2 is not corrupt." && "${fairy_outcome[2]}" == "PASSED: Read pairs for ${meta.id} are equal."

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
Expand Down
5 changes: 4 additions & 1 deletion workflows/phoenix.nf
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ workflow PHOENIX_EXTERNAL {
ch_versions = ch_versions.mix(GET_RAW_STATS.out.versions)

// Combining reads with output of corruption check
bbduk_ch = INPUT_CHECK.out.reads.join(GET_RAW_STATS.out.outcome.splitCsv(strip:true, by:3).map{meta, fairy_outcome -> [meta, [fairy_outcome[0][0], fairy_outcome[1][0], fairy_outcome[2][0]]]}, by: [0,0])
bbduk_ch = INPUT_CHECK.out.reads
.join(GET_RAW_STATS.out.outcome.splitCsv(strip:true, by:3)
.map{meta, fairy_outcome -> [meta, [fairy_outcome[0][0], fairy_outcome[1][0], fairy_outcome[2][0]]]}, by: [0,0])
.filter { it[3].findAll {!it.contains('FAILED')}}

// Remove PhiX reads
BBDUK (
Expand Down

0 comments on commit 5221309

Please sign in to comment.