protected void WritePeak(StreamWriter writer, PeakList <T> pl)
        {
            PeakList <T> pkl;

            //Mascot Generic Format 要求每个spectrum不能超过10000个离子。
            if (pl.Count > 10000)
            {
                pkl = new PeakList <T>(pl);
                pkl.SortByIntensity();
                pkl.RemoveRange(10000, pkl.Count - 10000);
                pkl.SortByMz();
            }
            else
            {
                pkl = pl;
            }

            //if (pkl.Any(m => m.Charge > 0))
            //{
            //  foreach (T peak in pkl)
            //  {
            //    writer.WriteLine(MyConvert.Format("{0:0.#####} {1:0.0} {2}", peak.Mz, peak.Intensity, peak.Charge));
            //  }
            //}
            //else
            //{
            foreach (T peak in pkl)
            {
                writer.WriteLine(MyConvert.Format("{0:0.#####} {1:0.0###}", peak.Mz, peak.Intensity));
            }
            //}

            writer.WriteLine(MascotGenericFormatConstants.END_PEAK_LIST_TAG);
            writer.WriteLine();
        }