示例#1
0
 public SEAAnalysis(Hashtable results, SEAEnvironment environment)
 {
     _substructureLibrary = environment.subsLib;
     _hsAssayResults      = results;
     _stats = environment.stats;
     _customFunctionsDir = environment.CustomFunctionsDir;
 }
示例#2
0
 public SEAAnalysis(SubstructureLibrary library, Hashtable results, StatisticsCollection stats, string CustomFunctionsDir)
 {
     _substructureLibrary = library;
     _hsAssayResults      = results;
     _stats = stats;
     _customFunctionsDir = CustomFunctionsDir;
 }
示例#3
0
        /// <summary>
        /// Constructor for the FormMain form
        /// </summary>
        public FormMain()
        {
            InitializeComponent();
            // set application paths
            _appPath        = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);
            _subLibPath     = _appPath + "\\" + SUBSTRUCTURE_DIR;
            _outputPath     = _appPath + "\\" + OUTPUT_DIR;
            _statisticsFile = _appPath + "\\" + STATISTICS_DIR + "\\" + STATISTICS_FILE;
            _functionsDir   = _appPath + "\\" + STATISTICS_DIR + "\\" + FUNCTIONS_DIR;

            // init controls
            lstSubsLib.DisplayMember         = "NameNoExt";
            lstAssayResults.DisplayMember    = "NameNoExt";
            lstAnalysisResults.DisplayMember = "NameNoExt";

            // fill substructure library listbox with list of available files
            DirectoryInfo di = new DirectoryInfo(_subLibPath);

            FileInfo[] rgFiles = di.GetFiles("*.txt");
            foreach (FileInfo fi in rgFiles)
            {
                lstSubsLib.Items.Add(new FileInfoExtended(fi));
            }

            _stats = new StatisticsCollection();

            SetGUIItems(STATE_START);
        }
示例#4
0
        /// <summary>
        /// Return a copy of this StatisticsCollection
        /// </summary>
        /// <returns></returns>
        public StatisticsCollection Copy()
        {
            StatisticsCollection _return = new StatisticsCollection();

            foreach (StatisticsEntry stat in _arEntries)
            {
                _return.Add(stat.Copy());
            }
            return(_return);
        }
示例#5
0
        public SEAEnvironment()
        {
            // set application paths
            _appPath        = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);
            _subLibPath     = _appPath + "\\" + SUBSTRUCTURE_DIR;
            _outputPath     = _appPath + "\\" + OUTPUT_DIR;
            _statisticsFile = _appPath + "\\" + STATISTICS_DIR + "\\" + STATISTICS_FILE;
            _functionsDir   = _appPath + "\\" + STATISTICS_DIR + "\\" + FUNCTIONS_DIR;

            _stats          = new StatisticsCollection();
            _subsLib        = new SubstructureLibrary("Substructure Library");
            _hsAssayResults = new Hashtable();
        }
示例#6
0
        /// <summary>
        /// Write out a file containing stats for an individual assay result versus this substructure library
        /// </summary>
        /// <param name="assayName"></param>
        public void WriteAssayAnalysisFile(string assayName, string dirName)
        {
            AssayResults         ar       = (AssayResults)_hsAssayResults[assayName];
            string               filename = dirName + "\\" + assayName + ".txt";
            StreamWriter         sw       = new StreamWriter(filename);
            StringBuilder        sb       = new StringBuilder();
            StatisticsCollection stats    = ar.StatCollection;

            // output the statistics results
            foreach (StatisticsEntry stat in stats.Entries)
            {
                if (stat.Perform)
                {
                    sb.Length = 0;
                    sb.Append(stat.Name);
                    sb.Append("\t" + stat.Result.ToString());
                    foreach (SubstructureEntry ent in _arEntries)
                    {
                        sb.Append("\t" + ((AssayResults)ent.AssayResultsHash[assayName]).StatCollection.Item(stat.Name).Result);
                    }
                    sw.WriteLine(sb.ToString());
                }
            }

            //column headers
            sb.Length = 0;
            sb.Append("SID\tAll Results");
            foreach (SubstructureEntry ent in _arEntries)
            {
                sb.Append("\t" + ent.Name);
            }
            sw.WriteLine(sb.ToString());
            // following lines - all SIDs for the library, followed by the individual result for that substructure library,
            // if it exists
            foreach (string SID in ar.ResultHash.Keys)
            {
                sb.Length = 0;
                sb.Append(SID + "\t" + ar.ResultHash[SID].ToString());
                foreach (SubstructureEntry ent in _arEntries)
                {
                    sb.Append("\t");
                    if (((AssayResults)ent.AssayResultsHash[assayName]).ResultHash.ContainsKey(SID))
                    {
                        sb.Append(((AssayResults)ent.AssayResultsHash[assayName]).ResultHash[SID].ToString());
                    }
                }
                sw.WriteLine(sb.ToString());
            }
            // close file
            sw.Close();
        }