Exemplo n.º 1
0
        /// <summary>
        /// Return the number of unique isolation windows in the dataset
        /// </summary>
        /// <returns></returns>
        public int GetNumUniqueIsoWindows()
        {
            var isoWindowSet = new HashSet <IsolationWindow>();

            foreach (var scanNum in ScanNumToMsLevel.Where(x => x.Value > 1).Select(x => x.Key))
            {
                if (!(GetSpectrum(scanNum) is ProductSpectrum productSpec))
                {
                    continue;
                }
                isoWindowSet.Add(productSpec.IsolationWindow);
            }
            return(isoWindowSet.Count);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get the narrowest isolation window width
        /// </summary>
        /// <returns></returns>
        public double GetMinIsolationWindowWidth()
        {
            var minWidth = Double.MaxValue;

            foreach (var scanNum in ScanNumToMsLevel.Where(x => x.Value > 1).Select(x => x.Key))
            {
                var productSpec = GetSpectrum(scanNum) as ProductSpectrum;
                if (productSpec == null)
                {
                    continue;
                }
                if (productSpec.IsolationWindow.Width < minWidth)
                {
                    minWidth = productSpec.IsolationWindow.Width;
                }
            }
            return(minWidth);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Gets the smallest scan number larger than ms2ScanNum
 /// </summary>
 /// <param name="scanNum">scan number</param>
 /// <param name="msLevel">MS level</param>
 /// <returns>next scan number at the specified level</returns>
 public int GetNextScanNum(int scanNum, int msLevel)
 {
     return(ScanNumToMsLevel.Where(x => x.Value == msLevel && x.Key > scanNum).DefaultIfEmpty(new KeyValuePair <int, int>(MaxLcScan + 1, 0)).Min(x => x.Key));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Gets the scan numbers of the specified msLevel
 /// </summary>
 /// <param name="msLevel">MS level</param>
 /// <returns>scan numbers of the specified msLevel</returns>
 public IList <int> GetScanNumbers(int msLevel)
 {
     return(ScanNumToMsLevel.Where(x => x.Value == msLevel).Select(x => x.Key).ToList());
 }
Exemplo n.º 5
0
 /// <summary>
 /// Gets the greatest scan number smaller than ms2ScanNum
 /// </summary>
 /// <param name="scanNum">scan number</param>
 /// <param name="msLevel">MS level</param>
 /// <returns>previous scan number at the specified level</returns>
 public int GetPrevScanNum(int scanNum, int msLevel)
 {
     return(ScanNumToMsLevel.Where(x => x.Value == msLevel && x.Key < scanNum).DefaultIfEmpty(new KeyValuePair <int, int>(MinLcScan - 1, 0)).Max(x => x.Key));
 }