I am trying to run a Nextflow workflow offline using two different Apptainer containers that are already downloaded and stored in my home directory.
The workflow is intended to use:
- One container exclusively for the Manta module/process.
- A second container for all other tools in the workflow.
I am encountering two issues:
-
Container path not recognized globally
When I specify the container directly in the process configuration, for example:
container = "${System.getenv('HOME')}/sv_caller_new.sif"Nextflow does not appear to recognize the container path. However, if I place the same container specification inside a
withName:block, Nextflow correctly finds and uses the container.Is there a reason why the container path is only being recognized when defined under
withName:and not when specified more generally? -
Process-specific container assignment not working
I would like the Manta process/module to use its dedicated container, while all other processes use a different container. I attempted to implement this using
withName:blocks, but the workflow always uses the first container and never switches to the Manta-specific container.What is the recommended way to configure multiple local containers so that a specific process (Manta) uses one container and all remaining processes use another, particularly in an offline environment?
Below is my configuration file:
apptainer {
enabled = true
autoMounts = true
}
process {
beforeScript = '''
mkdir -p "$PWD/nxf_tmp"
export TMPDIR="$PWD/nxf_tmp"
'''
```
//withName: '.*'{
// container = "${System.getenv('HOME')}/sv_caller_new.sif"
//}
withName: '!.*POPGEN48_SV_CALLER:SV_CALLER:MANTA_GERMLINE' {
container = "${System.getenv('HOME')}/sv_caller_new.sif"
}
withName: '.*POPGEN48_SV_CALLER:SV_CALLER:MANTA_GERMLINE' {
container = "${System.getenv('HOME')}/manta_python.sif"
}
env{
TMPDIR = '$PWD/nxf_tmp'
TMP = '$PWD/nxf_tmp'
}
resourceLimits = [
time: 24.h
]
```
}
timeline {
enabled = true
file = "timeline.html"
overwrite = true
}
trace {
enabled = true
file = "trace.txt"
overwrite = true
}
I am using nextflow version: 25.04.6.5954