1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-22 04:39:55 +00:00

Apply suggestions from code review

Co-authored-by: Moritz E. Beber <midnighter@posteo.net>
This commit is contained in:
James A. Fellows Yates 2022-04-01 15:34:05 +02:00 committed by GitHub
parent 0d0b377dfb
commit 14f2b7bd84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 12 deletions

View file

@ -17,14 +17,16 @@ workflow SHORTREAD_ADAPTERREMOVAL {
ch_input_for_adapterremoval = reads ch_input_for_adapterremoval = reads
.branch{ .branch{
single: it[0]['single_end'] == true single: it[0].single_end
paired: it[0]['single_end'] == false paired: !it[0].single_end
} }
ADAPTERREMOVAL_SINGLE ( ch_input_for_adapterremoval.single, [] ) ADAPTERREMOVAL_SINGLE ( ch_input_for_adapterremoval.single, [] )
ADAPTERREMOVAL_PAIRED ( ch_input_for_adapterremoval.paired, [] ) ADAPTERREMOVAL_PAIRED ( ch_input_for_adapterremoval.paired, [] )
if ( params.shortread_clipmerge_mergepairs && !params.shortread_clipmerge_excludeunmerged ) { if ( params.shortread_clipmerge_mergepairs && !params.shortread_clipmerge_excludeunmerged ) {
// due to the slightly ugly output implementation of the current AdapterRemoval2 module, each file
// has to be exported in a separate channel, and we must manually recombine when necessary
ch_adapterremoval_for_cat = ADAPTERREMOVAL_PAIRED.out.collapsed ch_adapterremoval_for_cat = ADAPTERREMOVAL_PAIRED.out.collapsed
.mix( .mix(
ADAPTERREMOVAL_PAIRED.out.collapsed_truncated, ADAPTERREMOVAL_PAIRED.out.collapsed_truncated,
@ -35,16 +37,14 @@ workflow SHORTREAD_ADAPTERREMOVAL {
.map { .map {
meta, reads -> meta, reads ->
def meta_new = meta.clone() def meta_new = meta.clone()
meta_new['single_end'] = true meta_new.single_end = true
[ meta_new, reads ] [ meta_new, reads ]
} }
.groupTuple(by: 0) .groupTuple()
ch_adapterremoval_reads_prepped_pe = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads ch_adapterremoval_reads_prepped = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
ch_adapterremoval_reads_prepped = ch_adapterremoval_reads_prepped_pe.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
} else if ( params.shortread_clipmerge_mergepairs && params.shortread_clipmerge_excludeunmerged ) { } else if ( params.shortread_clipmerge_mergepairs && params.shortread_clipmerge_excludeunmerged ) {
ch_adapterremoval_for_cat = ADAPTERREMOVAL_PAIRED.out.collapsed ch_adapterremoval_for_cat = ADAPTERREMOVAL_PAIRED.out.collapsed
@ -58,9 +58,7 @@ workflow SHORTREAD_ADAPTERREMOVAL {
} }
.groupTuple(by: 0) .groupTuple(by: 0)
ch_adapterremoval_reads_prepped_pe = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads ch_adapterremoval_reads_prepped = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
ch_adapterremoval_reads_prepped = ch_adapterremoval_reads_prepped_pe.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
} else { } else {

View file

@ -21,8 +21,8 @@ workflow SHORTREAD_PREPROCESSING {
ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_FASTP.out.mqc ) ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_FASTP.out.mqc )
} else if ( params.shortread_clipmerge_tool == "adapterremoval" ) { } else if ( params.shortread_clipmerge_tool == "adapterremoval" ) {
ch_processed_reads = SHORTREAD_ADAPTERREMOVAL ( reads ).reads ch_processed_reads = SHORTREAD_ADAPTERREMOVAL ( reads ).reads
ch_versions = ch_versions.mix( SHORTREAD_ADAPTERREMOVAL.out.versions ) ch_versions = ch_versions.mix( SHORTREAD_ADAPTERREMOVAL.out.versions )
ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_ADAPTERREMOVAL.out.mqc ) ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_ADAPTERREMOVAL.out.mqc )
} else { } else {
ch_processed_reads = reads ch_processed_reads = reads
} }