public DataTableMergeManager(List <DataTable> listOfTables)
 {
     _ListOfDataTables = listOfTables;
     _MegeredDataTable = new DataTable();
     _MegeredDataTable = _ListOfDataTables[0].Clone();
     ProgressArg       = new WorkerProgressEventArg();
 }
Beispiel #2
0
        public PeptideExtractionManager(int sizeOfOneSide, DataTable dtSource, string nameOfPIDFieldName, string nameOfSequenceFeild, bool isExtendedSequenceField, string nameOfPositionFeild, bool markClassificationLabel, string classificationLabel)
        {
            _SizeOfOneSide           = sizeOfOneSide;
            _SourceDataTable         = dtSource;
            _IsExtendedSequence      = isExtendedSequenceField;
            _NameOfPositionFeildName = nameOfPositionFeild;
            _NamePIDFeildName        = nameOfPIDFieldName;
            _NameOfSequenceFeildName = nameOfSequenceFeild;
            _ClassificationLabel     = classificationLabel;
            _MarkClassificationLabel = markClassificationLabel;

            _PeptideDataTable = new DataTable("Peptides");
            _PeptideDataTable.Columns.Add("PeptideID");
            _PeptideDataTable.Columns.Add("ExtendedSequence");
            if (_MarkClassificationLabel == true)
            {
                _PeptideDataTable.Columns.Add("Class");
            }

            PeptideExtractionCompletedEventArg = new WorkerCompletedEventArg();
            PeptideExtractionProgressEventArg  = new WorkerProgressEventArg();

            for (index = (-1 * _SizeOfOneSide); index <= _SizeOfOneSide; index++)
            {
                _PeptideDataTable.Columns.Add("P" + index.ToString());
            }
        }
Beispiel #3
0
        public NeuralNetwork(int id)
        {
            ID = id;

            NeuralNetworkTaskCompletedArgs = new WorkerCompletedEventArg();
            NeuralNetworkTaskProgressArgs  = new WorkerProgressEventArg();
            NeuralNetworkTaskStartedArgs   = new WorkerStartedEventArg();
        }
Beispiel #4
0
 void _BootStrapAgent_SamplingProgress(object sender, WorkerProgressEventArg e)
 {
     lblStatus.Text    = e.UserState;
     progressbar.Value = (int)e.ProgressPercentage;
     Application.DoEvents();
 }
 void encodingManager_EncodingProgress(object sender, WorkerProgressEventArg e)
 {
     progressBar1.Value = (int)e.ProgressPercentage;
     Application.DoEvents();
 }
Beispiel #6
0
 void _ProteinDataSeperator_SeperationProgressUpdate(object sender, WorkerProgressEventArg e)
 {
     progressbar.Value = (int)e.ProgressPercentage;
     lblStatus.Text    = e.UserState;// +": " + e.ProgressPercentage.ToString();
     Application.DoEvents();
 }
 void dtmanager_ProgressUpdate(object sender, WorkerProgressEventArg e)
 {
     progressBar1.Value = (int)e.ProgressPercentage;
     lblStatus.Text     = e.UserState;
     Application.DoEvents();
 }
Beispiel #8
0
        public void Run()
        {
            if (SeperationStarted != null)
            {
                SeperationStarted(this);
            }

            SeperationEventArgs         = new WorkerCompletedEventArg();
            SeperationProgressEventArgs = new WorkerProgressEventArg();

            int    total = _SiteDataTable.Rows.Count;
            string positionString;
            string pid;
            string sequence;
            int    position;

            _ProteinDataTable = new DataTable("ProteinDataTable");
            _ProteinDataTable.Columns.Add("PID");
            _ProteinDataTable.Columns.Add("Sequence");
            _ProteinDataTable.Columns.Add("SequenceLength");
            _ProteinDataTable.Columns.Add("Position");
            DataRow row;
            Dictionary <string, string>      proteinSequenceDictionary;
            Dictionary <string, List <int> > proteinPositionDictionary;

            proteinPositionDictionary = new Dictionary <string, List <int> >();
            proteinSequenceDictionary = new Dictionary <string, string>();
            int index;

            if (SeperationProgressUpdate != null)
            {
                SeperationProgressEventArgs.ProgressPercentage = 0;
                SeperationProgressEventArgs.UserState          = "Extracting and Grouping Protein's Sequence and Position Related Data";
                SeperationProgressUpdate(this, SeperationProgressEventArgs);
            }
            for (index = 0; index < total; index++)
            {
                row = _SiteDataTable.Rows[index];
                pid = row[_PIDFieldName].ToString();
                if (proteinSequenceDictionary.ContainsKey(pid) == false)
                {
                    sequence = row[_SequenceFieldName].ToString();
                    proteinSequenceDictionary.Add(pid, sequence);
                    proteinPositionDictionary.Add(pid, new List <int>());
                }

                position = int.Parse(row[_PositionFieldName].ToString());
                //if (proteinPositionDictionary[pid] == null)
                //  proteinPositionDictionary[pid] = new List<int>();

                if (proteinPositionDictionary[pid].Contains(position) == false)
                {
                    proteinPositionDictionary[pid].Add(position);
                }

                if (SeperationProgressUpdate != null)
                {
                    SeperationProgressEventArgs.ProgressPercentage = (float)(((float)index / (float)total) * 100.00f);
                    SeperationProgressEventArgs.UserState          = "Extracting and Grouping Protein's Sequence and Position Related Data";
                    SeperationProgressUpdate(this, SeperationProgressEventArgs);
                }
            }

            total = proteinPositionDictionary.Keys.Count;
            index = 1;
            int        ctr;
            List <int> positionList;


            if (SeperationProgressUpdate != null)
            {
                SeperationProgressEventArgs.ProgressPercentage = 0.00f;
                SeperationProgressEventArgs.UserState          = "Preparing Protein Profiles and Importing Them to DataTable";
                SeperationProgressUpdate(this, SeperationProgressEventArgs);
            }
            foreach (string id in proteinSequenceDictionary.Keys)
            {
                positionString = "";
                positionList   = proteinPositionDictionary[id];
                positionList.Sort();
                for (ctr = 0; ctr < positionList.Count; ctr++)
                {
                    position       = positionList[ctr];
                    positionString = positionString + position.ToString();
                    if (ctr != (positionList.Count - 1))
                    {
                        positionString = positionString + ",";
                    }
                }
                row                   = _ProteinDataTable.NewRow();
                row["PID"]            = id;
                row["Sequence"]       = proteinSequenceDictionary[id];
                row["SequenceLength"] = proteinSequenceDictionary[id].Length;
                row["Position"]       = positionString;
                _ProteinDataTable.Rows.Add(row);
                if (SeperationProgressUpdate != null)
                {
                    SeperationProgressEventArgs.ProgressPercentage = (float)(((float)index / (float)total) * 100.00f);
                    SeperationProgressEventArgs.UserState          = "Preparing Protein Profiles and Importing Them to DataTable";
                    SeperationProgressUpdate(this, SeperationProgressEventArgs);
                }
                index++;
            }

            if (SeperationCompleted != null)
            {
                SeperationCompleted(this, null);
            }
        }
 void _PeptideExtractionManager_PeptideExtractionProgress(object sender, WorkerProgressEventArg e)
 {
     progressbar.Value = (int)e.ProgressPercentage;
     lblStatus.Text    = e.UserState;
 }
 public BootStrapping()
 {
     _SelectedItemIndexes      = new List <int>();
     SamplingProgressEventArgs = new WorkerProgressEventArg();
     ResetRandomizer();
 }
Beispiel #11
0
        public void Run()
        {
            ProgressArgs = new WorkerProgressEventArg();
            int ctr;

            if (_UseBinarySplitMode == true)
            {
                sizeOfCodeString = 0;

                foreach (string key in _EncodingDictionary.Keys)
                {
                    if (sizeOfCodeString <= _EncodingDictionary[key].Length)
                    {
                        sizeOfCodeString = _EncodingDictionary[key].Length;
                    }
                }


                _EncodedDataTable = new DataTable("Encoded");
                string columnName;
                foreach (DataColumn col in _DataTableToEncode.Columns)
                {
                    columnName = col.ColumnName;
                    if (_ListOfAttributes.Contains(columnName) == false)
                    {
                        _EncodedDataTable.Columns.Add(columnName);
                    }
                    else
                    {
                        for (ctr = 1; ctr <= sizeOfCodeString; ctr++)
                        {
                            _EncodedDataTable.Columns.Add(columnName + "_" + ctr.ToString());
                        }
                    }
                }
            }
            else
            {
                _EncodedDataTable = _DataTableToEncode.Clone();
            }
            if (_AddBinaryStringAttribute == true)
            {
                _EncodedDataTable.Columns.Add("EncodedString");
                _EncodedDataTable.Columns.Add("EncodedStringLength");
            }

            int     attributeIndex;
            string  attribute;
            int     rowIndex;
            int     totalRows       = _DataTableToEncode.Rows.Count;
            int     totalAttributes = _DataTableToEncode.Columns.Count;
            float   progress;
            DataRow row;
            DataRow encodedRow;
            string  item;
            string  encodeditem;
            string  encodedString = "";

            char [] encodingStringArray;
            //int ctr;

            for (rowIndex = 0; rowIndex < totalRows; rowIndex++)
            {
                row        = _DataTableToEncode.Rows[rowIndex];
                encodedRow = _EncodedDataTable.NewRow();
                for (attributeIndex = 0; attributeIndex < totalAttributes; attributeIndex++)
                {
                    attribute = _DataTableToEncode.Columns[attributeIndex].ColumnName;
                    item      = row[attribute].ToString();
                    if (_ListOfAttributes.Contains(attribute) == true)
                    {
                        encodeditem = _EncodingDictionary[item];
                        if (_UseBinarySplitMode == true)
                        {
                            encodingStringArray = encodeditem.ToCharArray();
                            for (ctr = 1; ctr <= sizeOfCodeString; ctr++)
                            {
                                encodedRow[attribute + "_" + ctr.ToString()] = encodingStringArray[ctr - 1].ToString();
                            }
                        }
                        else
                        {
                            encodedRow[attribute] = encodeditem;
                        }

                        if (_AddBinaryStringAttribute == true)
                        {
                            encodedString = encodedString + encodeditem;
                        }
                    }
                    else
                    {
                        encodedRow[attribute] = item;
                    }
                }
                if (_AddBinaryStringAttribute == true)
                {
                    encodedRow["EncodedString"]       = encodedString;
                    encodedRow["EncodedStringLength"] = encodedString.Length;
                    encodedString = "";
                }

                _EncodedDataTable.Rows.Add(encodedRow);
                progress = (((float)(rowIndex + 1)) / ((float)(totalRows)) * 100);
                if (EncodingProgress != null)
                {
                    ProgressArgs.ProgressPercentage = progress;
                    ProgressArgs.UserState          = "";
                    EncodingProgress(this, ProgressArgs);
                }
            }

            if (EncodingCompleted != null)
            {
                CompletedArgs                  = new WorkerCompletedEventArg();
                CompletedArgs.Result           = _EncodedDataTable;
                CompletedArgs.UserStateMessage = "Finished";
                EncodingCompleted(this, CompletedArgs);
            }
        }