Is there a situation in which the ref is actually ...
# modules
s
Is there a situation in which the ref is actually required for samtools coverage? https://github.com/nf-core/modules/blob/master/modules/nf-core/samtools/coverage/main.nf As far as I can tell this samtools command never makes use of the ref argument
✅ 1
m
Cram input?
s
Surely cram stores all the necessary info about the ref for coverage, all it needs is ref name, length, and alignment positions
but that could be it I guess
reference isn't even listed as an arg here: https://www.htslib.org/doc/samtools-coverage.html
so I'm convinced it's vestigial
m
the
--reference
arg is common for all samtools subtools
s
it is, but that doesn't mean it actually does anything within this context
m
That’s true. In this case I’d say test it and report back, then we can ditch the output if needed. Or just ignore it 🤷🏻
SAMTOOLS_COVERAGE(input, [[:],[]],[[:],[]])
s
Yeah I was going to do a PR but wanted to check I wasn't missing anything obvious
it actually breaks if you don't provide it in this case 🙂
since
--reference
isn't determined with a ternary
like
Copy code
reference = fastq ? "--reference ${fasta}" : ""
m
s
it happens, easily done
oh ffs you are right, samtools does need it for cram
m
I knew it! 😄
s
I have no idea WHY it's needed, surely all the necessary info is there
but whatever, far be it from me to question heng
m
Otherwise I would’ve made it optional. Past me wasn’t an idiot 🎉
s
I still think it should be a ternary though
so that BAM users don't have to provide it
m
Ah, yes, you are right. Perhaps also include a check so it fails if the input is cram and no ref is provided
👍 1
s
m
Nice testing too!
👍 1
s
cheers, thanks for the fast review