/// <summary> /// Run the analysis in a piecewise fashion, so progress can be reported and /// analysis stopped if necessary. Returns the percentage of analysis done. /// </summary> public int RunAnalysisInteractive() { int percentDone = -1; bool b = _currResults.CalculateStatisticsInteractive(_statConn); // if return value was false, then the statistics are done for this assay result, // and we should try to move to the next if (!b) { if (_enum.MoveNext()) { _currResults = ((AssayResults)_enum.Value).FilteredResults; // associate the stats collection with the results _currResults.StatCollection = _stats.Copy(); // associate the results with the substructure library _subsLib.FilteredLibrary.AddResults(_currResults); // prep the statistics run _currResults.PrepInteractiveStatisticsRun(_statConn); b = _currResults.CalculateStatisticsInteractive(_statConn); } } // if we have a true return value from CalculateStatisticsInteractive, then we can increment the count if (b) { _analysisCount++; percentDone = Convert.ToInt32((double)_analysisCount / (double)_analysisSize * 100); } return(percentDone); }
/// <summary> /// Calculate the statistics for this set of assay results, comparing it to the master list if relevant /// If this method is called on a master result list, it will call CalculateStatistics on all of its /// child sub-results. /// </summary> /// <param name="stat">The StatConnector used to calculate statistics</param> public void CalculateStatistics(STATCONNECTORSRVLib.StatConnector stat) { _stats.Calculate(stat, _results, _isMasterResults); if (_isMasterResults) { // now go through the list of subresults and call CalculateStatistics on the subresults foreach (AssayResults ar in _subResultList) { ar.StatCollection = _stats.Copy(); ar.CalculateStatistics(stat); } } }
public void Run() { // fire up R STATCONNECTORSRVLib.StatConnector statConn = new StatConnector(); statConn.Init("R"); // read the custom functions from the dir RFunctions rfunc = new RFunctions(_customFunctionsDir, statConn); rfunc.Reload(); // for each set of assay results, associate the results with the substructure libraries foreach (AssayResults aResults in _hsAssayResults.Values) { // associate the stats collection with the results aResults.StatCollection = _stats.Copy(); // associate the results with the substructure library _substructureLibrary.AddResults(aResults); // now, calculate the statistics for this result set (which will also calculate statistics for // all results sets that were added to the substructure library entries). aResults.CalculateStatistics(statConn); } // close the connection statConn.Close(); }