Пример #1
0
 private string MutateSequence(string argSequence, enumPeptideMutation argMutation)
 {
     if (argMutation == enumPeptideMutation.NoMutation)
     {
         return(argSequence);
     }
     else if (argMutation == enumPeptideMutation.DtoN)
     {
         StringBuilder sb = new StringBuilder(argSequence);
         foreach (
             Match match in Regex.Matches(argSequence, "D[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase))
         //DXS DXT  X!=P
         {
             sb.Remove(match.Index, 1);
             sb.Insert(match.Index, "N");
         }
         return(sb.ToString());
     }
     else //(argMutation == enumPeptideMutation.AnyToN)
     {
         StringBuilder sb = new StringBuilder(argSequence);
         foreach (
             Match match in Regex.Matches(argSequence, "[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase))
         //XS XT  X!=P
         {
             if (match.Index == 0)
             {
                 continue;
             }
             sb.Remove(match.Index - 1, 1);
             sb.Insert(match.Index - 1, "N");
         }
         return(sb.ToString());
     }
 }
Пример #2
0
 public List<string> CreateCleavedNGlycoPeptides(int argAllowMissCleavage, List<Protease.Type> argProteaseType, enumPeptideMutation argMutation)
 {
     _misscleavaged = argAllowMissCleavage;
     List<string> glycopeptides  = new List<string>();
     foreach (ProteinInfo prot in _proteinInfo)
     {
        glycopeptides.AddRange(prot.NGlycopeptide(_misscleavaged, argProteaseType, argMutation));
     }
     return glycopeptides;
 }
Пример #3
0
        private void btnReadFasta_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                List<Protease.Type> ProteaseType = new List<Protease.Type>();

                if (chkEnzy_Trypsin.Checked)//Trypsin
                {
                    ProteaseType.Add(Protease.Type.Trypsin);
                }
                if (chkEnzy_GlucE.Checked)//GlucE
                {
                    ProteaseType.Add(Protease.Type.GlucE);
                }
                if (chkEnzy_GlucED.Checked) //GlucED
                {
                    ProteaseType.Add(Protease.Type.GlucED);
                }
                if (chkEnzy_None.Checked || ProteaseType.Count == 0)
                {
                    ProteaseType.Add(Protease.Type.None);
                }

                enumPeptideMutation pepMuta = enumPeptideMutation.NoMutation;
                if (cboPepMutation.SelectedIndex == 1)
                {
                    pepMuta = enumPeptideMutation.DtoN;
                }
                else if (cboPepMutation.SelectedIndex == 2)
                {
                    pepMuta = enumPeptideMutation.AnyToN;
                }


                string fastaFile = openFileDialog1.FileName;
                FastaFile file = new FastaFile(fastaFile);
                List<string> Peptides = file.CreateCleavedPeptides(Convert.ToInt32(txtMissCleavage.Text), ProteaseType);
                txtPeptides.Text = "Digested Peptides" + Environment.NewLine + Environment.NewLine;
                foreach (string p in Peptides)
                {
                    txtPeptides.Text += p + Environment.NewLine;

                }
                txtPeptides.Text += Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine;
                txtPeptides.Text += "N-linked Peptides" + Environment.NewLine + Environment.NewLine;
                List<string> lstPeptides = file.CreateCleavedNGlycoPeptides(Convert.ToInt32(txtMissCleavage.Text), ProteaseType, pepMuta);
                foreach (string p in lstPeptides)
                {
                    txtPeptides.Text += p + Environment.NewLine;

                }
            }
        }
Пример #4
0
        /// <summary>
        /// Old function, no use anymore
        /// </summary>
        /// <param name="argSequence"></param>
        /// <param name="argMutation"></param>
        /// <param name="lstGlycopeptideSeq"></param>
        /// <returns></returns>
        public bool IsGlycopeptide(string argSequence, enumPeptideMutation argMutation, out List <string> lstGlycopeptideSeq)
        {
            List <string> _glycopep = new List <string>();
            Regex         sequon    = new Regex("N[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase); //NXS NXT  X!=P
            Regex         sequonEnd = new Regex("N[ARNDCEQGHILKMFSTWYV]$", RegexOptions.IgnoreCase);     //NX NX  X!=P in the end
            Match         Sequon    = sequon.Match(argSequence);

            if (Sequon.Length != 0)
            {
                _glycopep.Add(argSequence);
            }

            Match SequonEnd = sequonEnd.Match(argSequence); //Go to full sequence to check if the sequence contain S/T

            if (SequonEnd.Length != 0)
            {
                int idx = _sequence.IndexOf(argSequence) + argSequence.Length;
                if (idx < _sequence.Length)
                {
                    if (_sequence[idx] == 'S' || _sequence[idx] == 'T')
                    {
                        _glycopep.Add(argSequence);
                    }
                }
            }

            if (argMutation == enumPeptideMutation.DtoN)
            {
                Regex sequonMutaDN    = new Regex("D[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase); //DXS DXT  X!=P
                Regex sequonMutaDNEnd = new Regex("D[ARNDCEQGHILKMFSTWYV]$", RegexOptions.IgnoreCase);     //DX DX  X!=P in the end

                foreach (Match SequonMutaDN in sequonMutaDN.Matches(argSequence))
                {
                    if (SequonMutaDN.Length != 0)
                    {
                        StringBuilder sb = new StringBuilder(argSequence);
                        sb.Remove(SequonMutaDN.Index, 1);
                        sb.Insert(SequonMutaDN.Index, "N");
                        _glycopep.Add(sb.ToString());
                    }
                }


                Match SequonMutaDNEnd = sequonMutaDNEnd.Match(argSequence); //Go to full sequence to check if the sequence contain S/T
                if (SequonMutaDNEnd.Length != 0)
                {
                    int idx = _sequence.IndexOf(argSequence) + argSequence.Length;
                    if (idx < _sequence.Length)
                    {
                        if ((_sequence[idx] == 'S' || _sequence[idx] == 'T'))
                        {
                            StringBuilder sb = new StringBuilder(argSequence);
                            sb.Remove(SequonMutaDNEnd.Index, 1);
                            sb.Insert(SequonMutaDNEnd.Index, "N");
                            _glycopep.Add(sb.ToString());
                        }
                    }
                }
            }
            else if (argMutation == enumPeptideMutation.AnyToN)
            {
                foreach (Match match in Regex.Matches(argSequence, "[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase))
                {
                    int IndexInOriginalSequence = _sequence.IndexOf(match.Value);
                    if (IndexInOriginalSequence == 0)
                    {
                        continue;
                    }
                    StringBuilder sb = new StringBuilder(argSequence);
                    sb.Remove(match.Index - 1, 1);
                    sb.Insert(match.Index - 1, "N");
                    if (!_glycopep.Contains(sb.ToString()))
                    {
                        _glycopep.Add(sb.ToString());
                    }
                }
                if (argSequence[argSequence.Length - 1] != 'P')
                {
                    int idx = _sequence.IndexOf(argSequence) + argSequence.Length;
                    if (idx < _sequence.Length)
                    {
                        if ((_sequence[idx] == 'S' || _sequence[idx] == 'T'))
                        {
                            StringBuilder sb = new StringBuilder(argSequence);
                            sb.Remove(argSequence.Length - 2, 1);
                            sb.Insert(argSequence.Length - 2, "N");
                            _glycopep.Add(sb.ToString());
                        }
                    }
                }
            }
            lstGlycopeptideSeq = _glycopep;
            if (lstGlycopeptideSeq.Count == 0)
            {
                return(false);
            }
            return(true);
        }
Пример #5
0
        public List <string> NGlycopeptide(int argAllowMissCleavage, List <Protease.Type> argProteaseType, enumPeptideMutation argMutation)
        {
            string        MutatedPeptide = MutateSequence(_sequence, argMutation);
            List <string> _cleavages     = CreateCleavage(MutatedPeptide, argAllowMissCleavage, argProteaseType);
            List <string> _glycopep      = new List <string>();

            foreach (string pep in _cleavages)
            {
                foreach (Match match in Regex.Matches(pep, "N[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase))
                {
                    if (!_glycopep.Contains(pep))
                    {
                        _glycopep.Add(pep);
                    }
                }
            }
            return(_glycopep);
        }
Пример #6
0
        /// <summary>
        /// Old function, no use anymore
        /// </summary>
        /// <param name="argSequence"></param>
        /// <param name="argMutation"></param>
        /// <param name="lstGlycopeptideSeq"></param>
        /// <returns></returns>
        public bool IsGlycopeptide(string argSequence, enumPeptideMutation argMutation, out List<string> lstGlycopeptideSeq)
        {
            List<string> _glycopep = new List<string>();
            Regex sequon = new Regex("N[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase);  //NXS NXT  X!=P
            Regex sequonEnd = new Regex("N[ARNDCEQGHILKMFSTWYV]$", RegexOptions.IgnoreCase);  //NX NX  X!=P in the end
            Match Sequon = sequon.Match(argSequence);
            if (Sequon.Length != 0)
            {
                _glycopep.Add(argSequence);
            }

            Match SequonEnd = sequonEnd.Match(argSequence); //Go to full sequence to check if the sequence contain S/T
            if (SequonEnd.Length != 0)
            {
                int idx = _sequence.IndexOf(argSequence) + argSequence.Length;
                if (idx < _sequence.Length)
                {
                    if (_sequence[idx] == 'S' || _sequence[idx] == 'T')
                    {
                        _glycopep.Add(argSequence);
                    }
                }
            }

            if (argMutation == enumPeptideMutation.DtoN)
            {
                Regex sequonMutaDN = new Regex("D[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase);  //DXS DXT  X!=P
                Regex sequonMutaDNEnd = new Regex("D[ARNDCEQGHILKMFSTWYV]$", RegexOptions.IgnoreCase);  //DX DX  X!=P in the end

                foreach (Match SequonMutaDN in sequonMutaDN.Matches(argSequence))
                {
                    if (SequonMutaDN.Length != 0)
                    {
                        StringBuilder sb = new StringBuilder(argSequence);
                        sb.Remove(SequonMutaDN.Index, 1);
                        sb.Insert(SequonMutaDN.Index, "N");
                        _glycopep.Add(sb.ToString());
                    }
                }

                Match SequonMutaDNEnd = sequonMutaDNEnd.Match(argSequence); //Go to full sequence to check if the sequence contain S/T
                if (SequonMutaDNEnd.Length != 0)
                {
                    int idx = _sequence.IndexOf(argSequence) + argSequence.Length;
                    if (idx < _sequence.Length)
                    {
                        if ((_sequence[idx] == 'S' || _sequence[idx] == 'T'))
                        {
                            StringBuilder sb = new StringBuilder(argSequence);
                            sb.Remove(SequonMutaDNEnd.Index, 1);
                            sb.Insert(SequonMutaDNEnd.Index, "N");
                            _glycopep.Add(sb.ToString());
                        }
                    }
                }

            }
            else if (argMutation == enumPeptideMutation.AnyToN)
            {
                foreach (Match match in Regex.Matches(argSequence, "[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase))
                {
                    int IndexInOriginalSequence = _sequence.IndexOf(match.Value);
                    if (IndexInOriginalSequence == 0)
                    {
                        continue;
                    }
                    StringBuilder sb = new StringBuilder(argSequence);
                    sb.Remove(match.Index - 1, 1);
                    sb.Insert(match.Index - 1, "N");
                    if (!_glycopep.Contains(sb.ToString()))
                    {
                        _glycopep.Add(sb.ToString());
                    }
                }
                if (argSequence[argSequence.Length - 1] != 'P')
                {
                    int idx = _sequence.IndexOf(argSequence) + argSequence.Length;
                    if (idx < _sequence.Length)
                    {
                        if ((_sequence[idx] == 'S' || _sequence[idx] == 'T'))
                        {
                            StringBuilder sb = new StringBuilder(argSequence);
                            sb.Remove(argSequence.Length-2, 1);
                            sb.Insert(argSequence.Length-2, "N");
                            _glycopep.Add(sb.ToString());
                        }
                    }
                }

            }
            lstGlycopeptideSeq = _glycopep;
            if (lstGlycopeptideSeq.Count == 0)
            {
                return false;
            }
            return true;
        }
Пример #7
0
 private string MutateSequence(string argSequence, enumPeptideMutation argMutation)
 {
     if (argMutation == enumPeptideMutation.NoMutation)
     {
         return argSequence;
     }
     else if (argMutation == enumPeptideMutation.DtoN)
     {
         StringBuilder sb = new StringBuilder(argSequence);
         foreach (
             Match match in Regex.Matches(argSequence, "D[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase))
             //DXS DXT  X!=P
         {
             sb.Remove(match.Index, 1);
             sb.Insert(match.Index, "N");
         }
         return sb.ToString();
     }
     else //(argMutation == enumPeptideMutation.AnyToN)
     {
         StringBuilder sb = new StringBuilder(argSequence);
         foreach (
             Match match in Regex.Matches(argSequence, "[ARNDCEQGHILKMFSTWYV][S|T]", RegexOptions.IgnoreCase))
         //XS XT  X!=P
         {
             if (match.Index == 0)
             {
                 continue;
             }
             sb.Remove(match.Index-1, 1);
             sb.Insert(match.Index-1, "N");
         }
         return sb.ToString();
     }
 }
Пример #8
0
        public List<string> NGlycopeptide(int argAllowMissCleavage, List<Protease.Type> argProteaseType, enumPeptideMutation argMutation)
        {
            List<string> _glycopep = new List<string>();

            //Native Part
            List<string> _cleavages = CreateCleavage(_sequence, argAllowMissCleavage, argProteaseType);
            foreach (string pep in _cleavages)
            {
                if (ContainSequon(pep) && !_glycopep.Contains(pep))
                {
                    _glycopep.Add(pep);
                }
            }
            //Mutation Part
            string MutatedPeptide = MutateSequence(_sequence,argMutation);
               _cleavages = CreateCleavage(MutatedPeptide,argAllowMissCleavage, argProteaseType);

            foreach (string pep in _cleavages)
            {
                if (ContainSequon(pep) && !_glycopep.Contains(pep))
                {
                    _glycopep.Add(pep);
                }
            }

            return _glycopep;
        }
Пример #9
0
        public List <string> CreateCleavedNGlycoPeptides(int argAllowMissCleavage, List <Protease.Type> argProteaseType, enumPeptideMutation argMutation)
        {
            _misscleavaged = argAllowMissCleavage;
            List <string> glycopeptides = new List <string>();

            foreach (ProteinInfo prot in _proteinInfo)
            {
                glycopeptides.AddRange(prot.NGlycopeptide(_misscleavaged, argProteaseType, argMutation));
            }
            return(glycopeptides);
        }
Пример #10
0
        public List <string> NGlycopeptide(int argAllowMissCleavage, List <Protease.Type> argProteaseType, enumPeptideMutation argMutation)
        {
            List <string> _glycopep = new List <string>();

            //Native Part
            List <string> _cleavages = CreateCleavage(_sequence, argAllowMissCleavage, argProteaseType);

            foreach (string pep in _cleavages)
            {
                if (ContainSequon(pep) && !_glycopep.Contains(pep))
                {
                    _glycopep.Add(pep);
                }
            }
            //Mutation Part
            string MutatedPeptide = MutateSequence(_sequence, argMutation);

            _cleavages = CreateCleavage(MutatedPeptide, argAllowMissCleavage, argProteaseType);


            foreach (string pep in _cleavages)
            {
                if (ContainSequon(pep) && !_glycopep.Contains(pep))
                {
                    _glycopep.Add(pep);
                }
            }

            return(_glycopep);
        }