public TransitionSettingsControl(IModifyDocumentContainer documentContainer)
        {
            _documentContainer = documentContainer;
            InitializeComponent();

            foreach (string item in TransitionFilter.GetStartFragmentFinderLabels())
            {
                comboRangeFrom.Items.Add(item);
            }
            foreach (string item in TransitionFilter.GetEndFragmentFinderLabels())
            {
                comboRangeTo.Items.Add(item);
            }

            SetFields(_documentContainer.Document.Settings.TransitionSettings);
            PeptideIonTypes        = PeptideIonTypes.Union(new[] { IonType.precursor, IonType.y }).ToArray(); // Add p, y if not already set
            InitialPeptideIonTypes = PeptideIonTypes.ToArray();
        }
Exemple #2
0
        public TransitionSettingsUI(SkylineWindow parent)
        {
            InitializeComponent();

            // Populate the fragment finder combo boxes
            foreach (string item in TransitionFilter.GetStartFragmentFinderLabels())
            {
                comboRangeFrom.Items.Add(item);
            }
            foreach (string item in TransitionFilter.GetEndFragmentFinderLabels())
            {
                comboRangeTo.Items.Add(item);
            }

            _parent             = parent;
            _transitionSettings = _parent.DocumentUI.Settings.TransitionSettings;

            // Initialize prediction settings
            comboPrecursorMass.SelectedItem = Prediction.PrecursorMassType.GetLocalizedString();
            comboIonMass.SelectedItem       = Prediction.FragmentMassType.GetLocalizedString();

            _driverCE = new SettingsListComboDriver <CollisionEnergyRegression>(comboCollisionEnergy,
                                                                                Settings.Default.CollisionEnergyList);
            string sel = (Prediction.CollisionEnergy == null ? null : Prediction.CollisionEnergy.Name);

            _driverCE.LoadList(sel);

            _driverDP = new SettingsListComboDriver <DeclusteringPotentialRegression>(comboDeclusterPotential,
                                                                                      Settings.Default.DeclusterPotentialList);
            sel = (Prediction.DeclusteringPotential == null ? null : Prediction.DeclusteringPotential.Name);
            _driverDP.LoadList(sel);

            _driverCoV = new SettingsListComboDriver <CompensationVoltageParameters>(comboCompensationVoltage,
                                                                                     Settings.Default.CompensationVoltageList);
            _driverCoV.LoadList(Prediction.CompensationVoltage == null ? null : Prediction.CompensationVoltage.Name);

            _driverOptimizationLibrary = new SettingsListComboDriver <OptimizationLibrary>(comboOptimizationLibrary,
                                                                                           Settings.Default.OptimizationLibraryList);
            _driverOptimizationLibrary.LoadList(Prediction.OptimizedLibrary == null ? null : Prediction.OptimizedLibrary.Name);

            if (Prediction.OptimizedMethodType == OptimizedMethodType.None)
            {
                comboOptimizeType.SelectedIndex = 0;
            }
            else
            {
                cbUseOptimized.Checked         = true;
                comboOptimizeType.SelectedItem = Prediction.OptimizedMethodType.GetLocalizedString();
            }

            // Initialize filter settings
            textPrecursorCharges.Text   = Filter.PrecursorCharges.ToArray().ToString(", "); // Not L10N? Internationalization of comma?
            textIonCharges.Text         = Filter.ProductCharges.ToArray().ToString(", ");   // Not L10N? Internationalization of comma?
            textIonTypes.Text           = TransitionFilter.ToStringIonTypes(Filter.IonTypes, true);
            comboRangeFrom.SelectedItem = Filter.FragmentRangeFirst.Label;
            comboRangeTo.SelectedItem   = Filter.FragmentRangeLast.Label;
            textExclusionWindow.Text    = Filter.PrecursorMzWindow != 0
                                           ? Filter.PrecursorMzWindow.ToString(LocalizationHelper.CurrentCulture)
                                           : string.Empty;
            cbExclusionUseDIAWindow.Checked = Filter.ExclusionUseDIAWindow;
            cbAutoSelect.Checked            = Filter.AutoSelect;

            _driverIons = new MeasuredIonListBoxDriver(listAlwaysAdd, Settings.Default.MeasuredIonList);
            _driverIons.LoadList(Filter.MeasuredIons);

            // Initialize library settings
            cbLibraryPick.Checked = (Libraries.Pick != TransitionLibraryPick.none);
            panelPick.Visible     = cbLibraryPick.Checked;
            textTolerance.Text    = Libraries.IonMatchTolerance.ToString(LocalizationHelper.CurrentCulture);
            textIonCount.Text     = Libraries.IonCount.ToString(LocalizationHelper.CurrentCulture);
            if (Libraries.Pick == TransitionLibraryPick.filter)
            {
                radioFiltered.Checked = true;
            }
            else if (Libraries.Pick == TransitionLibraryPick.all_plus)
            {
                radioAllAndFiltered.Checked = true;
            }

            // Initialize instrument settings
            textMinMz.Text            = Instrument.MinMz.ToString(LocalizationHelper.CurrentCulture);
            textMaxMz.Text            = Instrument.MaxMz.ToString(LocalizationHelper.CurrentCulture);
            cbDynamicMinimum.Checked  = Instrument.IsDynamicMin;
            textMzMatchTolerance.Text = Instrument.MzMatchTolerance.ToString(LocalizationHelper.CurrentCulture);
            if (Instrument.MaxTransitions.HasValue)
            {
                textMaxTrans.Text = Instrument.MaxTransitions.Value.ToString(LocalizationHelper.CurrentCulture);
            }
            if (Instrument.MaxInclusions.HasValue)
            {
                textMaxInclusions.Text = Instrument.MaxInclusions.Value.ToString(LocalizationHelper.CurrentCulture);
            }
            if (Instrument.MinTime.HasValue)
            {
                textMinTime.Text = Instrument.MinTime.Value.ToString(LocalizationHelper.CurrentCulture);
            }
            if (Instrument.MaxTime.HasValue)
            {
                textMaxTime.Text = Instrument.MaxTime.Value.ToString(LocalizationHelper.CurrentCulture);
            }

            // Initialize full-scan settings
            FullScanSettingsControl = new FullScanSettingsControl(_parent)
            {
                Anchor   = (AnchorStyles.Top | AnchorStyles.Left),
                Location = new Point(0, 0),
                Size     = new Size(363, 491)
            };
            FullScanSettingsControl.IsolationSchemeChangedEvent += IsolationSchemeChanged;
            tabFullScan.Controls.Add(FullScanSettingsControl);

            // VISUAL:
            // - Store the distance between the cbExclusionDIAWindow and the lower end of the box (to use as margin later)
            // - Shift the cbExclusionDIAWindow down (it is only higher in the designer for better manipulation)
            _lower_margin = groupBox1.Height - textExclusionWindow.Location.Y - textExclusionWindow.Height;
            int pixelShift = cbExclusionUseDIAWindow.Location.Y - lbPrecursorMzWindow.Location.Y;

            cbExclusionUseDIAWindow.Location = new Point(cbExclusionUseDIAWindow.Location.X, cbExclusionUseDIAWindow.Location.Y - pixelShift);

            DoIsolationSchemeChanged();
        }