So I have this in my workflow
// Merge paired end reads using Fastp
Merge( DownloadFromS3.out.download_to_merge_ch )
//Merge.out.merged.view()
MakeCounts(
Merge.out.merged,
Channel.fromPath(file('barcodes.csv')),
Channel.fromPath(file('spacers.csv')) ,
Channel.fromPath(file("PAMDA.yaml"))
)
When I view the output of the Merge process, I have 5 output files (within a tuple - just like I expected) from
process Merge {
publishDir 'output/fastp', mode: 'copy'
container 'quay.io/biocontainers/fastp:0.23.3--h5f740d0_0'
cpus 8
input:
tuple val(study), val(sample), val(dir), path(fq1), path(fq2), val(timepoint)
output:
tuple val(study), val(sample), val(dir), path("${sample}.fastq.gz"), val(timepoint), emit: merged
path("*_unpaired1.fastq") , emit: unpaired1
path("*_unpaired2.fastq") , emit: unpaired2
path("*_failed.fastq") , emit: failed
path("*.json") , emit: json_report
path("*.html") , emit: fastp_html
script:
"""
fastp \
-i ${fq1} \
-I ${fq2} \
--merge \
--merged_out="${sample}.fastq.gz" \
--unpaired1="${sample}_unpaired1.fastq" \
--unpaired2="${sample}_unpaired2.fastq" \
--failed_out="${sample}_failed.fastq" \
--json="${sample}.json" \
--html="${sample}.html" \
--report_title="Fastp Report for ${sample}" \
--thread=8
"""
}
But when I run MakeCounts - only one of the tuples makes it through.
here is MakeCounts
process MakeCounts {
publishDir 'output', mode: 'copy'
container '668591248114.dkr.ecr.us-east-1.amazonaws.com/pamda:1.0'
cpus 8
input:
tuple val(study), val(sample), val(dir), path(merged_fastq), val(timepoint)
path(barcode_file)
path(spacer_file)
path(yaml_file)
output:
tuple val(sample), val(timepoint), path("${sample}_counts.csv"), emit: counts
script:
"""
python /usr/src/app/make_counts.py \
--merged_fastq ${merged_fastq} \
--yaml_file ${yaml_file} \
--barcode_file ${barcode_file} \
--spacer_file ${spacer_file} \
--sample ${sample} \
--timepoint ${timepoint}
"""
}
Its weird that I get the next one of the five when I run the pipeline again with -resume.
Not sure what to do - maybe add collect() to Merge.out.merged?