I spent some time yesterday trying to reproduce an...
# sarek_dev
f
I spent some time yesterday trying to reproduce an error that was reported and described it here: https://github.com/nf-core/sarek/issues/2064#issuecomment-3922806635 - maybe someone has an idea directly what could cause this. Otherwise I will just keep looking 🙂
a
Don't have any major insights without more digging, but I can tell you the
ls
is a red-herring. It happens anytime there is optional outputs that don't exist - honestly nextflow should probably look at suppressing that error as it is definitely misleading at times
👍 2
this 1
s
Grrr at the use of optional channels for bam and cram separately shakefist
f
Do you think I should change the module and then adapt accordingly?
Copy code
output:
    tuple val(meta), path("${prefix}.bam"), emit: bam, optional: true
    tuple val(meta), path("${prefix}*bai"), emit: bai, optional: true
    tuple val(meta), path("${prefix}.cram"), emit: cram, optional: true
    tuple val("${task.process}"), val('gatk4'), eval("gatk --version | sed -n '/GATK.*v/s/.*v//p'"), topic: versions, emit: versions_gatk4
also this is the output of the module - why has it a bai but no crai then?
Copy code
if [[ ${suffix} == cram ]]; then
        touch ${prefix}.cram.bai
shakefist
s
yeah, it for some reason only makes bai indexes 🤷
I don't think it'll solve the issue here, I just think we should put sam/bam/cram into one channel (and the index)
f
I think I found the culprit: because if we set save output as bam then its saved as bam and thus not emitted through the cram channel which is what we collect
but not 100% sure
s
that is possible
and solved if you just make the module emit the two things together
I really don't think it is a good idea to split them out
like the bai/csi separation
which means that sarek doesn't work for large genomes
👍 2
a
And this is why reliance on filenames/suffixes is bad (but inevitably easiest and most common method)
Did you solve this? Because I tried tracing through the code, I’m still not entirely clear which
.join
is the culprit but this one seems like a possible culprit? I don’t know Sarek that well, but you don’t use the outputs of
FASTQ_PREPROCESS_GATK
if someone passes
save_to_bam
? (Well you mix the channel but AFAICT it would be empty)
f
No I gave up at some point. I think its related to that.