예제 #1
0
        /// <summary>
        /// prepare to perform the analysis
        /// </summary>
        public void PrepAnalysisInteractive()
        {
            CheckREnvironment();
            // clear out the library
            _subsLib.FilteredLibrary.ClearResults();

            // read the custom functions from the dir
            _rfunc = new RFunctions(_functionsDir, _statConn);
            _rfunc.Reload();

            // get the size of this run so we can update interested parties
            _analysisSize  = _subsLib.FilteredLibrary.NumEntries * _hsAssayResults.Count;
            _analysisCount = 0;

            _enum = _hsAssayResults.GetEnumerator();
            // Enumerators start out _before_ the beginning of the collection, so we have to
            // MoveNext to be at the first value
            _enum.MoveNext();
            _currResults = ((AssayResults)_enum.Value).FilteredResults;
            // associate the stats collection with the results
            _currResults.StatCollection = _stats.Copy();
            // clear subresults
            _currResults.ClearSubResults();
            // associate the results with the substructure library
            _subsLib.FilteredLibrary.AddResults(_currResults);
            // prep the statistics run
            _currResults.PrepInteractiveStatisticsRun(_statConn);
        }
예제 #2
0
        /// <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);
        }