workflow fqcheck {
take:
path reads
Channel.fromPath(reads)
.map {file ->
def idx = ${file}.getName().replaceAll("\\D","")
"fqcheck33 -r ${file} -c ${file%.fq.gz}.${idx}.fqcheck"
}
publishDir params.outdir
}
workflow {
fqcheck(ch_fq)
}
ch_fq should be a couple of fastqs. like sample.clean_1.fq.gz and sample.clean_2.fq.gz I got nothing informative but " cause: Unexpected input: '{'"
The code you have provided doesn't look quite right. For one thing, the publishDir
directive is something that you would apply to a process. I think you're looking for something like:
params.reads = './path/to/reads/*.clean_{1,2}.fq.gz'
params.outdir = './results'
process fqcheck33 {
tag { sample }
publishDir "${params.outdir}/fqcheck", mode: 'copy'
input:
tuple val(sample), path(fastq)
output:
tuple val(sample), path("${fastq.getBaseName(2)}.fqcheck")
"""
fqcheck33 \\
-r "${fastq}" \\
-c "${fastq.getBaseName(2)}.fqcheck"
"""
}
workflow {
reads = Channel.fromFilePairs( params.reads )
fqcheck33( reads.transpose() )
}
The above just uses the transpose
operator to send each FASTQ file in the pair to the fqcheck33
process, which expects a tuple where the first element is the sample name and the second is the FASTQ file.