Пример #1
0
        public void SetValuesOfNeuralNetworkInputLayer(Peptide PeptideGivenToAgent)
        {
            #region Amino Acid List

            List <AminoAcid> AminoAcidList = new List <AminoAcid>();

            #region List Entries
            AminoAcidList.Add(new AminoAcid("Alanine", 'A'));
            AminoAcidList.Add(new AminoAcid("Arginine", 'R'));
            AminoAcidList.Add(new AminoAcid("Asparagine", 'N'));
            AminoAcidList.Add(new AminoAcid("Aspartic Acid", 'D'));
            AminoAcidList.Add(new AminoAcid("Cystein", 'C'));
            AminoAcidList.Add(new AminoAcid("Glutamine", 'Q'));
            AminoAcidList.Add(new AminoAcid("Glutamic Acid", 'E'));
            AminoAcidList.Add(new AminoAcid("Glycine", 'G'));
            AminoAcidList.Add(new AminoAcid("Histidine", 'H'));
            AminoAcidList.Add(new AminoAcid("Isoleucine", 'I'));
            AminoAcidList.Add(new AminoAcid("Leucine", 'L'));
            AminoAcidList.Add(new AminoAcid("Lysine", 'K'));
            AminoAcidList.Add(new AminoAcid("Methionine", 'M'));
            AminoAcidList.Add(new AminoAcid("Phenylalanine", 'F'));
            AminoAcidList.Add(new AminoAcid("Proline", 'P'));
            AminoAcidList.Add(new AminoAcid("Serine", 'S'));
            AminoAcidList.Add(new AminoAcid("Threonine", 'T'));
            AminoAcidList.Add(new AminoAcid("Tryptophan", 'W'));
            AminoAcidList.Add(new AminoAcid("Tyrosine", 'Y'));
            AminoAcidList.Add(new AminoAcid("Valine", 'V'));
            AminoAcidList.Add(new AminoAcid("Default", 'X'));
            #endregion

            #endregion

            String NodeID = null;
            for (int NetworkNodeCount = 0; NetworkNodeCount < PeptideGivenToAgent.getPeptAminoAcids().Length; NetworkNodeCount++)
            {
                NodeID = "NetworkNode_" + (NetworkNodeCount + 1);

                for (int AminoAcidCount = 0; AminoAcidCount < AminoAcidList.Count; AminoAcidCount++)
                {
                    if (PeptideGivenToAgent.getPeptAminoAcids().ElementAt(NetworkNodeCount).getSymbol().Equals(AminoAcidList.ElementAt(AminoAcidCount).getSymbol()))
                    {
                        sensInfo.Add(World.GetDimensionValuePair(NodeID, AminoAcidList.ElementAt(AminoAcidCount).getSymbol()), MAKaey.Parameters.MAX_ACTIVATION);
                    }
                    else
                    {
                        sensInfo.Add(World.GetDimensionValuePair(NodeID, AminoAcidList.ElementAt(AminoAcidCount).getSymbol()), MAKaey.Parameters.MIN_ACTIVATION);
                    }
                }
            }
        }
Пример #2
0
 public void setModificationPeptide(Peptide ModificationPeptide)
 {
     this.ModificationPeptide = ModificationPeptide;
 }
Пример #3
0
        public static List <Peptide> getPeptideList(AminoAcid[] StandardProteinSequence, Boolean SerineChecked, Boolean ThreonineChecked, Boolean TyrosineChecked, Boolean AllChecked)
        {
            List <Peptide> peptides = new List <Peptide>();
            int            PeptIndex, SeqncIndex;

            for (int i = 0; i < StandardProteinSequence.Length; i++)
            {
                AminoAcid[] PeptAminoAcids = new AminoAcid[9];

                if (SerineChecked == true)
                {
                    if (StandardProteinSequence.ElementAt(i).getSymbol().Equals('S'))
                    {
                        PeptAminoAcids[4] = StandardProteinSequence.ElementAt(i);

                        PeptIndex  = 3;
                        SeqncIndex = (i - 1);

                        while (PeptIndex != -1)
                        {
                            if (SeqncIndex < 0)
                            {
                                PeptAminoAcids[PeptIndex] = new AminoAcid("Null", 'X');
                            }
                            else
                            {
                                PeptAminoAcids[PeptIndex] = StandardProteinSequence[SeqncIndex];
                            }

                            PeptIndex--;
                            SeqncIndex--;
                        }

                        PeptIndex  = 5;
                        SeqncIndex = (i + 1);

                        while (PeptIndex != 9)
                        {
                            if (SeqncIndex > (StandardProteinSequence.Length - 1))
                            {
                                PeptAminoAcids[PeptIndex] = new AminoAcid("Null", 'X');
                            }
                            else
                            {
                                PeptAminoAcids[PeptIndex] = StandardProteinSequence[SeqncIndex];
                            }

                            PeptIndex++;
                            SeqncIndex++;
                        }

                        Peptide peptide = new Peptide(PeptAminoAcids);
                        peptides.Add(peptide);
                    }
                }
                else if (ThreonineChecked == true)
                {
                    if (StandardProteinSequence.ElementAt(i).getSymbol().Equals('T'))
                    {
                        PeptAminoAcids[4] = StandardProteinSequence.ElementAt(i);

                        PeptIndex  = 3;
                        SeqncIndex = (i - 1);

                        while (PeptIndex != -1)
                        {
                            if (SeqncIndex < 0)
                            {
                                PeptAminoAcids[PeptIndex] = new AminoAcid("Null", 'X');
                            }
                            else
                            {
                                PeptAminoAcids[PeptIndex] = StandardProteinSequence[SeqncIndex];
                            }

                            PeptIndex--;
                            SeqncIndex--;
                        }

                        PeptIndex  = 5;
                        SeqncIndex = (i + 1);

                        while (PeptIndex != 9)
                        {
                            if (SeqncIndex > (StandardProteinSequence.Length - 1))
                            {
                                PeptAminoAcids[PeptIndex] = new AminoAcid("Null", 'X');
                            }
                            else
                            {
                                PeptAminoAcids[PeptIndex] = StandardProteinSequence[SeqncIndex];
                            }

                            PeptIndex++;
                            SeqncIndex++;
                        }

                        Peptide peptide = new Peptide(PeptAminoAcids);
                        peptides.Add(peptide);
                    }
                }
                else if (TyrosineChecked == true)
                {
                    if (StandardProteinSequence.ElementAt(i).getSymbol().Equals('Y'))
                    {
                        PeptAminoAcids[4] = StandardProteinSequence.ElementAt(i);

                        PeptIndex  = 3;
                        SeqncIndex = (i - 1);

                        while (PeptIndex != -1)
                        {
                            if (SeqncIndex < 0)
                            {
                                PeptAminoAcids[PeptIndex] = new AminoAcid("Null", 'X');
                            }
                            else
                            {
                                PeptAminoAcids[PeptIndex] = StandardProteinSequence[SeqncIndex];
                            }

                            PeptIndex--;
                            SeqncIndex--;
                        }

                        PeptIndex  = 5;
                        SeqncIndex = (i + 1);

                        while (PeptIndex != 9)
                        {
                            if (SeqncIndex > (StandardProteinSequence.Length - 1))
                            {
                                PeptAminoAcids[PeptIndex] = new AminoAcid("Null", 'X');
                            }
                            else
                            {
                                PeptAminoAcids[PeptIndex] = StandardProteinSequence[SeqncIndex];
                            }

                            PeptIndex++;
                            SeqncIndex++;
                        }

                        Peptide peptide = new Peptide(PeptAminoAcids);
                        peptides.Add(peptide);
                    }
                }
                else if (AllChecked == true)
                {
                    if (StandardProteinSequence.ElementAt(i).getSymbol().Equals('S') || StandardProteinSequence.ElementAt(i).getSymbol().Equals('T') || StandardProteinSequence.ElementAt(i).getSymbol().Equals('Y'))
                    {
                        PeptAminoAcids[4] = StandardProteinSequence.ElementAt(i);

                        PeptIndex  = 3;
                        SeqncIndex = (i - 1);

                        while (PeptIndex != -1)
                        {
                            if (SeqncIndex < 0)
                            {
                                PeptAminoAcids[PeptIndex] = new AminoAcid("Null", 'X');
                            }
                            else
                            {
                                PeptAminoAcids[PeptIndex] = StandardProteinSequence[SeqncIndex];
                            }

                            PeptIndex--;
                            SeqncIndex--;
                        }

                        PeptIndex  = 5;
                        SeqncIndex = (i + 1);

                        while (PeptIndex != 9)
                        {
                            if (SeqncIndex > (StandardProteinSequence.Length - 1))
                            {
                                PeptAminoAcids[PeptIndex] = new AminoAcid("Null", 'X');
                            }
                            else
                            {
                                PeptAminoAcids[PeptIndex] = StandardProteinSequence[SeqncIndex];
                            }

                            PeptIndex++;
                            SeqncIndex++;
                        }

                        Peptide peptide = new Peptide(PeptAminoAcids);
                        peptides.Add(peptide);
                    }
                }
            }

            return(peptides);
        }
Пример #4
0
 public ModifiedResidue(int ModificationSite, String ModifResidueName, AminoAcid ModifAminoAcid, String KineaseName, Peptide ModificationPeptide)
 {
     this.ModificationSite    = ModificationSite;
     this.ModifResidueName    = ModifResidueName;
     this.ModifAminoAcid      = ModifAminoAcid;
     this.KineaseName         = KineaseName;
     this.ModificationPeptide = ModificationPeptide;
 }
Пример #5
0
        public static List <Protein> getProteinRecordsFromTestingDataset(String Dataset_File_Path)
        {
            Excel.Application ExcelApplication = new Excel.Application();
            Excel.Workbook    ExcelWorkbook    = ExcelApplication.Workbooks.Open(Dataset_File_Path);
            Excel.Worksheet   ExcelWorksheet   = ExcelWorkbook.Sheets[2];
            Excel.Range       ExcelSheetRange  = ExcelWorksheet.UsedRange;

            int NumberOfRows   = ExcelSheetRange.Rows.Count;
            int NumberOfColumn = ExcelSheetRange.Columns.Count;

            String         ProteinID = "", ModifiedResidueName = "", AminoAcidName = "", KineaseName = "", ProteinSequence = "";
            int            ModificationSite = 0, SequenceLength = 0;
            char           Symbol   = '\0';
            List <Protein> Proteins = new List <Protein>();

            for (int RowCount = 2; RowCount <= NumberOfRows; RowCount++)
            {
                for (int ColumnCount = 1; ColumnCount <= NumberOfColumn; ColumnCount++)
                {
                    if (ExcelSheetRange.Cells[RowCount, ColumnCount] != null && ExcelSheetRange.Cells[RowCount, ColumnCount].Value2 != null)
                    {
                        switch (ColumnCount)
                        {
                        case 1:
                        {
                            ProteinID = ExcelSheetRange.Cells[RowCount, ColumnCount].Value2.ToString();
                            break;
                        }

                        case 2:
                        {
                            ModificationSite = Int32.Parse(ExcelSheetRange.Cells[RowCount, ColumnCount].Value2.ToString());
                            break;
                        }

                        case 3:
                        {
                            ModifiedResidueName = ExcelSheetRange.Cells[RowCount, ColumnCount].Value2.ToString();
                            break;
                        }

                        case 4:
                        {
                            AminoAcidName = ExcelSheetRange.Cells[RowCount, ColumnCount].Value2.ToString();
                            break;
                        }

                        case 5:
                        {
                            Symbol = char.Parse(ExcelSheetRange.Cells[RowCount, ColumnCount].Value2.ToString());
                            break;
                        }

                        case 6:
                        {
                            KineaseName = ExcelSheetRange.Cells[RowCount, ColumnCount].Value2.ToString();
                            break;
                        }

                        case 7:
                        {
                            ProteinSequence = ExcelSheetRange.Cells[RowCount, ColumnCount].Value2.ToString();
                            break;
                        }

                        case 8:
                        {
                            SequenceLength = Int32.Parse(ExcelSheetRange.Cells[RowCount, ColumnCount].Value2.ToString());
                            break;
                        }
                        }
                    }
                }

                AminoAcid       ModifAminoAcid          = new AminoAcid(AminoAcidName, Symbol);
                AminoAcid[]     StandardProteinSequence = getStandardProteinSequence(ProteinSequence);
                Peptide         ModifPeptide            = getPeptide(StandardProteinSequence, ModificationSite);
                ModifiedResidue ModifResidue            = new ModifiedResidue(ModificationSite, ModifiedResidueName, ModifAminoAcid, KineaseName, ModifPeptide);
                Protein         protein = new Protein(ProteinID, ProteinSequence, SequenceLength);
                protein.addModifiedResidue(ModifResidue);
                Proteins.Add(protein);
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();

            Marshal.ReleaseComObject(ExcelSheetRange);
            Marshal.ReleaseComObject(ExcelWorksheet);

            ExcelWorkbook.Close();
            Marshal.ReleaseComObject(ExcelWorkbook);

            ExcelApplication.Quit();
            Marshal.ReleaseComObject(ExcelApplication);

            return(Proteins);
        }