Ejemplo n.º 1
0
        public IDPickerForm (IList<string> args)
        {
            InitializeComponent();

            toolStripStatusLabel.Text = "Initializing...";

            Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;

            this.args = args;

            defaultDataFilter = new DataFilter();

            manager = new Manager(dockPanel)
            {
                ShowChromatogramListForNewSources = false,
                ShowSpectrumListForNewSources = false,
                OpenFileUsesCurrentGraphForm = true,
            };

            progressMonitor = new ProgressMonitor();
            progressMonitor.ProgressUpdate += progressMonitor_ProgressUpdate;

            if (Program.IsHeadless)
                Load += IDPickerForm_Load;
            else
                Shown += IDPickerForm_Load;

            basicFilterControl = new BasicFilterControl();
            basicFilterControl.BasicFilterChanged += basicFilterControl_BasicFilterChanged;
            basicFilterControl.ApplyFilterChanges += basicFilterControl_ApplyFilterChanges;
            basicFilterControl.ShowQonverterSettings += ShowQonverterSettings;
            dataFilterPopup = new Popup(basicFilterControl) { FocusOnOpen = true };
            dataFilterPopup.Closed += dataFilterPopup_Closed;

            breadCrumbControl = new BreadCrumbControl() { Dock = DockStyle.Fill };
            breadCrumbControl.BreadCrumbClicked += breadCrumbControl_BreadCrumbClicked;
            breadCrumbPanel.Controls.Add(breadCrumbControl);

            fragmentationStatisticsForm = new FragmentationStatisticsForm(this);
            fragmentationStatisticsForm.Show(dockPanel, DockState.DockBottomAutoHide);
            fragmentationStatisticsForm.AutoHidePortion = 0.5;

            peakStatisticsForm = new PeakStatisticsForm(this);
            peakStatisticsForm.Show(dockPanel, DockState.DockBottomAutoHide);
            peakStatisticsForm.AutoHidePortion = 0.5;

            distributionStatisticsForm = new DistributionStatisticsForm(this);
            distributionStatisticsForm.Show(dockPanel, DockState.DockBottomAutoHide);
            distributionStatisticsForm.AutoHidePortion = 0.5;

            reassignPSMsForm = new RescuePSMsForm(this);
            reassignPSMsForm.Show(dockPanel, DockState.DockBottomAutoHide);
            reassignPSMsForm.AutoHidePortion = 0.5;

            ptmAttestationForm = new PTMAttestationForm(this);
            ptmAttestationForm.Show(dockPanel, DockState.DockBottomAutoHide);
            ptmAttestationForm.AutoHidePortion = 0.5;

            spectrumTableForm = new SpectrumTableForm();
            spectrumTableForm.Show(dockPanel, DockState.DockLeft);
            spectrumTableForm.AutoHidePortion = 0.5;

            proteinTableForm = new ProteinTableForm();
            proteinTableForm.Show(dockPanel, DockState.DockTop);
            proteinTableForm.AutoHidePortion = 0.5;

            peptideTableForm = new PeptideTableForm();
            peptideTableForm.Show(dockPanel, DockState.DockTop);
            peptideTableForm.AutoHidePortion = 0.5;

            proteinTableForm.Activate();

            modificationTableForm = new ModificationTableForm();
            modificationTableForm.Show(dockPanel, DockState.Document);
            modificationTableForm.AutoHidePortion = 0.5;

            analysisTableForm = new AnalysisTableForm();
            analysisTableForm.Show(dockPanel, DockState.Document);
            analysisTableForm.AutoHidePortion = 0.5;

            filterHistoryForm = new FilterHistoryForm();
            filterHistoryForm.Show(dockPanel, DockState.Document);
            filterHistoryForm.AutoHidePortion = 0.5;

            spectrumTableForm.SpectrumViewFilter += handleViewFilter;
            spectrumTableForm.SpectrumViewVisualize += spectrumTableForm_SpectrumViewVisualize;
            spectrumTableForm.FinishedSetData += handleFinishedSetData;
            spectrumTableForm.StartingSetData += handleStartingSetData;
            proteinTableForm.ProteinViewFilter += handleViewFilter;
            proteinTableForm.ProteinViewVisualize += proteinTableForm_ProteinViewVisualize;
            proteinTableForm.FinishedSetData += handleFinishedSetData;
            proteinTableForm.StartingSetData += handleStartingSetData;
            peptideTableForm.PeptideViewFilter += handleViewFilter;
            peptideTableForm.FinishedSetData += handleFinishedSetData;
            peptideTableForm.StartingSetData += handleStartingSetData;
            modificationTableForm.ModificationViewFilter += handleViewFilter;
            modificationTableForm.FinishedSetData += handleFinishedSetData;
            modificationTableForm.StartingSetData += handleStartingSetData;
            analysisTableForm.AnalysisViewFilter += handleViewFilter;
            analysisTableForm.FinishedSetData += handleFinishedSetData;
            analysisTableForm.StartingSetData += handleStartingSetData;
            filterHistoryForm.LoadPersistentDataFilter += handleLoadPersistentDataFilter;
            //filterHistoryForm.FinishedSetData += handleFinishedSetData;
            //filterHistoryForm.StartingSetData += handleStartingSetData;

            // hide DockPanel before initializing layout manager
            dockPanel.Visible = false;
            dockPanel.ShowDocumentIcon = true;

            persistentForms = new IPersistentForm[]
            {
                proteinTableForm,
                peptideTableForm,
                spectrumTableForm,
                analysisTableForm,
                filterHistoryForm
            };

            _layoutManager = new LayoutManager(this, dockPanel, persistentForms);

            // load last or default location and size
            _layoutManager.LoadMainFormSettings();

            // certain features are only enabled for development builds
            if (Application.ExecutablePath.Contains("build-nt-x86"))
            {
                // provide SQL logging for development builds
                logForm = new LogForm();
                logForm.AutoHidePortion = 0.25;
                Console.SetOut(logForm.LogWriter);

                developerToolStripMenuItem.ForeColor = SystemColors.MenuBar;
            }
            else
            {
                Console.SetOut(TextWriter.Null);

                developerToolStripMenuItem.Visible = false;
            }

            /*spyEventLogForm = new SpyEventLogForm();
            spyEventLogForm.AddEventSpy(new EventSpy("proteinTableForm", proteinTableForm));
            spyEventLogForm.AddEventSpy(new EventSpy("peptideTableForm", peptideTableForm));
            spyEventLogForm.AddEventSpy(new EventSpy("spectrumTableForm", spectrumTableForm));
            spyEventLogForm.AddEventSpy(new EventSpy("modificationTableForm", modificationTableForm));
            spyEventLogForm.Show(dockPanel, DockState.DockBottomAutoHide);*/
        }
Ejemplo n.º 2
0
        public SpectrumViewVisualizeEventArgs (NHibernate.ISession session, SpectrumTableForm.PeptideSpectrumMatchRow row)
        {
            PeptideSpectrumMatchId = row.PeptideSpectrumMatchId;
            Spectrum = row.Spectrum;
            SpectrumSource = row.Source;
            Analysis = row.Analysis;
            Charge = row.Charge;

            lock (session)
            {
                var psm = session.Load<PeptideSpectrumMatch>(PeptideSpectrumMatchId);
                ModifiedSequence = psm.ToModifiedString(5);
                session.Evict(psm);
            }
        }