public MassSpectrum GetMassSpectrum(MassSpectrum metaSpectrum, SpectrumList spectrumList) { MassSpectrum spectrum = new MassSpectrum(metaSpectrum, spectrumList.spectrum(metaSpectrum.Index, true)); //MassSpectrum realMetaSpectrum = ( metaSpectrum.Tag as DataGridViewRow ).Tag as MassSpectrum; //realMetaSpectrum.Element.dataProcessing = spectrum.Element.dataProcessing; //realMetaSpectrum.Element.defaultArrayLength = spectrum.Element.defaultArrayLength; return(spectrum); }
public MassSpectrum(MassSpectrum metaSpectrum, pwiz.CLI.msdata.Spectrum spectrum) { source = metaSpectrum.source; spectrumList = metaSpectrum.spectrumList; index = metaSpectrum.index; Tag = metaSpectrum.Tag; AnnotationSettings = metaSpectrum.AnnotationSettings; //element = spectrum; id = metaSpectrum.id; }
public SpectrumViewer(string filename, object index, string interpretation) { // Prepare the annotation annotation = new PeptideFragmentationAnnotation(interpretation, 1, 2, false, true, false, false, true, false, false, true, false, true); annotation.OptionsPanel.Dock = DockStyle.None; annotation.OptionsPanel.Dock = DockStyle.Fill; // Get the mass spectrum spectrum = SpectrumCache.GetMassSpectrum(filename, index); if (spectrum == null) { return; } // Add annotation to the mass spectrum and get a new graph control spectrum.AnnotationList.Clear(); spectrum.AnnotationList.Add((IAnnotation)annotation); graph = new MSGraphControl(); graph.AddGraphItem(graph.GraphPane, spectrum); graph.Dock = DockStyle.Fill; // Create new panels and add the graph and annotations spectrumPanel = new Panel(); spectrumPanel.Controls.Add(graph); spectrumPanel.Dock = DockStyle.None; spectrumPanel.Dock = DockStyle.Fill; annotationPanel = new Panel(); annotationPanel.Controls.Add(annotation.OptionsPanel); annotationPanel.Dock = DockStyle.None; annotationPanel.Dock = DockStyle.Fill; fragmentationPanel = new Panel(); annotation.FragmentInfoGridView.Location = new Point(0, 0); annotation.FragmentInfoGridView.ScrollBars = ScrollBars.Both; annotation.FragmentInfoGridView.Dock = DockStyle.None; annotation.FragmentInfoGridView.Dock = DockStyle.Fill; annotation.FragmentInfoGridView.BorderStyle = BorderStyle.FixedSingle; fragmentationPanel.Controls.Add(annotation.FragmentInfoGridView); fragmentationPanel.Dock = DockStyle.None; fragmentationPanel.Dock = DockStyle.Fill; // Add the call back for refreshing annotation.OptionsChanged += new EventHandler(OnOptionsChanged); }