private SelectionInfo GetSelectionInfo <TEl>(int rowIndex, SimpleGridViewDriver <TEl> driver, Func <TEl, SelectionInfo> getInfo)
        {
            if (0 > rowIndex || rowIndex >= driver.Items.Count)
            {
                return(null);
            }

            var match = driver.Items[rowIndex];

            return(getInfo(match));
        }
        public ComparePeakPickingDlg(SrmDocument document)
        {
            InitializeComponent();

            Icon = Resources.Skyline;

            _axisLabelScaler = new AxisLabelScaler(zedGraphFiles.GraphPane);
            _colors          =
                Settings.Default.ColorSchemes.GetDefaults()
                .First(s => s.Name == Resources.ColorSchemeList_GetDefaults_Distinct)
                .TransitionColors;

            DocumentUiContainer = Program.MainWindow;
            Document            = document;

            _peakBoundaryList    = new ComparePeakBoundariesList();
            _scoreGridViewDriver = new ComparePeakBoundariesGridViewDriver(dataGridViewScore,
                                                                           bindingSourceScore, new SortableBindingList <PeakBoundsMatch>());
            _compareGridViewDriver = new ComparePeakBoundariesPairGridViewDriver(dataGridViewScoreComparison,
                                                                                 bindingSourceScoreCompare, new SortableBindingList <PeakBoundsMatchPair>());

            // Hide borders for better copy-paste images
            zedGraphRoc.MasterPane.Border.IsVisible   = false;
            zedGraphRoc.GraphPane.Border.IsVisible    = false;
            zedGraphQq.MasterPane.Border.IsVisible    = false;
            zedGraphQq.GraphPane.Border.IsVisible     = false;
            zedGraphFiles.MasterPane.Border.IsVisible = false;
            zedGraphFiles.GraphPane.Border.IsVisible  = false;

            // Intialize the y-axis selector combo box
            var yAxisOptions = new[]
            {
                Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Total_Correct_Peaks,
                Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Fraction_of_Manual_ID_s,
                Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Fraction_of_Peak_Groups
            };

            comboBoxYAxis.Items.AddRange(yAxisOptions);
            comboBoxYAxis.SelectedItem = Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Total_Correct_Peaks;
            comboBoxFilesYAxis.Items.AddRange(yAxisOptions);
            comboBoxFilesYAxis.SelectedItem = Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Total_Correct_Peaks;

            InitializeGraphPanes();

            checkBoxXRange.Text     = string.Format(checkBoxXRange.Text, Q_VALUE_SIG);
            checkBoxIDLabels.Text   = string.Format(checkBoxIDLabels.Text, Q_VALUE_SIG);
            checkBoxExpectedFp.Text = string.Format(checkBoxExpectedFp.Text, Q_VALUE_SIG);

            textBoxFilesQCutoff.Text = Q_VALUE_SIG.ToString(CultureInfo.CurrentCulture);
            _showFpCutoff            = true;
            _showFpCutoffQ           = true;
            UpdateTextBox();
        }
Exemple #3
0
        public ComparePeakPickingDlg(SrmDocument document)
        {
            InitializeComponent();
            Document             = document;
            _peakBoundaryList    = new ComparePeakBoundariesList();
            _scoreGridViewDriver = new ComparePeakBoundariesGridViewDriver(dataGridViewScore,
                                                                           bindingSourceScore, new SortableBindingList <PeakBoundsMatch>());
            _compareGridViewDriver = new ComparePeakBoundariesPairGridViewDriver(dataGridViewScoreComparison,
                                                                                 bindingSourceScoreCompare, new SortableBindingList <PeakBoundsMatchPair>());

            // Hide borders for better copy-paste images
            zedGraphRoc.MasterPane.Border.IsVisible   = false;
            zedGraphRoc.GraphPane.Border.IsVisible    = false;
            zedGraphQq.MasterPane.Border.IsVisible    = false;
            zedGraphQq.GraphPane.Border.IsVisible     = false;
            zedGraphFiles.MasterPane.Border.IsVisible = false;
            zedGraphFiles.GraphPane.Border.IsVisible  = false;

            // Intialize the y-axis selector combo box
            var yAxisOptions = new[]
            {
                Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Total_Correct_Peaks,
                Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Fraction_of_Manual_ID_s,
                Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Fraction_of_Peak_Groups
            };

            comboBoxYAxis.Items.AddRange(yAxisOptions);
            comboBoxYAxis.SelectedItem = Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Total_Correct_Peaks;
            comboBoxFilesYAxis.Items.AddRange(yAxisOptions);
            comboBoxFilesYAxis.SelectedItem = Resources.ComparePeakPickingDlg_ComparePeakPickingDlg_Total_Correct_Peaks;

            InitializeGraphPanes();
            textBoxFilesQCutoff.Text = 0.05.ToString(CultureInfo.CurrentCulture);
            _showFpCutoff            = true;
            _showFpCutoffQ           = true;
            UpdateTextBox();
        }