mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-25 08:49:54 +00:00
refactor: remove superfluous ENSURE_FASTQ_EXTENSION
This commit is contained in:
parent
c54c32c494
commit
0e9b2989e3
1 changed files with 16 additions and 59 deletions
|
@ -5,11 +5,6 @@ Process short raw reads with AdapterRemoval
|
||||||
include { ADAPTERREMOVAL as ADAPTERREMOVAL_SINGLE } from '../../modules/nf-core/modules/adapterremoval/main'
|
include { ADAPTERREMOVAL as ADAPTERREMOVAL_SINGLE } from '../../modules/nf-core/modules/adapterremoval/main'
|
||||||
include { ADAPTERREMOVAL as ADAPTERREMOVAL_PAIRED } from '../../modules/nf-core/modules/adapterremoval/main'
|
include { ADAPTERREMOVAL as ADAPTERREMOVAL_PAIRED } from '../../modules/nf-core/modules/adapterremoval/main'
|
||||||
include { CAT_FASTQ } from '../../modules/nf-core/modules/cat/fastq/main'
|
include { CAT_FASTQ } from '../../modules/nf-core/modules/cat/fastq/main'
|
||||||
include {
|
|
||||||
ENSURE_FASTQ_EXTENSION as ENSURE_FASTQ_EXTENSION1;
|
|
||||||
ENSURE_FASTQ_EXTENSION as ENSURE_FASTQ_EXTENSION2;
|
|
||||||
ENSURE_FASTQ_EXTENSION as ENSURE_FASTQ_EXTENSION3;
|
|
||||||
} from '../../modules/local/ensure_fastq_extension'
|
|
||||||
|
|
||||||
workflow SHORTREAD_ADAPTERREMOVAL {
|
workflow SHORTREAD_ADAPTERREMOVAL {
|
||||||
|
|
||||||
|
@ -36,34 +31,25 @@ workflow SHORTREAD_ADAPTERREMOVAL {
|
||||||
|
|
||||||
if ( params.shortread_clipmerge_mergepairs && !params.shortread_clipmerge_excludeunmerged ) {
|
if ( params.shortread_clipmerge_mergepairs && !params.shortread_clipmerge_excludeunmerged ) {
|
||||||
|
|
||||||
ENSURE_FASTQ_EXTENSION1(
|
ch_concat_fastq = Channel.empty()
|
||||||
Channel.empty().mix(
|
.mix(
|
||||||
ADAPTERREMOVAL_PAIRED.out.collapsed,
|
ADAPTERREMOVAL_PAIRED.out.collapsed,
|
||||||
ADAPTERREMOVAL_PAIRED.out.collapsed_truncated,
|
ADAPTERREMOVAL_PAIRED.out.collapsed_truncated,
|
||||||
ADAPTERREMOVAL_PAIRED.out.singles_truncated,
|
ADAPTERREMOVAL_PAIRED.out.singles_truncated,
|
||||||
ADAPTERREMOVAL_PAIRED.out.pair1_truncated,
|
ADAPTERREMOVAL_PAIRED.out.paired_truncated
|
||||||
ADAPTERREMOVAL_PAIRED.out.pair2_truncated
|
|
||||||
)
|
)
|
||||||
.map { meta, reads ->
|
.groupTuple()
|
||||||
meta.single_end = true
|
.map { [it.head(), it.tail().flatten()] }
|
||||||
[meta, reads]
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
CAT_FASTQ(
|
CAT_FASTQ(ch_concat_fastq)
|
||||||
ENSURE_FASTQ_EXTENSION1.out.reads
|
|
||||||
.groupTuple()
|
|
||||||
)
|
|
||||||
|
|
||||||
ENSURE_FASTQ_EXTENSION2(ADAPTERREMOVAL_SINGLE.out.singles_truncated)
|
|
||||||
|
|
||||||
ch_adapterremoval_reads_prepped = CAT_FASTQ.out.reads
|
ch_adapterremoval_reads_prepped = CAT_FASTQ.out.reads
|
||||||
.mix(ENSURE_FASTQ_EXTENSION2.out.reads)
|
.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 ) {
|
||||||
|
|
||||||
ENSURE_FASTQ_EXTENSION1(
|
ch_concat_fastq = Channel.empty()
|
||||||
Channel.empty().mix(
|
.mix(
|
||||||
ADAPTERREMOVAL_PAIRED.out.collapsed,
|
ADAPTERREMOVAL_PAIRED.out.collapsed,
|
||||||
ADAPTERREMOVAL_PAIRED.out.collapsed_truncated
|
ADAPTERREMOVAL_PAIRED.out.collapsed_truncated
|
||||||
)
|
)
|
||||||
|
@ -71,54 +57,25 @@ workflow SHORTREAD_ADAPTERREMOVAL {
|
||||||
meta.single_end = true
|
meta.single_end = true
|
||||||
[meta, reads]
|
[meta, reads]
|
||||||
}
|
}
|
||||||
)
|
.groupTuple()
|
||||||
|
|
||||||
CAT_FASTQ(
|
CAT_FASTQ(ch_concat_fastq)
|
||||||
ENSURE_FASTQ_EXTENSION1.out.reads
|
|
||||||
.groupTuple()
|
|
||||||
)
|
|
||||||
|
|
||||||
ENSURE_FASTQ_EXTENSION2(ADAPTERREMOVAL_SINGLE.out.singles_truncated)
|
|
||||||
|
|
||||||
ch_adapterremoval_reads_prepped = CAT_FASTQ.out.reads
|
ch_adapterremoval_reads_prepped = CAT_FASTQ.out.reads
|
||||||
.mix(ENSURE_FASTQ_EXTENSION2.out.reads)
|
.mix(ADAPTERREMOVAL_SINGLE.out.singles_truncated)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
ENSURE_FASTQ_EXTENSION1(
|
ch_adapterremoval_reads_prepped = ADAPTERREMOVAL_PAIRED.out.paired_truncated
|
||||||
ADAPTERREMOVAL_PAIRED.out.pair1_truncated
|
.mix(ADAPTERREMOVAL_SINGLE.out.singles_truncated)
|
||||||
.map { meta, reads ->
|
|
||||||
meta.single_end = true
|
|
||||||
[meta, reads]
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
ENSURE_FASTQ_EXTENSION2(
|
|
||||||
ADAPTERREMOVAL_PAIRED.out.pair2_truncated
|
|
||||||
.map { meta, reads ->
|
|
||||||
meta.single_end = true
|
|
||||||
[meta, reads]
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
ENSURE_FASTQ_EXTENSION3(ADAPTERREMOVAL_SINGLE.out.singles_truncated)
|
|
||||||
|
|
||||||
ch_adapterremoval_reads_prepped = ENSURE_FASTQ_EXTENSION1.out.reads
|
|
||||||
.join(ENSURE_FASTQ_EXTENSION2.out.reads)
|
|
||||||
.groupTuple()
|
|
||||||
.map { meta, pair1, pair2 ->
|
|
||||||
meta.single_end = false
|
|
||||||
[ meta, [ pair1, pair2 ].flatten() ]
|
|
||||||
}
|
|
||||||
.mix(ENSURE_FASTQ_EXTENSION3.out.reads)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ch_versions = ch_versions.mix( ADAPTERREMOVAL_SINGLE.out.versions.first() )
|
ch_versions = ch_versions.mix( ADAPTERREMOVAL_SINGLE.out.versions.first() )
|
||||||
ch_versions = ch_versions.mix( ADAPTERREMOVAL_PAIRED.out.versions.first() )
|
ch_versions = ch_versions.mix( ADAPTERREMOVAL_PAIRED.out.versions.first() )
|
||||||
ch_multiqc_files = ch_multiqc_files.mix(
|
ch_multiqc_files = ch_multiqc_files.mix(
|
||||||
ADAPTERREMOVAL_PAIRED.out.log.collect{it[1]},
|
ADAPTERREMOVAL_PAIRED.out.settings.collect{it[1]},
|
||||||
ADAPTERREMOVAL_SINGLE.out.log.collect{it[1]}
|
ADAPTERREMOVAL_SINGLE.out.settings.collect{it[1]}
|
||||||
)
|
)
|
||||||
|
|
||||||
emit:
|
emit:
|
||||||
|
|
Loading…
Reference in a new issue