I made some amends. I am still skeptical as to what changed but the following code works now. I think fastqc directory was getting overwrite again and again.
nextflow.enable.dsl=2
params.raw = "data/*{1,2}.fastq.gz"
params.outdir="results/01_rawfastqc"
process FASTQC {
publishDir "$params.outdir"
input:
tuple val(sample_id), path(reads)
output:
file("*.{html,zip}")
script:
"""
fastqc -t 10 ${reads[0]} ${reads[1]}
"""
}
reads_ch = Channel.fromFilePairs(params.raw, checkIfExists: true )
workflow {
FASTQC(reads_ch)
}