Example #1
0
        private double GetSelectedIonIntensity(int scanNumber)
        {
            double mz = -1;

            _rawConnection.GetPrecursorMassForScanNum(scanNumber, 2, ref mz);
            return(GetScan(GetPrecursor(scanNumber)).MassSpectrum.GetClosestPeak(mz).Intensity);
        }
Example #2
0
        private static double GetPrecursorMz(IXRawfile5 rawFile, int scanNo, int msLevel)
        {
            double mz = 0;

            rawFile.GetPrecursorMassForScanNum(scanNo, msLevel, ref mz);
            return(mz);
        }
Example #3
0
        public override double GetPrecursorMz(int spectrumNumber, int msnOrder = 2)
        {
            double mz = double.NaN;

            _rawConnection.GetPrecursorMassForScanNum(spectrumNumber, msnOrder, ref mz);
            return(mz);
        }
Example #4
0
        public double GetPrecursorMass(int scanNum, int msOrder)
        {
            double pdPrecursorMass = 0.0;

            rawConnect.GetPrecursorMassForScanNum(scanNum, msOrder, ref pdPrecursorMass);
            return(pdPrecursorMass);
        }
Example #5
0
        /// <summary>
        /// Reads raw data. Puts spectra into a thread safe queue. Closes queue when done. Parses the rawfile-log into the statusLog object
        /// </summary>
        /// <param name="raw">Raw file</param>
        /// <param name="rawScanQueue">Thread safe queue</param>
        private void ReadRawFile(IXRawfile5 raw, BlockingCollection <RawScan> rawScanQueue)
        {
            int firstScanNumber = -1;

            raw.GetFirstSpectrumNumber(ref firstScanNumber);
            int lastScanNumber = -1;

            raw.GetLastSpectrumNumber(ref lastScanNumber);

            for (int scanNumber = firstScanNumber; scanNumber <= lastScanNumber; scanNumber++)
            {
                string scanFilter = null;
                raw.GetFilterForScanNum(scanNumber, ref scanFilter);

                //read scan header into key/value arrays
                object keyRef   = null;
                object valueRef = null;
                int    indexRef = 0;
                raw.GetTrailerExtraForScanNum(scanNumber, ref keyRef, ref valueRef, ref indexRef);
                string[] trailerKeys   = (string[])keyRef;
                string[] trailerValues = (string[])valueRef;

                //read tic and base peak mass using dummy variables
                double tic          = 0.0;
                int    int1         = 0;
                int    int2         = 0;
                int    int3         = 0;
                double double1      = 0.0;
                double double2      = 0.0;
                double double3      = 0.0;
                double basePeakMass = 0.0;
                double double5      = 0.0;
                double double6      = 0.0;
                raw.GetScanHeaderInfoForScanNum(scanNumber, ref int1, ref double1, ref double2, ref double3, ref tic, ref basePeakMass, ref double5, ref int2, ref int3, ref double6);

                //read data (mz,int,...) using dummy variables
                object labels_obj = null;
                object flags_obj  = null;
                raw.GetLabelData(ref labels_obj, ref flags_obj, ref scanNumber);
                double[,] data = (double[, ])labels_obj;

                //read precursorMz
                double precursorMz = 0.0;
                raw.GetPrecursorMassForScanNum(scanNumber, 2, ref precursorMz);

                RawScan rawScan = new RawScan(scanNumber, scanFilter, tic, trailerKeys, trailerValues, data, precursorMz, basePeakMass);
                rawScanQueue.Add(rawScan);

                //read status log
                double rtLog           = 0.0;
                object statuslogKeys   = null;
                object statuslogValues = null;
                int    statuslogN      = 0;
                raw.GetStatusLogForScanNum(scanNumber, ref rtLog, ref statuslogKeys, ref statuslogValues, ref statuslogN);
                statusLog.Add(rtLog, (string[])statuslogKeys, (string[])statuslogValues);
            }
            rawScanQueue.CompleteAdding();
            Log.Information("Read all spectra in base module");
        }