@@ -1111,10 +1111,11 @@ public File ensureLocalCopy(File input, File outputDir, Logger log, Set<File> to
11111111 try
11121112 {
11131113 //needed for docker currently
1114- log .debug ("Copying file to working directory: " + input .getName ());
1114+ log .debug ("Copying file to working directory: " + input .getPath ());
11151115 File dest = new File (outputDir , input .getName ());
11161116 if (dest .exists ())
11171117 {
1118+ log .debug ("deleting existing folder: " + dest .getPath ());
11181119 if (input .isDirectory ())
11191120 {
11201121 FileUtils .deleteDirectory (dest );
@@ -1224,33 +1225,26 @@ private File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, S
12241225 File metricsFile = getMetricsFile (callsFile );
12251226
12261227 File localRScript = new File (outputDir , "generateCallsWrapper.R" );
1227- if (! localRScript . exists ( ))
1228+ try ( PrintWriter writer = PrintWriters . getPrintWriter ( localRScript ))
12281229 {
1229- try (PrintWriter writer = PrintWriters .getPrintWriter (localRScript ))
1230- {
1231- List <String > methodNames = parameters .methods .stream ().map (Enum ::name ).collect (Collectors .toList ());
1230+ List <String > methodNames = parameters .methods .stream ().map (Enum ::name ).collect (Collectors .toList ());
12321231
1233- String cellbarcodeWhitelist = "" ;
1234- if (cellBarcodeWhitelistFile != null )
1235- {
1236- cellbarcodeWhitelist = "'/work/" + cellBarcodeWhitelistFile .getName () + "'" ;
1237- }
1232+ String cellbarcodeWhitelist = "" ;
1233+ if (cellBarcodeWhitelistFile != null )
1234+ {
1235+ cellbarcodeWhitelist = "'/work/" + cellBarcodeWhitelistFile .getName () + "'" ;
1236+ }
12381237
1239- Set <String > allowableBarcodes = parameters .getAllowableBarcodeNames ();
1240- String allowableBarcodeParam = allowableBarcodes != null ? "c('" + StringUtils .join (allowableBarcodes , "','" ) + "')" : "NULL" ;
1238+ Set <String > allowableBarcodes = parameters .getAllowableBarcodeNames ();
1239+ String allowableBarcodeParam = allowableBarcodes != null ? "c('" + StringUtils .join (allowableBarcodes , "','" ) + "')" : "NULL" ;
12411240
1242- 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 , "','" ) + "'))" );
1243- writer .println ("print('Rmarkdown complete')" );
1241+ 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 , "','" ) + "'))" );
1242+ writer .println ("print('Rmarkdown complete')" );
12441243
1245- }
1246- catch (IOException e )
1247- {
1248- throw new PipelineJobException (e );
1249- }
12501244 }
1251- else
1245+ catch ( IOException e )
12521246 {
1253- log . info ( "script exists, re-using: " + localRScript . getPath () );
1247+ throw new PipelineJobException ( e );
12541248 }
12551249
12561250 File localBashScript = new File (outputDir , "generateCallsDockerWrapper.sh" );
0 commit comments