Пример #1
0
        /// <summary>
        /// Name:        GetParentMZ
        /// Description: This function returns the ParentIon of the current experiment (determined by m_experimentCode).
        /// </summary>
        /// <returns>
        /// Output:      This function outputs the Parent Ion in the form of a double.
        /// </returns>
        public double GetParentMZ()
        {
            clsSpectrumInfo tempInfo = new clsSpectrumInfo();

            m_fileToRead.GetSpectrumByScanNumber(this.m_experimentCode, ref tempInfo);
            return(tempInfo.ParentIonMZ);
        }
Пример #2
0
        /// <summary>
        /// This function returns an array of strings where the odd index's are intensities
        /// and even index's are mz Values.  The function takes advantage of the MSDataFileReader
        /// from PNNL.
        /// </summary>
        /// <param name="scanNum">The scan number that is used to reference the experiment Data
        /// in the currently opened File.</param>
        /// <returns></returns>
        List <Element> IExperimentParser.GetExperimentDataByScanNumber(int scanNum)
        {
            List <string>   outputValues = new List <string>();
            clsSpectrumInfo currentSpectrum;

            if (this.m_fileOpened)
            {
                //Load the entire file into memory.
                //m_fileToRead.ReadAndCacheEntireFile();

                m_fileToRead.GetSpectrumByScanNumber(scanNum, out currentSpectrum);

                List <Element> elements = new List <Element>();
                foreach (double currentMzValue in currentSpectrum.MZList)
                {
                    Element element = new Element();
                    element.Mz        = currentMzValue;
                    element.Intensity = Convert.ToDouble(currentSpectrum.LookupIonIntensityByMZ(currentMzValue, (float)0.0, (float)0.04));
                    element.Matched   = false;
                    elements.Add(element);
                }
                return(elements);
            }
            else
            {
                return(null);
            }
        }