mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-22 04:19:54 +00:00
Apply suggestions from code review
Co-authored-by: Moritz E. Beber <midnighter@posteo.net>
This commit is contained in:
parent
0d0b377dfb
commit
14f2b7bd84
2 changed files with 10 additions and 12 deletions
|
@ -17,14 +17,16 @@ workflow SHORTREAD_ADAPTERREMOVAL {
|
|||
|
||||
ch_input_for_adapterremoval = reads
|
||||
.branch{
|
||||
single: it[0]['single_end'] == true
|
||||
paired: it[0]['single_end'] == false
|
||||
single: it[0].single_end
|
||||
paired: !it[0].single_end
|
||||
}
|
||||
|
||||
ADAPTERREMOVAL_SINGLE ( ch_input_for_adapterremoval.single, [] )
|
||||
ADAPTERREMOVAL_PAIRED ( ch_input_for_adapterremoval.paired, [] )
|
||||
|
||||
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
|
||||
.mix(
|
||||
ADAPTERREMOVAL_PAIRED.out.collapsed_truncated,
|
||||
|
@ -35,16 +37,14 @@ workflow SHORTREAD_ADAPTERREMOVAL {
|
|||
.map {
|
||||
meta, reads ->
|
||||
def meta_new = meta.clone()
|
||||
meta_new['single_end'] = true
|
||||
meta_new.single_end = true
|
||||
|
||||
[ meta_new, reads ]
|
||||
}
|
||||
.groupTuple(by: 0)
|
||||
.groupTuple()
|
||||
|
||||
|
||||
ch_adapterremoval_reads_prepped_pe = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads
|
||||
|
||||
ch_adapterremoval_reads_prepped = ch_adapterremoval_reads_prepped_pe.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
|
||||
ch_adapterremoval_reads_prepped = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
|
||||
|
||||
} else if ( params.shortread_clipmerge_mergepairs && params.shortread_clipmerge_excludeunmerged ) {
|
||||
ch_adapterremoval_for_cat = ADAPTERREMOVAL_PAIRED.out.collapsed
|
||||
|
@ -58,9 +58,7 @@ workflow SHORTREAD_ADAPTERREMOVAL {
|
|||
}
|
||||
.groupTuple(by: 0)
|
||||
|
||||
ch_adapterremoval_reads_prepped_pe = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads
|
||||
|
||||
ch_adapterremoval_reads_prepped = ch_adapterremoval_reads_prepped_pe.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
|
||||
ch_adapterremoval_reads_prepped = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ workflow SHORTREAD_PREPROCESSING {
|
|||
ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_FASTP.out.mqc )
|
||||
} else if ( params.shortread_clipmerge_tool == "adapterremoval" ) {
|
||||
ch_processed_reads = SHORTREAD_ADAPTERREMOVAL ( reads ).reads
|
||||
ch_versions = ch_versions.mix( SHORTREAD_ADAPTERREMOVAL.out.versions )
|
||||
ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_ADAPTERREMOVAL.out.mqc )
|
||||
ch_versions = ch_versions.mix( SHORTREAD_ADAPTERREMOVAL.out.versions )
|
||||
ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_ADAPTERREMOVAL.out.mqc )
|
||||
} else {
|
||||
ch_processed_reads = reads
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue