public MsScan(int scanNumber, XRawFileIO reader)
        {
            ScanNumber = scanNumber;

            if (!reader.GetScanInfo(scanNumber, out var scanInfo))
            {
                ConsoleMsgUtils.ShowWarning("Scan {0} not found in {1}", scanNumber, Path.GetFileName(reader.RawFilePath));
                return;
            }

            // Get centroided data
            var dataPointCount = GetScanData(reader, scanInfo, out var mzList, out var intensityList);

            MsLevel    = scanInfo.MSLevel;
            PeaksCount = dataPointCount;

            switch (scanInfo.IonMode)
            {
            case IonModeConstants.Positive:
                Polarity = "+";
                break;

            case IonModeConstants.Negative:
                Polarity = "-";
                break;

            case IonModeConstants.Unknown:
                Polarity = string.Empty;
                break;
            }

            FilterLine = scanInfo.FilterText;
            ScanType   = GetScanType();

            RetentionTime = "PT" + Math.Round(scanInfo.RetentionTime * 60, 8) + "S";
            TotIonCurrent = scanInfo.TotalIonCurrent;

            string encodedPeaks;

            if (PeaksCount == 0)
            {
                LowMz             = 0;
                HighMz            = 0;
                BasePeakMz        = 0;
                BasePeakIntensity = 0;

                encodedPeaks = Base64EncodeMsData(mzList, intensityList);
            }
            else
            {
                LowMz             = mzList.Min();
                HighMz            = mzList.Max();
                BasePeakMz        = scanInfo.BasePeakMZ;
                BasePeakIntensity = scanInfo.BasePeakIntensity;

                encodedPeaks = Base64EncodeMsData(mzList, intensityList);
            }

            PeakData = new Peaks(32, "network", "m/z-int", "none", 0, encodedPeaks);
        }
 public MsScan(int scanNumber, int msLevel, int peaksCount, string polarity, string scanType, string filterLine, string retentionTime, double lowMz, double highMz,
               double basePeakMz, double basePeakIntensity, double totIonCurrent, Peaks peakData)
 {
     ScanNumber        = scanNumber;
     MsLevel           = msLevel;
     PeaksCount        = peaksCount;
     Polarity          = polarity;
     ScanType          = scanType;
     FilterLine        = filterLine;
     RetentionTime     = retentionTime;
     LowMz             = lowMz;
     HighMz            = highMz;
     BasePeakMz        = basePeakMz;
     BasePeakIntensity = basePeakIntensity;
     TotIonCurrent     = totIonCurrent;
     PeakData          = peakData;
 }
 private Ms1Scan(int num, int msLevel, int peaksCount, string polarity, string scanType, string filterLine, string retentionTime, double lowMz, double highMz,
                 double basePeakMz, double basePeakIntensity, double totIonCurrent, Peaks peakData) : base(num, msLevel, peaksCount, polarity, scanType, filterLine,
                                                                                                           retentionTime, lowMz, highMz, basePeakMz, basePeakIntensity, totIonCurrent, peakData)
 {
     ScanNumber        = num;
     MsLevel           = msLevel;
     PeaksCount        = peaksCount;
     Polarity          = polarity;
     ScanType          = scanType;
     FilterLine        = filterLine;
     RetentionTime     = retentionTime;
     LowMz             = lowMz;
     HighMz            = highMz;
     BasePeakMz        = basePeakMz;
     BasePeakIntensity = basePeakIntensity;
     TotIonCurrent     = totIonCurrent;
     PeakData          = peakData;
 }