Andrea Bagnacani
09/26/2025, 2:26 PMnf-core/samtools/merge to merge some BAM files.
The input channel that I provide to this process has meta fields id and sample_name.
The former is used by samtools merge to infer the file prefix for merging, while the latter is used in my pipeline to keep provenance info.
When I run my pipeline, this performs the merge as intended. However, when I run `nf-core/samtools/merge`'s stub test, meta.sample_name ends up being interpreted as the relative path to a docker mount point, and since Docker mount points must be absolute, the stub test is (in my case) bound to fail:
$ nf-test test tests/01.stub.nf.test --profile docker
...
Command exit status:
125
Command output:
(empty)
Command error:
docker: Error response from daemon: invalid volume specification: 'HG00666:HG00666': invalid mount config for type "volume": invalid mount path: 'HG00666' mount path must be absolute
Run 'docker run --help' for more information
From `.command.run`:
...
nxf_launch() {
docker run -i --cpu-shares 2048 --memory 12288m -e "NXF_TASK_WORKDIR" -e "NXF_DEBUG=${NXF_DEBUG:=0}" \
\
-v HG00666:HG00666 \ # <-- meta.sample_name becomes a mount point
\
-v /home/user1/src/nf-ont-vc/.nf-test/tests/5e6015530fd10b4314bec7ef1809a11/work/bb/8f8ce8297ea4c0263e765dcdffacc8:/home/user1/src/nf-ont-vc/.nf-test/tests/5e6015530fd10b4314bec7ef1809a11/work/bb/8f8ce8297ea4c0263e765dcdffacc8 -w "$NXF_TASK_WORKDIR" -u $(id -u):$(id -g) --name $NXF_BOXID quay.io/biocontainers/samtools:1.22.1--h96c455f_0 /bin/bash -c "eval $(nxf_container_env); /bin/bash /home/user1/src/nf-ont-vc/.nf-test/tests/5e6015530fd10b4314bec7ef1809a11/work/bb/8f8ce8297ea4c0263e765dcdffacc8/.command.run nxf_trace"
}
...
How do I make samtools merge ignore meta.sample_name when the docker cli is buit?Niklas Schandry
09/26/2025, 2:31 PM[[id: something, sample_name:something_else], filename] and not accidently [id:something, sample_name:something_else] ?Andrea Bagnacani
09/26/2025, 2:46 PMinclude { SAMTOOLS_MERGE as MERGE_BAM_FILES } from '../../../modules/nf-core/samtools/merge/main'
...
ch_merge_bam_files.view{ println "DEBUG: input to MERGE_BAM_FILES: $it" }
// Merge each sample's BAM file
MERGE_BAM_FILES (
ch_merge_bam_files,
[[], []],
[[], []],
[[], []]
)
And here's the view of the input channel:
DEBUG: input to MERGE_BAM_FILES: [[id:bam_runid_2ee680d0-3a05-4b1f-b2a3-aa43e510e297_0, sample_name:HG00666], [/home/user1/src/nf-ont-vc/tests/inputs/HG00666/bam_runid_2ee680d0-3a05-4b1f-b2a3-aa43e510e297_0_1.bam, /home/user1/src/nf-ont-vc/tests/inputs/HG00666/bam_runid_2ee680d0-3a05-4b1f-b2a3-aa43e510e297_0_0.bam]]Mahesh Binzer-Panchal
09/29/2025, 7:44 AMprocess.containerOptions or docker.runOptions anywhere in your config?Andrea Bagnacani
09/29/2025, 7:49 AMnextflow.config has the following block:
docker {
docker.enabled = true
conda.enabled = false
singularity.enabled = false
podman.enabled = false
shifter.enabled = false
charliecloud.enabled = false
apptainer.enabled = false
docker.runOptions = '-u $(id -u):$(id -g)'
}Mahesh Binzer-Panchal
09/29/2025, 7:57 AMmeta for container settings? If that's the case, you should report this as a bug.
There's no institutional profile or anything that specifically sets something for SAMTOOLS_MERGE?Mahesh Binzer-Panchal
09/29/2025, 8:02 AM\ for formatting, or is that in the script?Mahesh Binzer-Panchal
09/29/2025, 8:11 AMSimon Pearce
09/29/2025, 8:30 AMsample_name to anything else (foo), does it still happen? i.e. is it something unique to sample_nameRolf Schröder
09/29/2025, 9:04 AMMahesh Binzer-Panchal
09/29/2025, 9:20 AMmeta map, but how you're supplying the files then. I just noticed that inputs are also in a folder named HG00666Andrea Bagnacani
10/01/2025, 7:31 AMgit stash pop issued from the terminal's history? I really can't tell).
That meant that I was writing tests before even having a working pipeline. Once fixed, I could not reproduce the error anymore.
The stub test for nf-core/samtools/merge works as intended.