@@ -282,7 +282,7 @@ protected void executeR(SequenceOutputHandler.JobContext ctx, File rmd, String o
282282 seuratThreads = getProvider ().getParameterByName (SEURAT_THREADS ).extractValue (ctx .getJob (), getProvider (), getStepIdx (), Integer .class , null );
283283 }
284284
285- executeR (ctx , getDockerContainerName (), outputPrefix , lines , seuratThreads );
285+ executeR (ctx , getDockerContainerName (), outputPrefix , lines , seuratThreads , getDockerHomeDir () );
286286
287287 handlePossibleFailure (ctx , outputPrefix );
288288 }
@@ -294,7 +294,7 @@ protected static SeuratToolParameter getSeuratThreadsParam()
294294 }}, null );
295295 }
296296
297- public static void executeR (SequenceOutputHandler .JobContext ctx , String dockerContainerName , String outputPrefix , List <String > lines , @ Nullable Integer seuratThreads ) throws PipelineJobException
297+ public static void executeR (SequenceOutputHandler .JobContext ctx , String dockerContainerName , String outputPrefix , List <String > lines , @ Nullable Integer seuratThreads , @ Nullable String dockerHomeDir ) throws PipelineJobException
298298 {
299299 File localRScript = new File (ctx .getOutputDir (), FileUtil .makeLegalName (outputPrefix + ".R" ).replaceAll (" " , "_" ));
300300 try (PrintWriter writer = PrintWriters .getPrintWriter (localRScript ))
@@ -349,6 +349,10 @@ public static void executeR(SequenceOutputHandler.JobContext ctx, String dockerC
349349 writer .println ("\t -u $UID \\ " );
350350 writer .println ("\t -e USERID=$UID \\ " );
351351 writer .println ("\t -e TMPDIR=/tmp \\ " );
352+ if (dockerHomeDir != null )
353+ {
354+ writer .println ("\t -e HOME=" + dockerHomeDir + " \\ " );
355+ }
352356 writer .println ("\t -w /work \\ " );
353357 //NOTE: this seems to disrupt packages installed into home
354358 //writer.println("\t-e HOME=/homeDir \\");
@@ -371,6 +375,11 @@ public static void executeR(SequenceOutputHandler.JobContext ctx, String dockerC
371375 localBashScript .delete ();
372376 }
373377
378+ public String getDockerHomeDir ()
379+ {
380+ return null ;
381+ }
382+
374383 protected void addParameterVariables (SeuratToolParameter pd , List <String > body )
375384 {
376385 String val = StringUtils .trimToNull (pd .extractValue (getPipelineCtx ().getJob (), getProvider (), getStepIdx ()));
0 commit comments