Exemple #1
0
        public void TestCanLossWater()
        {
            foreach (char c in new Aminoacids().GetVisibleAminoacids())
            {
                switch (c)
                {
                case 'S':
                case 'T':
                case 'E':
                case 'D':
                    Assert.IsTrue(NeutralLossUtils.CanLossWater(c));
                    break;

                default:
                    Assert.IsFalse(NeutralLossUtils.CanLossWater(c));
                    break;
                }
            }
        }
        public NeutralLossCandidates(string peptide)
        {
            canLossWater   = true;
            canLossAmmonia = false;

            string pureSeq = PeptideUtils.GetPureSequence(peptide);

            bLossWater   = new bool[pureSeq.Length];
            bLossAmmonia = new bool[pureSeq.Length];
            yLossWater   = new bool[pureSeq.Length];
            yLossAmmonia = new bool[pureSeq.Length];

            for (int i = 0; i < pureSeq.Length; i++)
            {
                if (NeutralLossUtils.CanLossWater(pureSeq[i]))
                {
                    for (int j = i; j < pureSeq.Length; j++)
                    {
                        bLossWater[j] = true;
                    }
                    break;
                }
                bLossWater[i] = false;
            }

            for (int i = pureSeq.Length - 1; i >= 0; i--)
            {
                if (NeutralLossUtils.CanLossWater(pureSeq[i]))
                {
                    for (int j = i; j >= 0; j--)
                    {
                        yLossWater[pureSeq.Length - 1 - j] = true;
                    }
                    break;
                }
                yLossWater[pureSeq.Length - 1 - i] = false;
            }

            for (int i = 0; i < pureSeq.Length; i++)
            {
                if (NeutralLossUtils.CanLossAmmonia(pureSeq[i]))
                {
                    for (int j = i; j < pureSeq.Length; j++)
                    {
                        bLossAmmonia[j] = true;
                        canLossAmmonia  = true;
                    }
                    break;
                }
                bLossAmmonia[i] = false;
            }

            for (int i = pureSeq.Length - 1; i >= 0; i--)
            {
                if (NeutralLossUtils.CanLossAmmonia(pureSeq[i]))
                {
                    for (int j = i; j >= 0; j--)
                    {
                        yLossAmmonia[pureSeq.Length - 1 - j] = true;
                    }
                    break;
                }
                yLossAmmonia[pureSeq.Length - 1 - i] = false;
            }
        }