I'm late to the template update party, but if anyo...
# pipeline-maintainers
z
I'm late to the template update party, but if anyone else encounters nf-test snapshot problems with BAM/SAM files: BAM/SAM files may include the staged file path of the reference in the sequence dictionary header entry,
UR
, which is not stable across different runs. I solved this by adding
**/*.{bam,bai}
to my
.nftignore
file.
j
That seems like hiding the symptom rather than curing the disease… 😅 You could look into the nft-bam plug-in for nf-test which has some nice utilities for this situation. For example you can snapshot a hash of just the reads using
bam(…).getReadsMD5()
which will ignore all the headers. If you think it’s worth the effort you could also snapshot the output of
getHeader()
with the problematic headers filtered out. https://nvnieuwk.github.io/nft-bam/latest/usage/#bam-sam-cram-function
💯 2
z
Still exploring the world of nf-test plugins, good recommendation! I also found another potential solution. Update the test config to have
Copy code
withName: SAMTOOLS_DICT {
        ext.args = "--uri constant.uri.fa"
    }
s
Agreed with Jeremy, the nft-bam plugin is the easiest way to deal with this. This is the template that some pipelines use: https://github.com/nf-core/methylseq/blob/master/tests/default.nf.test and Maxime has recently condensed a lot in sarek: https://github.com/nf-core/sarek/blob/dev/tests/default.nf.test via making a utility function: https://github.com/nf-core/sarek/blob/dev/tests/lib/UTILS.groovy
🚀 1