Anders Sune Pedersen
07/20/2026, 8:14 AMtouch: cannot touch 'dbsnp_146.hg38.vcf.gz.tbi': Permission denied
from MUSE_SUMP, because of this touch-command. The file dbsnp_146.hg38.vcf.gz.tbi is read-only on our system, and that is how we would like to keep it.Rike Hanssen
07/20/2026, 8:21 AMRike Hanssen
07/20/2026, 8:21 AMAnders Sune Pedersen
07/20/2026, 8:23 AM.command.run I see
ln -s /ngc/shared/nf_tools/.references-transactions/approved_source/references/igenomes/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/dbsnp_146.hg38.vcf.gz.tbi dbsnp_146.hg38.vcf.gz.tbi
and
/ngc/shared/nf_tools/.references-transactions/approved_source/references/igenomes/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/dbsnp_146.hg38.vcf.gz.tbi
is read-only on our system.Anders Sune Pedersen
07/20/2026, 8:26 AMAnders Sune Pedersen
07/20/2026, 8:27 AMdbsnp_146.hg38.vcf.gz.tbi in the .command.log or .command.outRike Hanssen
07/20/2026, 8:28 AMAnders Sune Pedersen
07/20/2026, 8:29 AMAnders Sune Pedersen
07/20/2026, 8:37 AMFamke Bäuerle
07/20/2026, 10:05 AMFamke Bäuerle
07/20/2026, 10:06 AMThomas Danhorn
07/21/2026, 2:18 AM*.tbi) is always newer than the base file (VCF in this case, or CRAM/BAM, FASTA, or whatever), since it is derived from the latter. The problem on (some) clusters is that each node has its own clock, and they are not always perfectly in sync, and if the index is made by a node whose clock is a bit slow[er] (or the base file by one that is fast[er]), then it looks like the index is older, even if it isn't.
Using touch on the index file ensures that it's "new" (unless the node's clock is way behind). The problem with that is obviously read-only files. (Note: If you are the owner, you can still successfully touch a file with r--r--r-- permissions. It's only if the file is not writable to you and owned by someone else [e.g. root] that you have this problem.) I see two potential solutions to this:
• touch the index file always, but prevent it from exiting with an error ( || true might do the trick, or temporarily set +e (i.e. don't kill the script on error). The potential problem would be a failure to touch an older read-only index, and the crash would be delayed.
• Check if the index is older than the base file, and only if so, use touch. This can still fail on read-only files, but only if the index is older, which it should not be (when you protect your files, check [and if necessary fix] the date first). For the comparison you can use something like [ "$tbi" -ot "$vcf" ] in bash. I find this more elegant (and it would fail earlier if it does).Rike Hanssen
07/21/2026, 6:29 AMFamke Bäuerle
07/21/2026, 7:32 AMRike Hanssen
07/21/2026, 7:37 AMFamke Bäuerle
07/21/2026, 8:24 AMThomas Danhorn
07/21/2026, 9:20 PM[ "${ref_vcf_tbi}" -ot "${ref_vcf}" ] && touch *-r "${ref_vcf}"* "${ref_vcf_tbi}"
This makes the index the same time as the VCF, not the current time. This makes more sense if the current time is weeks/months/years after the VCF's modification time, and it avoids the problem with a clock that is waaay slow (which could result in the VCF's time being in the future and the "current" time still being too old).Thomas Danhorn
07/21/2026, 9:23 PM