/// <summary> /// Constructor /// </summary> /// <param name="tolerance"></param> public MzComparerWithTolerance(Tolerance tolerance) { if (tolerance.GetUnit() == ToleranceUnit.Ppm) { _equalityComparer = new MzComparerWithPpmTolerance(tolerance.GetValue()); } else if (tolerance.GetUnit() == ToleranceUnit.Mz) { _equalityComparer = new MzComparerWithToleranceMz(tolerance.GetValue()); } else { throw new NotSupportedException("The tolerance unite must be ppm or Th."); } }
public FeatureSet GetFeatures(double mz, Tolerance tolerance, DataReader.FrameType frameType) { var intensityBlock = _uimfUtil.GetXic(mz, tolerance.GetValue(), frameType, tolerance.GetUnit() == ToleranceUnit.Ppm ? DataReader.ToleranceType.PPM : DataReader.ToleranceType.Thomson); var features = new FeatureSet(intensityBlock); return features; }
public Dictionary<int,FeatureSet> GetFeaturesMultiThreading(int minTargetBin, int maxTargetBin, Tolerance tolerance, DataReader.FrameType frameType) { var featureDictionary = new Dictionary<int, FeatureSet>(); var targetMzList = Enumerable.Range(minTargetBin, maxTargetBin - minTargetBin + 1).Select(targetBin => _uimfUtil.GetMzFromBin(targetBin)).ToList(); var featureStatisticsDictionary = _featureDetectionUtil.GetFeatureStatistics(targetMzList, tolerance.GetValue(), frameType, tolerance.GetUnit() == ToleranceUnit.Ppm ? DataReader.ToleranceType.PPM : DataReader.ToleranceType.Thomson); foreach (var entry in featureStatisticsDictionary) { var targetBin = _uimfUtil.GetBinFromMz(entry.Key); var featureStats = entry.Value; featureDictionary.Add(targetBin, new FeatureSet(featureStats)); } return featureDictionary; }