Beispiel #1
0
 /// <summary>
 ///     Builds a peak matcher object.
 /// </summary>
 public void BuildPeakMatcher(MultiAlignAnalysisOptions options)
 {
     var tolerances = new FeatureMatcherTolerances();
     var stanleyMatcher = new STACAdapter<UMCClusterLight>
     {
         Options =
         {
             HistogramBinWidth = options.StacOptions.HistogramBinWidth,
             HistogramMultiplier = options.StacOptions.HistogramMultiplier,
             ShiftAmount = options.StacOptions.ShiftAmount,
             ShouldCalculateHistogramFDR = options.StacOptions.ShouldCalculateHistogramFDR,
             ShouldCalculateShiftFDR = options.StacOptions.ShouldCalculateShiftFDR,
             ShouldCalculateSLiC = options.StacOptions.ShouldCalculateSLiC,
             ShouldCalculateSTAC = options.StacOptions.ShouldCalculateSTAC,
             UseDriftTime = options.StacOptions.UseDriftTime,
             UseEllipsoid = options.StacOptions.UseEllipsoid,
             UsePriors = options.StacOptions.UsePriors
         }
     };
     tolerances.DriftTimeTolerance = Convert.ToSingle(options.StacOptions.DriftTimeTolerance);
     tolerances.MassTolerancePPM = options.StacOptions.MassTolerancePPM;
     tolerances.NETTolerance = options.StacOptions.NETTolerance;
     tolerances.Refined = options.StacOptions.Refined;
     stanleyMatcher.Options.UserTolerances = tolerances;
     m_provider.PeakMatcher = stanleyMatcher;
 }
Beispiel #2
0
        /// <summary>
        ///     Default constructor for a MultiAlign analysis object.
        /// </summary>
        public MultiAlignAnalysis()
        {
            // Meta Data Information about the analysis and datasets.
            MetaData = new AnalysisMetaData {AnalysisName = string.Empty};
            Options = new MultiAlignAnalysisOptions();
            MassTagDatabase = new MassTagDatabase();

            // Alignment options and data.
            AlignmentData = new List<classAlignmentData>();
            MatchResults = null;
        }
        public ClusterSettingsViewModel(MultiAlignAnalysis analysis, IProgress<int> progressReporter = null)
        {
            this.analysis = analysis;
            this.options = analysis.Options;
            this.builder = new AlgorithmBuilder();

            this.ClusterFeaturesCommand = new RelayCommand(this.AsyncClusterFeatures);
            this.DisplayClustersCommand = new RelayCommand(this.DisplayFeatures);

            this.DistanceMetrics = new ObservableCollection<DistanceMetric>();
            Enum.GetValues(typeof(DistanceMetric)).Cast<DistanceMetric>().ToList().ForEach(x => this.DistanceMetrics.Add(x));
            this.CentroidRepresentations = new ObservableCollection<ClusterCentroidRepresentation>();
            Enum.GetValues(typeof(ClusterCentroidRepresentation)).Cast<ClusterCentroidRepresentation>().ToList().ForEach(x => this.CentroidRepresentations.Add(x));
            this.ClusteringMethods = new ObservableCollection<LcmsFeatureClusteringAlgorithmType>();
            Enum.GetValues(typeof(LcmsFeatureClusteringAlgorithmType)).Cast<LcmsFeatureClusteringAlgorithmType>().ToList().ForEach(x => this.ClusteringMethods.Add(x));

        }
 private void LoadExistingParameters()
 {
     try
     {
         //TODO: Replace with OOKI dialogs
         var result = m_dialog.ShowDialog();
         if (result != null && result.Value)
         {
             var reader = new JsonReader<MultiAlignAnalysisOptions>();
             m_options = reader.Read(m_dialog.FileName);
             UpdateOptions();
         }
     }
         //TODO: Replace with appropriate exception handling
     catch (Exception)
     {
         //TODO: Display the error
     }
 }
        public AnalysisOptionsViewModel(MultiAlignAnalysisOptions options)
        {
            m_options = options;
            ClusteringAlgorithms = new ObservableCollection<LcmsFeatureClusteringAlgorithmType>();
            AlignmentAlgorithms = new ObservableCollection<FeatureAlignmentType>();
            FeatureFindingAlgorithms = new ObservableCollection<FeatureFinderType>();

            UpdateOptions();

            InstrumentPresets = new ObservableCollection<InstrumentPresetViewModel>();
            ExperimentPresets = new ObservableCollection<ExperimentPresetViewModel>();
            TimeOptions = new ObservableCollection<string>();

            var presets = new Dictionary<string, bool>();
            foreach (var preset in ExperimentPresetFactory.Create())
            {
                ExperimentPresets.Add(preset);

                if (!presets.ContainsKey(preset.InstrumentPreset.Name))
                {
                    presets.Add(preset.InstrumentPreset.Name, false);
                    InstrumentPresets.Add(preset.InstrumentPreset);
                }
            }

            foreach (var preset in InstrumentPresetFactory.Create())
            {
                if (!presets.ContainsKey(preset.Name))
                {
                    InstrumentPresets.Add(preset);
                }
            }
            TimeOptions.Add("Minutes");
            TimeOptions.Add("Scans");

            SelectedPreset = InstrumentPresets[0];
            SelectedExperimentPreset = ExperimentPresets[0];
            TreatAsTimeOrScan = TimeOptions[0];

            m_saveDialog = new SaveFileDialog();
            m_dialog = new OpenFileDialog
            {
                Filter = Resources.MultiAlignParameterFileFilter
            };
            m_saveDialog.Filter = Resources.MultiAlignParameterFileFilter;

            ShowAdvancedWindowCommand = new BaseCommand(ShowAdvancedWindow);
            SaveOptionsCommand = new BaseCommand(SaveCurrentParameters);
            LoadExistingCommand = new BaseCommand(LoadExistingParameters);

            Enum.GetValues(typeof (LcmsFeatureClusteringAlgorithmType))
                .Cast<LcmsFeatureClusteringAlgorithmType>()
                .ToList()
                .ForEach(x => ClusteringAlgorithms.Add(x));
            Enum.GetValues(typeof (FeatureAlignmentType))
                .Cast<FeatureAlignmentType>()
                .ToList()
                .ForEach(x => AlignmentAlgorithms.Add(x));
            Enum.GetValues(typeof (FeatureFinderType))
                .Cast<FeatureFinderType>()
                .ToList()
                .ForEach(x => FeatureFindingAlgorithms.Add(x));
        }
Beispiel #6
0
 /// <summary>
 ///     Returns the list of algorithms post build.
 /// </summary>
 /// <returns></returns>
 public AlgorithmProvider GetAlgorithmProvider(MultiAlignAnalysisOptions options)
 {
     BuildClusterer(LcmsFeatureClusteringAlgorithmType.AverageLinkage);
     BuildAligner(options.AlignmentOptions.LCMSWarpOptions, options.SpectralOptions);
     BuildPeakMatcher(options);
     return m_provider;
 }