Ejemplo n.º 1
0
 public BinarySpectrum(double startRt, double endRt, XYBinaryData xyData)
     : this(startRt, endRt, xyData.XValues as BinaryData, xyData.YValues as BinaryData)
 {
 }
Ejemplo n.º 2
0
        private IXYData ExtractTicByManuallyLookingAtEachSpectrumInTheFile(TimeUnit timeUnits)
        {
            if (ticCache.IsInCache())
            {
                return ticCache.Read();
            }
            else
            {
                BinaryData xVals = new BinaryData();
                BinaryData yVals = new BinaryData();

                pwiz.CLI.msdata.SpectrumList spectrumList = run.spectrumList;
                int timePoints = spectrumList.size();

                for (int i = 0; i < timePoints; i++)
                {
                    pwiz.CLI.msdata.Spectrum s = spectrumList.spectrum(i);
                    Scan scan = null;

                    if (s.scanList.scans.Count > 0)
                    {
                        scan = s.scanList.scans[0];
                    }

                    CVParam param;

                    param = s.cvParam(pwiz.CLI.CVID.MS_ms_level);
                    int msLevel = !param.empty() ? (int)param.value : 0;

                    if (msLevel <= 1)
                    {
                        param = scan != null ? scan.cvParam(pwiz.CLI.CVID.MS_scan_start_time) : new CVParam();
                        double scanTime = !param.empty() ? (double)param.value : 0;

                        // TODO: Duplicated with CalculateRT, reuse RtToTimePointConverter.
                        if (timeUnits == TimeUnit.Seconds)
                        {
                            xVals.Add(scanTime / 60);
                        }

                        param = s.cvParam(pwiz.CLI.CVID.MS_total_ion_current);
                        yVals.Add(!param.empty() ? (double)param.value : 0);
                    }
                }

                IXYData tic = new XYBinaryData(xVals, yVals);
                ticCache.Set(tic);
                return tic;
            }
        }
Ejemplo n.º 3
0
 public BinarySpectrum(double rt, XYBinaryData xyData)
     : this(rt, rt, xyData)
 {
 }