private void CreateDatabase()
        {
            if (!IsDatabaseSaved)
            {
                var saveDatabaseDialog = new SaveFileDialog();
                saveDatabaseDialog.Filter = "Mass Tag Database (*.mtdb)|*.mtdb|All Files (*.*)|*.*";
                saveDatabaseDialog.Title  = "Save to MTDB";
                if (RestoreDirectory == null)
                {
                    RestoreDirectory = "C:\\";
                }
                saveDatabaseDialog.InitialDirectory = RestoreDirectory;
                saveDatabaseDialog.RestoreDirectory = true;

                if (saveDatabaseDialog.ShowDialog() == true)
                {
                    AnalysisJobViewModel.SaveAnalysisDatabase(saveDatabaseDialog.FileName);
                }
                if (saveDatabaseDialog.FileName != "")
                {
                    RestoreDirectory  = Path.GetDirectoryName(saveDatabaseDialog.FileName);
                    SavedDatabasePath = saveDatabaseDialog.FileName;
                    IsDatabaseSaved   = true;
                }
            }
            else
            {
                var message = string.Format("Database already saved to {0}", SavedDatabasePath);
                MessageBox.Show(message, "", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
示例#2
0
 public TargetTreeViewModel(AnalysisJobViewModel analysisJobViewModel)
 {
     m_targetDatabaseTreeNodeViewModels = new List <TargetDatabaseTreeNodeViewModel> {
         new TargetDatabaseTreeNodeViewModel(analysisJobViewModel.Database)
     };
     m_proteinDatabaseTreeNodeViewModels = new List <ProteinDatabaseTreeNodeViewModel> {
         new ProteinDatabaseTreeNodeViewModel(analysisJobViewModel.Database)
     };
     m_searchFilter = "";
 }
        private void Refresh()
        {
            if (AnalysisJobViewModel.Options.OptionsChanged)
            {
                MessageBoxResult refreshResult = MessageBox.Show(RefreshBoxText,
                                                                 RefreshBoxCaption,
                                                                 RefreshBoxButton,
                                                                 RefreshBoxImage);
                if (refreshResult == MessageBoxResult.Yes)
                {
                    AnalysisJobViewModel.ProcessAnalysisTargets();
                    AnalysisJobViewModel.ProcessAnalysisDatabase();

                    UpdateDataViewModels();
                    AnalysisJobViewModel.Options.OptionsChanged = false;
                }
            }
            else
            {
                MessageBox.Show("Datasets already current. \nNo need to refresh processing.", "", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
        public StatPlotViewModel(AnalysisJobViewModel analysisJobViewModel)
        {
            StdevMassPlotModel = MakePlotModel("Stdev Mass");
            StdevNetPlotModel  = MakePlotModel("Stdev NET");

            foreach (var axis in StdevMassPlotModel.Axes)
            {
                switch (axis.Position)
                {
                case AxisPosition.Left:
                    axis.Title = "Count";
                    break;

                case AxisPosition.Bottom:
                    axis.Title = "Mass";
                    break;
                }
            }

            StdevMassPlotModel.Series.Add(MakeStdevMassScatterSeries(analysisJobViewModel.Database));

            foreach (var axis in StdevNetPlotModel.Axes)
            {
                switch (axis.Position)
                {
                case AxisPosition.Left:
                    axis.Title = "Count";
                    break;

                case AxisPosition.Bottom:
                    axis.Title = "NET";
                    break;
                }
            }

            StdevMassPlotModel.Series.Add(MakeStdevMassScatterSeries(analysisJobViewModel.Database));
            StdevNetPlotModel.Series.Add(MakeStdevNetScatterSeries(analysisJobViewModel.Database));
        }
 public void UpdatePlotViewModel(AnalysisJobViewModel analysisJobViewModel)
 {
     AnalysisJobViewModel = analysisJobViewModel;
 }
        public DatasetPlotViewModel(AnalysisJobViewModel analysisJobViewModel)
        {
            m_SeriesColorDictionary = new Dictionary <string, Color>();
            m_plotModels            = new List <PlotModel>();

            NETScanPlotModel = new PlotModel
            {
                Title                 = "Observed NET Vs. Scan",
                IsLegendVisible       = true,
                LegendTitle           = "LEGEND",
                LegendPosition        = LegendPosition.RightMiddle,
                LegendPlacement       = LegendPlacement.Outside,
                LegendOrientation     = LegendOrientation.Vertical,
                LegendBorder          = OxyColors.Black,
                LegendSymbolPlacement = LegendSymbolPlacement.Left,
                LegendBackground      = OxyColors.Transparent,
            };

            NETScanPlotModel.Axes.Add(MakeLinerAxis(AxisPosition.Left));
            NETScanPlotModel.Axes.Add(MakeLinerAxis(AxisPosition.Bottom));

            foreach (var axis in NETScanPlotModel.Axes)
            {
                switch (axis.Position)
                {
                case AxisPosition.Left:
                    axis.Title           = "Observed NET";
                    axis.AbsoluteMinimum = 0;
                    break;

                case AxisPosition.Bottom:
                    axis.Title           = "Scan";
                    axis.AbsoluteMinimum = 0;
                    break;
                }
            }
            m_plotModels.Add(NETScanPlotModel);

            MassScanPlotModel = new PlotModel
            {
                Title                 = "Monoisotopic Mass Vs. Scan",
                IsLegendVisible       = true,
                LegendTitle           = "LEGEND",
                LegendPosition        = LegendPosition.RightMiddle,
                LegendPlacement       = LegendPlacement.Outside,
                LegendOrientation     = LegendOrientation.Vertical,
                LegendBorder          = OxyColors.Black,
                LegendSymbolPlacement = LegendSymbolPlacement.Left,
                LegendBackground      = OxyColors.Transparent,
            };

            MassScanPlotModel.Axes.Add(MakeLinerAxis(AxisPosition.Left));
            MassScanPlotModel.Axes.Add(MakeLinerAxis(AxisPosition.Bottom));

            foreach (var axis in MassScanPlotModel.Axes)
            {
                switch (axis.Position)
                {
                case AxisPosition.Left:
                    axis.Title = "MonoisotopicMass";
                    break;

                case AxisPosition.Bottom:
                    axis.Title           = "Scan";
                    axis.AbsoluteMinimum = 0;
                    break;
                }
            }
            m_plotModels.Add(MassScanPlotModel);

            ObservedPredictedPlotModel = new PlotModel
            {
                Title                 = "Predicted Net Vs. Observed Net",
                IsLegendVisible       = true,
                LegendTitle           = "LEGEND",
                LegendPosition        = LegendPosition.RightMiddle,
                LegendPlacement       = LegendPlacement.Outside,
                LegendOrientation     = LegendOrientation.Vertical,
                LegendBorder          = OxyColors.Black,
                LegendSymbolPlacement = LegendSymbolPlacement.Left,
                LegendBackground      = OxyColors.Transparent,
            };

            ObservedPredictedPlotModel.Axes.Add(MakeLinerAxis(AxisPosition.Left));
            ObservedPredictedPlotModel.Axes.Add(MakeLinerAxis(AxisPosition.Bottom));

            foreach (var axis in ObservedPredictedPlotModel.Axes)
            {
                switch (axis.Position)
                {
                case AxisPosition.Left:
                    axis.Title = "Predicted Net";
                    break;

                case AxisPosition.Bottom:
                    axis.Title           = "Observed Net";
                    axis.AbsoluteMinimum = 0;
                    break;
                }
            }
            m_plotModels.Add(ObservedPredictedPlotModel);
            UpdatePlotViewModel(analysisJobViewModel);
        }
        public WorkspaceViewModel(AnalysisJobViewModel analysisJobViewModel)
        {
            AnalysisJobViewModel = analysisJobViewModel;

            UpdateDataViewModels();
        }