I added .view() in each channel and ran the script one by one
workflow {
Channel
.fromPath('Analysis/centrifuge/*_cenout.tsv', checkIfExists: true)
.map { file -> tuple(file.baseName.split('_')[0], file) }
.set { cenout_ch }
cenout_ch.view()
Channel
.fromPath('Analysis/outfq/*.fastq.gz', checkIfExists: true)
.map { file -> tuple(file.baseName.split('_')[0], file) }
.set { filteredfq_ch }
//filteredfq_ch.view()
//cenout_ch
//.join(filteredfq_ch)
//.map { tuple1, tuple2 -> tuple(tuple1[0], tuple1[1], tuple2[1]) }
//.set { matched_files }
//matched_files.view()
//Unclassified_check(matched_files)
}
The first cenout_ch returned correctly
[barcode15, /tmp/Run/Analysis/centrifuge/barcode15_reads_without_host_cenout.tsv]
[barcode01, /tmp/Run/Analysis/centrifuge/barcode01_reads_without_host_cenout.tsv]
[barcode09, /tmp/Run/Analysis/centrifuge/barcode09_reads_without_host_cenout.tsv]
[barcode06, /tmp/Run/Analysis/centrifuge/barcode06_reads_without_host_cenout.tsv]
[barcode03, /tmp/Run/Analysis/centrifuge/barcode03_reads_without_host_cenout.tsv]
[barcode05, /tmp/Run/Analysis/centrifuge/barcode05_reads_without_host_cenout.tsv]
[barcode02, /tmp/Run/Analysis/centrifuge/barcode02_reads_without_host_cenout.tsv]
[barcode12, /tmp/Run/Analysis/centrifuge/barcode12_reads_without_host_cenout.tsv]
[barcode14, /tmp/Run/Analysis/centrifuge/barcode14_reads_without_host_cenout.tsv]
[barcode08, /tmp/Run/Analysis/centrifuge/barcode08_reads_without_host_cenout.tsv]
[barcode10, /tmp/Run/Analysis/centrifuge/barcode10_reads_without_host_cenout.tsv]
[barcode13, /tmp/Run/Analysis/centrifuge/barcode13_reads_without_host_cenout.tsv]
[barcode07, /tmp/Run/Analysis/centrifuge/barcode07_reads_without_host_cenout.tsv]
[barcode11, /tmp/Run/Analysis/centrifuge/barcode11_reads_without_host_cenout.tsv]
[barcode04, /tmp/Run/Analysis/centrifuge/barcode04_reads_without_host_cenout.tsv]
The filteredfq_ch returned correctly as well:
[barcode02, /tmp/Run/Analysis/outfq/barcode02_reads_without_host.fastq.gz]
[barcode04, /tmp/Run/Analysis/outfq/barcode04_reads_without_host.fastq.gz]
[barcode09, /tmp/Run/Analysis/outfq/barcode09_reads_without_host.fastq.gz]
[barcode11, /tmp/Run/Analysis/outfq/barcode11_reads_without_host.fastq.gz]
[barcode10, /tmp/Run/Analysis/outfq/barcode10_reads_without_host.fastq.gz]
[barcode13, /tmp/Run/Analysis/outfq/barcode13_reads_without_host.fastq.gz]
[barcode07, /tmp/Run/Analysis/outfq/barcode07_reads_without_host.fastq.gz]
[barcode15, /tmp/Run/Analysis/outfq/barcode15_reads_without_host.fastq.gz]
[barcode08, /tmp/Run/Analysis/outfq/barcode08_reads_without_host.fastq.gz]
[barcode14, /tmp/Run/Analysis/outfq/barcode14_reads_without_host.fastq.gz]
[barcode12, /tmp/Run/Analysis/outfq/barcode12_reads_without_host.fastq.gz]
[barcode03, /tmp/Run/Analysis/outfq/barcode03_reads_without_host.fastq.gz]
[barcode06, /tmp/Run/Analysis/outfq/barcode06_reads_without_host.fastq.gz]
[barcode05, /tmp/Run/Analysis/outfq/barcode05_reads_without_host.fastq.gz]
[barcode01, /tmp/Run/Analysis/outfq/barcode01_reads_without_host.fastq.gz]
Moving on to the join channel, the same error message showed again, so I marked the .map{} and it worked
workflow {
Channel
.fromPath('Analysis/centrifuge/*_cenout.tsv', checkIfExists: true)
.map { file -> tuple(file.baseName.split('_')[0], file) }
.set { cenout_ch }
//cenout_ch.view()
Channel
.fromPath('Analysis/outfq/*.fastq.gz', checkIfExists: true)
.map { file -> tuple(file.baseName.split('_')[0], file) }
.set { filteredfq_ch }
//filteredfq_ch.view()
cenout_ch
.join(filteredfq_ch)
//.map { tuple1, tuple2 -> tuple(tuple1[0], tuple1[1], tuple2[1]) }
.set { matched_files }
matched_files.view()
//Unclassified_check(matched_files)
}
[barcode09, /tmp/Run/Analysis/centrifuge/barcode09_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode09_reads_without_host.fastq.gz]
[barcode02, /tmp/Run/Analysis/centrifuge/barcode02_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode02_reads_without_host.fastq.gz]
[barcode15, /tmp/Run/Analysis/centrifuge/barcode15_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode15_reads_without_host.fastq.gz]
[barcode08, /tmp/Run/Analysis/centrifuge/barcode08_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode08_reads_without_host.fastq.gz]
[barcode10, /tmp/Run/Analysis/centrifuge/barcode10_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode10_reads_without_host.fastq.gz]
[barcode14, /tmp/Run/Analysis/centrifuge/barcode14_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode14_reads_without_host.fastq.gz]
[barcode13, /tmp/Run/Analysis/centrifuge/barcode13_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode13_reads_without_host.fastq.gz]
[barcode12, /tmp/Run/Analysis/centrifuge/barcode12_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode12_reads_without_host.fastq.gz]
[barcode07, /tmp/Run/Analysis/centrifuge/barcode07_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode07_reads_without_host.fastq.gz]
[barcode03, /tmp/Run/Analysis/centrifuge/barcode03_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode03_reads_without_host.fastq.gz]
[barcode11, /tmp/Run/Analysis/centrifuge/barcode11_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode11_reads_without_host.fastq.gz]
[barcode06, /tmp/Run/Analysis/centrifuge/barcode06_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode06_reads_without_host.fastq.gz]
[barcode04, /tmp/Run/Analysis/centrifuge/barcode04_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode04_reads_without_host.fastq.gz]
[barcode05, /tmp/Run/Analysis/centrifuge/barcode05_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode05_reads_without_host.fastq.gz]
[barcode01, /tmp/Run/Analysis/centrifuge/barcode01_reads_without_host_cenout.tsv, /tmp/Run/Analysis/outfq/barcode01_reads_without_host.fastq.gz]
So the question is what went wrong with .map{} and how can I make sure that the 1st path of the joined tuple is from cenout_ch and the 2nd path is from the filteredfq_ch?