Skip to content

Commit

Permalink
removed input check and adapted new naming schema of the input
Browse files Browse the repository at this point in the history
  • Loading branch information
jannikseidelQBiC committed Mar 19, 2024
1 parent 8f1bf1f commit 0eff5e6
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions workflows/detaxizer.nf
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,25 @@ workflow DETAXIZER {
ch_versions = Channel.empty()
ch_multiqc_files = Channel.empty()

// check whether the sample sheet is correctly formated
ch_samplesheet.map {
meta, fastq_1, fastq_2, fastq_3 ->
if (!fastq_1 && !fastq_3){
error("Please provide at least one single end file as input in the sample sheet for ${meta.id}.")
} else if (!fastq_1 && fastq_2 && fastq_3){
error("Please provide single end reads in following format in the sample sheet: base name, fastq_1,,fastq_3. fastq_1 is the short read file, fastq_3 the long read file. The wrongly formated entry is ${meta.id}.")
}
}

ch_samplesheet.branch {
shortReads: it[1]
}.set {
ch_short
}

ch_short.shortReads.map{
meta, fastq_1, fastq_2, fastq_3 ->
if (fastq_2){
meta, short_reads_fastq_1, short_reads_fastq_2, long_reads_fastq_1 ->
if (short_reads_fastq_2){
def newMeta = meta.clone()
newMeta.single_end = false
newMeta.long_reads = false
return [newMeta, [fastq_1, fastq_2]]
return [newMeta, [short_reads_fastq_1, short_reads_fastq_2]]
} else {
def newMeta = meta.clone()
newMeta.id = "${newMeta.id}_R1"
newMeta.single_end = true
newMeta.long_reads = false
return [newMeta, fastq_1]
return [newMeta, short_reads_fastq_1]
}
}.set{
ch_short
Expand All @@ -97,12 +87,12 @@ workflow DETAXIZER {
}

ch_long.longReads.map {
meta, fastq_1, fastq_2, fastq_3 ->
meta, short_reads_fastq_1, short_reads_fastq_2, long_reads_fastq_1 ->
def newMeta = meta.clone()
newMeta.id = "${newMeta.id}_longReads"
newMeta.single_end = true
newMeta.long_reads = true
return [newMeta, fastq_3]
return [newMeta, long_reads_fastq_1]
}.set {
ch_long
}
Expand Down

0 comments on commit 0eff5e6

Please sign in to comment.