@@ -1234,7 +1234,7 @@ private File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, S
12341234 Set <String > allowableBarcodes = parameters .getAllowableBarcodeNames ();
12351235 String allowableBarcodeParam = allowableBarcodes != null ? "c('" + StringUtils .join (allowableBarcodes , "','" ) + "')" : "NULL" ;
12361236
1237- writer .println ("cellhashR::CallAndGenerateReport(rawCountData = '/work/" + citeSeqCountOutDir .getName () + "', reportFile = '/work/" + htmlFile .getName () + "', callFile = '/work/" + callsFile .getName () + "', metricsFile = '/work/" + metricsFile .getName () + "', cellbarcodeWhitelist = " + cellbarcodeWhitelist + ", barcodeWhitelist = " + allowableBarcodeParam + ", title = '" + parameters .getReportTitle () + "', methods = c('" + StringUtils .join (methodNames , "','" ) + "'))" );
1237+ writer .println ("f <- cellhashR::CallAndGenerateReport(rawCountData = '/work/" + citeSeqCountOutDir .getName () + "', reportFile = '/work/" + htmlFile .getName () + "', callFile = '/work/" + callsFile .getName () + "', metricsFile = '/work/" + metricsFile .getName () + "', cellbarcodeWhitelist = " + cellbarcodeWhitelist + ", barcodeWhitelist = " + allowableBarcodeParam + ", title = '" + parameters .getReportTitle () + "', methods = c('" + StringUtils .join (methodNames , "','" ) + "'))" );
12381238 writer .println ("print('Rmarkdown complete')" );
12391239
12401240 }
@@ -1248,7 +1248,8 @@ private File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, S
12481248 log .info ("script exists, re-using: " + localRScript .getPath ());
12491249 }
12501250
1251- File localBashScript = new File (outputDir , "generateCallsWrapper.sh" );
1251+ File localBashScript = new File (outputDir , "generateCallsDockerWrapper.sh" );
1252+ File rWrapperScript = new File (outputDir , "generateCallsRWrapper.sh" );
12521253 try (PrintWriter writer = PrintWriters .getPrintWriter (localBashScript ))
12531254 {
12541255 writer .println ("#!/bin/bash" );
@@ -1278,7 +1279,25 @@ private File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, S
12781279 writer .println ("\t -w /work \\ " );
12791280 writer .println ("\t -e HOME=/homeDir \\ " );
12801281 writer .println ("\t ghcr.io/bimberlab/cellhashr:latest \\ " );
1281- writer .println ("\t Rscript --vanilla " + localRScript .getName ());
1282+ writer .println ("\t /bin/bash " + rWrapperScript .getName ());
1283+ }
1284+ catch (IOException e )
1285+ {
1286+ throw new PipelineJobException (e );
1287+ }
1288+
1289+ try (PrintWriter writer = PrintWriters .getPrintWriter (rWrapperScript ))
1290+ {
1291+ writer .println ("#!/bin/bash" );
1292+ writer .println ("set -x" );
1293+
1294+ writer .println ("if Rscript --vanilla " + localRScript .getName ());
1295+ writer .println ("then" );
1296+ writer .println ("\t exit 0" );
1297+ writer .println ("else" );
1298+ writer .println ("\t echo \" Rscript exited with value $?\" " );
1299+ writer .println ("\t exit 0" );
1300+ writer .println ("fi" );
12821301 }
12831302 catch (IOException e )
12841303 {
@@ -1315,6 +1334,10 @@ private File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, S
13151334 throw new PipelineJobException ("Unable to find HTO calls file: " + callsFile .getPath ());
13161335 }
13171336
1337+ localBashScript .delete ();
1338+ rWrapperScript .delete ();
1339+ localRScript .delete ();
1340+
13181341 try
13191342 {
13201343 for (File f : toDelete )
0 commit comments