private CanvasCleanOutput InvokeCanvasClean(CanvasCallset callset, IFileLocation binnedPath) { StringBuilder commandLine = new StringBuilder(); commandLine.Length = 0; string executablePath = Path.Combine(_canvasFolder, "CanvasClean.exe"); if (CrossPlatform.IsThisMono()) { commandLine.AppendFormat("{0} ", executablePath); executablePath = Utilities.GetMonoPath(); } commandLine.AppendFormat("-i \"{0}\" ", binnedPath); string cleanedPath = Path.Combine(callset.TempFolder, string.Format("{0}.cleaned", callset.Id)); commandLine.AppendFormat("-o \"{0}\" ", cleanedPath); commandLine.AppendFormat("-g"); string ffpePath = null; // TruSight Cancer has 1,737 targeted regions. The cut-off 2000 is somewhat arbitrary. // TruSight One has 62,309 targeted regions. // Nextera Rapid Capture v1.1 has 411,513 targeted regions. if (!callset.IsEnrichment || callset.Manifest.Regions.Count > 2000) { ffpePath = Path.Combine(callset.TempFolder, "FilterRegions.txt"); commandLine.AppendFormat(" -s -r -f \"{0}\"", ffpePath); } if (callset.IsEnrichment) // manifest { if (!File.Exists(callset.TempManifestPath)) { NexteraManifestUtils.WriteNexteraManifests(callset.Manifest, callset.TempManifestPath); } commandLine.AppendFormat(" -t \"{0}\"", callset.TempManifestPath); } UnitOfWork cleanJob = new UnitOfWork() { ExecutablePath = executablePath, LoggingFolder = _workManager.LoggingFolder.FullName, LoggingStub = Path.GetFileName(cleanedPath), CommandLine = commandLine.ToString() }; if (_customParameters.ContainsKey("CanvasClean")) { cleanJob.CommandLine = Utilities.MergeCommandLineOptions(cleanJob.CommandLine, _customParameters["CanvasClean"], true); } _workManager.DoWorkSingleThread(cleanJob); var canvasCleanOutput = new CanvasCleanOutput(new FileLocation(cleanedPath), new FileLocation(ffpePath)); return(canvasCleanOutput); }
private CanvasCleanOutput InvokeCanvasClean(CanvasCallset callset, IFileLocation binnedPath) { StringBuilder commandLine = new StringBuilder(); commandLine.Length = 0; string executablePath = Path.Combine(_canvasFolder, "CanvasClean.exe"); if (CrossPlatform.IsThisMono()) { commandLine.AppendFormat("{0} ", executablePath); executablePath = Utilities.GetMonoPath(); } commandLine.AppendFormat("-i \"{0}\" ", binnedPath); string cleanedPath = Path.Combine(callset.TempFolder, string.Format("{0}.cleaned", callset.Id)); commandLine.AppendFormat("-o \"{0}\" ", cleanedPath); commandLine.AppendFormat("-g"); string ffpePath = null; // TruSight Cancer has 1,737 targeted regions. The cut-off 2000 is somewhat arbitrary. // TruSight One has 62,309 targeted regions. // Nextera Rapid Capture v1.1 has 411,513 targeted regions. if (!callset.IsEnrichment || callset.Manifest.Regions.Count > 2000) { ffpePath = Path.Combine(callset.TempFolder, "FilterRegions.txt"); commandLine.AppendFormat(" -s -r -f \"{0}\"", ffpePath); } if (callset.IsEnrichment) // manifest { if (!File.Exists(callset.TempManifestPath)) { NexteraManifestUtils.WriteNexteraManifests(callset.Manifest, callset.TempManifestPath); } commandLine.AppendFormat(" -t \"{0}\"", callset.TempManifestPath); } UnitOfWork cleanJob = new UnitOfWork() { ExecutablePath = executablePath, LoggingFolder = _workManager.LoggingFolder.FullName, LoggingStub = Path.GetFileName(cleanedPath), CommandLine = commandLine.ToString() }; if (_customParameters.ContainsKey("CanvasClean")) { cleanJob.CommandLine = Utilities.MergeCommandLineOptions(cleanJob.CommandLine, _customParameters["CanvasClean"], true); } _workManager.DoWorkSingleThread(cleanJob); var canvasCleanOutput = new CanvasCleanOutput(new FileLocation(cleanedPath), new FileLocation(ffpePath)); return canvasCleanOutput; }