Skip to content

Commit

Permalink
move code from ampliseq.nf to dada2_preprocessing.nf
Browse files Browse the repository at this point in the history
  • Loading branch information
d4straub committed Oct 12, 2023
1 parent 00132e7 commit 5b0270d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
24 changes: 22 additions & 2 deletions subworkflows/local/dada2_preprocessing.nf
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ workflow DADA2_PREPROCESSING {
ch_DADA2_QUALITY2_SVG = DADA2_QUALITY2.out.svg
}

//group by sequencing run
//group reads by sequencing run
//for 'groupTuple', 'size' or 'groupKey' should be used but to produce it we need to know how many elements to group but some can be lost here, so no way knowing before
ch_dada2_filtntrim_reads_passed
.map {
info, reads ->
Expand All @@ -154,9 +155,28 @@ workflow DADA2_PREPROCESSING {
[ meta, reads.flatten().sort() ] }
.set { ch_filt_reads }

//group logs by sequencing run
//for 'groupTuple', 'size' or 'groupKey' should be used but to produce it we need to know how many elements to group but some can be lost here, so no way knowing before
ch_dada2_filtntrim_logs_passed
.map {
info, reads ->
def meta = [:]
meta.run = info.run
meta.single_end = info.single_end
[ meta, reads, info.id ] }
.groupTuple(by: 0 )
.map {
info, reads, ids ->
def meta = [:]
meta.run = info.run
meta.single_end = info.single_end
meta.id = ids.flatten().sort()
[ meta, reads.flatten().sort() ] }
.set { ch_filt_logs }

emit:
reads = ch_filt_reads
logs = ch_dada2_filtntrim_logs_passed
logs = ch_filt_logs
args = ch_dada2_filtntrim_args_passed
qc_svg = ch_DADA2_QUALITY1_SVG.collect()
qc_svg_preprocessed = ch_DADA2_QUALITY2_SVG.collect()
Expand Down
14 changes: 0 additions & 14 deletions workflows/ampliseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -344,20 +344,6 @@ workflow AMPLISEQ {

//group by sequencing run & group by meta
DADA2_PREPROCESSING.out.logs
.map {
info, reads ->
def meta = [:]
meta.run = info.run
meta.single_end = info.single_end
[ meta, reads, info.id ] }
.groupTuple(by: 0 )
.map {
info, reads, ids ->
def meta = [:]
meta.run = info.run
meta.single_end = info.single_end
meta.id = ids.flatten().sort()
[ meta, reads.flatten().sort() ] }
.join( DADA2_DENOISING.out.denoised )
.join( DADA2_DENOISING.out.mergers )
.join( DADA2_RMCHIMERA.out.rds )
Expand Down

0 comments on commit 5b0270d

Please sign in to comment.