From 45bc4314ace2268cac4280e5bb4c92c6ec0d12c4 Mon Sep 17 00:00:00 2001 From: St3451 Date: Thu, 28 May 2026 17:51:23 +0200 Subject: [PATCH 1/3] fix: redirect HOME to /tmp so ChimeraX can write its data dir under Singularity ChimeraX initializes a per-user data dir at \$HOME/.chimerax/ on first invocation. Singularity passes the host \$HOME through to the container; on most clusters that path is read-only inside the container, so ChimeraX fails with "Unable to make user's data directory: Read-only file system" and silently produces no PNG output during chimerax-plot. Override HOME=/tmp at the pipeline env level (mirroring the workaround already used in deepCSA) so ChimeraX has a writable home regardless of host config. Co-Authored-By: Claude Opus 4.7 (1M context) --- oncodrive3d_pipeline/nextflow.config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oncodrive3d_pipeline/nextflow.config b/oncodrive3d_pipeline/nextflow.config index 0195601..c12cdf7 100644 --- a/oncodrive3d_pipeline/nextflow.config +++ b/oncodrive3d_pipeline/nextflow.config @@ -122,11 +122,14 @@ process { } // Export these variables to prevent local Python/R libraries from conflicting with those in the container +// HOME is redirected to /tmp so ChimeraX can write its per-user data dir +// (the host $HOME is typically passed through read-only by Singularity). env { PYTHONNOUSERSITE = 1 R_PROFILE_USER = "/.Rprofile" R_ENVIRON_USER = "/.Renviron" JULIA_DEPOT_PATH = "/usr/local/share/julia" + HOME = "/tmp" } // Nextflow runtime settings From 6f78244a7f96708fe6e6fcc36decb6f3e57cb7b7 Mon Sep 17 00:00:00 2001 From: St3451 Date: Thu, 28 May 2026 18:08:34 +0200 Subject: [PATCH 2/3] fix: clarify comment on HOME redirection for ChimeraX in Singularity --- oncodrive3d_pipeline/nextflow.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oncodrive3d_pipeline/nextflow.config b/oncodrive3d_pipeline/nextflow.config index c12cdf7..6bd3d1f 100644 --- a/oncodrive3d_pipeline/nextflow.config +++ b/oncodrive3d_pipeline/nextflow.config @@ -123,7 +123,7 @@ process { // Export these variables to prevent local Python/R libraries from conflicting with those in the container // HOME is redirected to /tmp so ChimeraX can write its per-user data dir -// (the host $HOME is typically passed through read-only by Singularity). +// (on many clusters the host $HOME path is not writable inside the container). env { PYTHONNOUSERSITE = 1 R_PROFILE_USER = "/.Rprofile" From 66679cb5f98e83aa49ad125e62489eae65bac966 Mon Sep 17 00:00:00 2001 From: St3451 Date: Thu, 28 May 2026 18:11:12 +0200 Subject: [PATCH 3/3] fix: update HOME variable handling for ChimeraX in Singularity --- oncodrive3d_pipeline/modules/o3d_chimerax_plot.nf | 6 ++++++ oncodrive3d_pipeline/nextflow.config | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/oncodrive3d_pipeline/modules/o3d_chimerax_plot.nf b/oncodrive3d_pipeline/modules/o3d_chimerax_plot.nf index c3243f0..0f7110c 100644 --- a/oncodrive3d_pipeline/modules/o3d_chimerax_plot.nf +++ b/oncodrive3d_pipeline/modules/o3d_chimerax_plot.nf @@ -15,6 +15,12 @@ process O3D_CHIMERAX_PLOT { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${cohort}" """ + # Give ChimeraX a writable, per-task HOME so it can initialise its data + # directory (\$HOME/.chimerax) without colliding with concurrent tasks or + # hitting a read-only host \$HOME inside Singularity. + export HOME="\$PWD/.chimerax-home" + mkdir -p "\$HOME" + oncodrive3D chimerax-plot \\ -o $prefix \\ -g $genes_csv \\ diff --git a/oncodrive3d_pipeline/nextflow.config b/oncodrive3d_pipeline/nextflow.config index 6bd3d1f..0195601 100644 --- a/oncodrive3d_pipeline/nextflow.config +++ b/oncodrive3d_pipeline/nextflow.config @@ -122,14 +122,11 @@ process { } // Export these variables to prevent local Python/R libraries from conflicting with those in the container -// HOME is redirected to /tmp so ChimeraX can write its per-user data dir -// (on many clusters the host $HOME path is not writable inside the container). env { PYTHONNOUSERSITE = 1 R_PROFILE_USER = "/.Rprofile" R_ENVIRON_USER = "/.Renviron" JULIA_DEPOT_PATH = "/usr/local/share/julia" - HOME = "/tmp" } // Nextflow runtime settings