Esempio n. 1
0
        public Peak1DArray ReadSpectrumPeaks(string spectrumID)
        {
            RaiseDisposed();

            try
            {
                int sampleIndex, experimentIndex, scanIndex;
                Parse(spectrumID, out sampleIndex, out experimentIndex, out scanIndex);

                using (MassSpectrometerSample sample = batch.GetSample(sampleIndex).MassSpectrometerSample)
                    using (MSExperiment msExp = sample.GetMSExperiment(experimentIndex))
                    {
                        Clearcore2.Data.MassSpectrum ms = msExp.GetMassSpectrum(scanIndex);
                        Peak1DArray pa = new Peak1DArray(
                            BinaryDataCompressionType.NoCompression,
                            BinaryDataType.Float32,
                            BinaryDataType.Float32);

                        //Peak1D[] peaks = new Peak1D[ms.NumDataPoints];

                        //for (int i = 0; i < ms.NumDataPoints; i++)
                        //    peaks[i] = new Peak1D(ms.GetYValue(i), ms.GetXValue(i));

                        //pa.Peaks = MzLiteArray.ToMzLiteArray(peaks);

                        pa.Peaks = new WiffPeaksArray(ms);

                        return(pa);
                    }
            }
            catch (Exception ex)
            {
                throw new MzLiteIOException(ex.Message, ex);
            }
        }
Esempio n. 2
0
 private static IEnumerable <Peak1D> Yield(Clearcore2.Data.MassSpectrum wiffSpectrum)
 {
     for (int i = 0; i < wiffSpectrum.NumDataPoints; i++)
     {
         yield return(new Peak1D(
                          wiffSpectrum.GetYValue(i),
                          wiffSpectrum.GetXValue(i)));
     }
 }
Esempio n. 3
0
 internal WiffPeaksArray(Clearcore2.Data.MassSpectrum wiffSpectrum)
 {
     this.wiffSpectrum = wiffSpectrum;
 }