mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-22 08:09:54 +00:00
Add nanopore channel
This commit is contained in:
parent
0f0ed6cd46
commit
41b3d8db82
1 changed files with 17 additions and 4 deletions
|
@ -20,10 +20,15 @@ workflow INPUT_CHECK {
|
|||
}
|
||||
|
||||
parsed_samplesheet.fastq
|
||||
.map { create_fastq_channels(it) }
|
||||
.map { create_fastq_channel(it) }
|
||||
.dump(tag: "fastq_channel_init")
|
||||
.set { fastq }
|
||||
|
||||
parsed_samplesheet.nanopore
|
||||
.map { create_fastq_channel(it) }
|
||||
.dump(tag: "fastq_nanopore_channel_init")
|
||||
.set { nanopore }
|
||||
|
||||
parsed_samplesheet.fasta
|
||||
.map { create_fasta_channels(it) }
|
||||
.dump(tag: "fasta_channel_init")
|
||||
|
@ -31,6 +36,7 @@ workflow INPUT_CHECK {
|
|||
|
||||
emit:
|
||||
fastq // channel: [ val(meta), [ reads ] ]
|
||||
nanopore // channel: [ val(meta), [ reads ] ]
|
||||
fasta // channel: [ val(meta), fasta ]
|
||||
versions = SAMPLESHEET_CHECK.out.versions // channel: [ versions.yml ]
|
||||
}
|
||||
|
@ -52,10 +58,17 @@ def create_fastq_channel(LinkedHashMap row) {
|
|||
if (meta.single_end) {
|
||||
fastq_meta = [ meta, [ file(row.fastq_1) ] ]
|
||||
} else {
|
||||
if (!file(row.fastq_2).exists()) {
|
||||
exit 1, "ERROR: Please check input samplesheet -> Read 2 FastQ file does not exist!\n${row.fastq_2}"
|
||||
if (meta.instrument_platform == 'OXFORD_NANOPORE') {
|
||||
if (row.fastq_2 != '') {
|
||||
exit 1, "ERROR: Please check input samplesheet -> For Oxford Nanopore reads Read 2 FastQ should be empty!\n${row.fastq_2}"
|
||||
}
|
||||
fastq_meta = [ meta, [ file(row.fastq_1) ] ]
|
||||
} else {
|
||||
if (!file(row.fastq_2).exists()) {
|
||||
exit 1, "ERROR: Please check input samplesheet -> Read 2 FastQ file does not exist!\n${row.fastq_2}"
|
||||
}
|
||||
fastq_meta = [ meta, [ file(row.fastq_1), file(row.fastq_2) ] ]
|
||||
}
|
||||
fastq_meta = [ meta, [ file(row.fastq_1), file(row.fastq_2) ] ]
|
||||
}
|
||||
return fastq_meta
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue