@@ -959,6 +959,11 @@ private File getExpectedCallsFile(File outputDir, String basename)
959959 return new File (outputDir , basename + CALL_EXTENSION );
960960 }
961961
962+ private File getMolInfoFileFromCounts (File citeSeqCountOutDir )
963+ {
964+ return new File (citeSeqCountOutDir .getParentFile (), "molecule_info.h5" );
965+ }
966+
962967 public File generateCellHashingCalls (File citeSeqCountOutDir , File outputDir , String basename , Logger log , File localPipelineDir , CellHashingService .CellHashingParameters parameters ) throws PipelineJobException
963968 {
964969 log .debug ("generating final calls from folder: " + citeSeqCountOutDir .getPath ());
@@ -968,6 +973,14 @@ public File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, St
968973 SimpleScriptWrapper rWrapper = new SimpleScriptWrapper (log );
969974 rWrapper .setWorkingDir (outputDir );
970975
976+ File molInfo = getMolInfoFileFromCounts (citeSeqCountOutDir );
977+ if (!molInfo .exists ())
978+ {
979+ throw new PipelineJobException ("File not found, cannot calculate saturation: " + molInfo .getPath ());
980+ }
981+
982+ molInfo = ensureLocalCopy (citeSeqCountOutDir , outputDir , log , toDelete );
983+
971984 citeSeqCountOutDir = ensureLocalCopy (citeSeqCountOutDir , outputDir , log , toDelete );
972985
973986 File cellBarcodeWhitelistFile = parameters .cellBarcodeWhitelistFile ;
@@ -1015,7 +1028,7 @@ public File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, St
10151028
10161029 String skipNormalizationQcString = parameters .skipNormalizationQc ? "TRUE" : "FALSE" ;
10171030 String keepMarkdown = parameters .keepMarkdown ? "TRUE" : "FALSE" ;
1018- writer .println ("f <- cellhashR::CallAndGenerateReport(rawCountData = '/work/" + citeSeqCountOutDir .getName () + "', reportFile = '/work/" + htmlFile .getName () + "', callFile = '/work/" + callsFile .getName () + "', metricsFile = '/work/" + metricsFile .getName () + "', rawCountsExport = '/work/" + countFile .getName () + "', cellbarcodeWhitelist = " + cellbarcodeWhitelist + ", barcodeWhitelist = " + allowableBarcodeParam + ", title = '" + parameters .getReportTitle () + "', skipNormalizationQc = " + skipNormalizationQcString + ", methods = c('" + StringUtils .join (methodNames , "','" ) + "'), keepMarkdown = " + keepMarkdown + ")" );
1031+ writer .println ("f <- cellhashR::CallAndGenerateReport(rawCountData = '/work/" + citeSeqCountOutDir .getName () + "', molInfoFile = '/work/" + molInfo . getName () + "', reportFile = '/work/" + htmlFile .getName () + "', callFile = '/work/" + callsFile .getName () + "', metricsFile = '/work/" + metricsFile .getName () + "', rawCountsExport = '/work/" + countFile .getName () + "', cellbarcodeWhitelist = " + cellbarcodeWhitelist + ", barcodeWhitelist = " + allowableBarcodeParam + ", title = '" + parameters .getReportTitle () + "', skipNormalizationQc = " + skipNormalizationQcString + ", methods = c('" + StringUtils .join (methodNames , "','" ) + "'), keepMarkdown = " + keepMarkdown + ")" );
10191032 writer .println ("print('Rmarkdown complete')" );
10201033
10211034 }
0 commit comments