Exemplo n.º 1
0
        public void TestParallelFeatureDetection()
        {
            const string uimfFilePath         = @"\\proto-2\UnitTest_Files\MultidimensionalFeatureFinding\BSA_10ugml_IMS6_TOF03_CID_27Aug12_Frodo_Collision_Energy_Collapsed.UIMF";
            var          uimfUtil             = new UimfUtil(uimfFilePath);
            var          featureDetectionUtil = new FeatureDetectionUtil(uimfFilePath, 11, 4);
            var          minTargetBin         = uimfUtil.GetBinFromMz(500.0);
            var          maxTargetBin         = uimfUtil.GetBinFromMz(600.0);
            var          targetMzList         = Enumerable.Range(minTargetBin, maxTargetBin - minTargetBin + 1).Select(uimfUtil.GetMzFromBin).ToList();

            featureDetectionUtil.GetFeatureStatistics(targetMzList, 15, UIMFData.FrameType.MS1, DataReader.ToleranceType.PPM);
        }
Exemplo n.º 2
0
        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);
        }