protected List <IGlycoPeptide> MatchPoints(IPeak peak, int parentCharge)
        {
            HashSet <IGlycoPeptide> g = new HashSet <IGlycoPeptide>();

            for (int i = 1; i <= parentCharge; i++)
            {
                double mass = calculator.CalcChargeMass(peak.GetMZ(), i, option);
                BinSearchAnnotatedPoint p = new BinSearchAnnotatedPoint(mass);
                foreach (Point pt in matcher.GetSearchResult(p, parameter as BinarySearchParameter))
                {
                    g.UnionWith((pt as BinSearchAnnotatedPoint).GetGlycoPeptide());
                }
            }
            return(g.ToList());
        }
        protected void InitMatcher(IGlycoPeptide glycoPeptide)
        {
            List <Point>         points  = new List <Point>();
            List <ITableNGlycan> glycans = glycansTable[
                glycoPeptide.GetGlycan().GetName()];
            IPeptide peptide = glycoPeptide.GetPeptide();
            string   seq     = peptide.GetSequence();
            int      pos     = glycoPeptide.GetPosition();
            Dictionary <double, BinSearchAnnotatedPoint> seen =
                new Dictionary <double, BinSearchAnnotatedPoint>();

            //glycanfrag
            foreach (ITableNGlycan g in glycans)
            {
                double glycanMass = calculator.CalcGlycanMass(g, option);
                double mass       = calculator.CalcPeptideMass(seq, option) + glycanMass;
                if (!seen.ContainsKey(mass))
                {
                    BinSearchAnnotatedPoint p = new BinSearchAnnotatedPoint(mass);
                    seen[mass] = p;
                    points.Add(p);
                }
                seen[mass].AddGlycoPeptide(
                    new GeneralPeptide(peptide.GetID(), seq), g, pos);


                //n-peptidefrag
                for (int i = 0; i < pos; i++)
                {
                    mass = calculator.CalcPeptideIonMass(
                        seq.Substring(0, i + 1), IonType.cIon, option) + glycanMass;
                    if (!seen.ContainsKey(mass))
                    {
                        BinSearchAnnotatedPoint p = new BinSearchAnnotatedPoint(mass);
                        seen[mass] = p;
                        points.Add(p);
                    }

                    seen[mass].AddGlycoPeptide(
                        new GeneralPeptide(peptide.GetID(), seq.Substring(0, i + 1)),
                        g, pos);
                }
                //c-peptidefrag
                for (int i = pos + 1; i < seq.Length; i++)
                {
                    mass = calculator.CalcPeptideIonMass(
                        seq.Substring(i, seq.Length - i), IonType.zIon, option) + glycanMass;
                    if (!seen.ContainsKey(mass))
                    {
                        BinSearchAnnotatedPoint p = new BinSearchAnnotatedPoint(mass);
                        seen[mass] = p;
                        points.Add(p);
                    }

                    seen[mass].AddGlycoPeptide(
                        new GeneralPeptide(peptide.GetID(), seq.Substring(i, seq.Length - i)),
                        g, pos);
                }
            }
            points.Sort();
            matcher.SetPoints(points);
        }