public AnalysisViewModel(MultiAlignAnalysis analysis) { m_showDriftTime = false; LoadDatasets(analysis); // Create matching clusters and AMT Matches. var matches = analysis.DataProviders.MassTagMatches.FindAll(); var clusters = analysis.Clusters.MapMassTagsToClusters(matches, analysis.MassTagDatabase); // Cache the clusters so that they can be readily accessible later on. // This will help speed up performance, so that we dont have to hit the database // when we want to find matching mass tags, and dont have to map clusters to tags multiple times. FeatureCacheManager<UMCClusterLightMatched>.SetFeatures(clusters.Item1); FeatureCacheManager<MassTagToCluster>.SetFeatures(clusters.Item2); SingletonDataProviders.Providers = analysis.DataProviders; // Create sub-view models MassTags = new ObservableCollection<MassTagToCluster>(clusters.Item2); ClusterTree = new UmcClusterCollectionTreeViewModel(clusters.Item1); ClusterSpectraViewModel = new UmcClusterSpectraViewModel(); ClusterIdentificationViewModel = new UMCClusterIdentificationViewModel(); AnalysisOptionsViewModel = new AnalysisOptionsViewModel(analysis.Options); ClusterViewModel = new ClusterDetailViewModel(); var charges = SingletonDataProviders.Providers.FeatureCache.RetrieveChargeStates(); GlobalStatisticsViewModel = new GlobalStatisticsViewModel(clusters.Item1, charges); HasIdentifications = (MassTags.Count > 0); SelectedClusterName = "Cluster Details:"; LoadClusters(clusters.Item1); ApplyViewAsFilter = new BaseCommand(FilterFromView); }
private void SetupViewModels(AnalysisConfig configuration) { m_config = configuration; CurrentStep = AnalysisSetupStep.DatasetSelection; CancelCommand = new AnalysisCancelCommand(this); BackCommand = new AnalysisBackCommand(this); NextCommand = new AnalysisNextCommand(this); DatasetSelectionViewModel = new AnalysisDatasetSelectionViewModel(configuration.Analysis); BaselineSelectionViewModel = new AnalysisBaselineSelectionViewModel(configuration.Analysis); AnalysisNamingViewModel = new AnalysisNamingViewModel(configuration); AnalysisOptionsViewModel = new AnalysisOptionsViewModel(configuration.Analysis.Options); }