コード例 #1
0
ファイル: seems.cs プロジェクト: zrolfs/pwiz
 private void seems_ResizeBegin(object sender, EventArgs e)
 {
     if (CurrentGraphForm != null && CurrentGraphForm.WindowState == FormWindowState.Maximized)
     {
         CurrentGraphForm.SuspendLayout();
         CurrentGraphForm.ZedGraphControl.Visible = false;
     }
 }
コード例 #2
0
ファイル: seems.cs プロジェクト: tomas-pluskal/pwiz
        private void peptideFragmentationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PeptideFragmentationForm peptideFragmentationForm = new PeptideFragmentationForm();

            peptideFragmentationForm.ShowDialog(this);
            if (peptideFragmentationForm.DialogResult == DialogResult.Cancel)
            {
                return;
            }

            if (peptideFragmentationForm.MsProductReportXml != null)
            {
                Map <string, List <Pair <double, int> > > pointAnnotations = new Map <string, List <Pair <double, int> > >();

                XmlTextReader reader = new XmlTextReader(new StringReader(peptideFragmentationForm.MsProductReportXml));

                string ionSeriesName      = "immonium";
                string ionSeriesIndex     = "";
                int    previousLabelCount = CurrentGraphForm.CurrentPointAnnotations.Count;
                while (reader.Read())
                {
                    switch (reader.NodeType)
                    {
                    case XmlNodeType.Element:
                        if (reader.Name == "mz")
                        {
                            string[] ionMzChargeStr = reader.ReadElementContentAsString().Split(",".ToCharArray());
                            double   ionMz          = Convert.ToDouble(ionMzChargeStr[0]);
                            int      ionCharge      = Convert.ToInt32(ionMzChargeStr[1]);
                            pointAnnotations[ionSeriesName + ionSeriesIndex].Add(new Pair <double, int>(ionMz, ionCharge));
                        }
                        else if (reader.Name[0] == 'i')
                        {
                            Int32 test;
                            if (Int32.TryParse(reader.Name.Substring(1), out test))
                            {
                                ionSeriesIndex = " " + reader.Name.Substring(1);
                            }
                        }
                        else if (reader.Name == "name")
                        {
                            ionSeriesName = reader.ReadElementContentAsString();
                        }
                        break;
                    }
                }

                if (CurrentGraphForm.CurrentScan.IsMassSpectrum)
                {
                    CurrentGraphForm.AnnotationSettings.setScanLabels(pointAnnotations);
                    if (CurrentGraphForm.CurrentPointAnnotations.Count > previousLabelCount)
                    {
                        CurrentGraphForm.updateGraph();
                    }
                }
            }
        }
コード例 #3
0
ファイル: seems.cs プロジェクト: tomas-pluskal/pwiz
        private void clearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (CurrentGraphForm.CurrentPointAnnotations.Count == 0)
            {
                return;
            }

            CurrentGraphForm.CurrentPointAnnotations.Clear();
            CurrentGraphForm.updateGraph();
        }
コード例 #4
0
ファイル: seems.cs プロジェクト: zrolfs/pwiz
        private void seems_ResizeEnd(object sender, EventArgs e)
        {
            if (isLoaded && this.WindowState != FormWindowState.Minimized)
            {
                if (this.WindowState == FormWindowState.Normal)
                {
                    Properties.Settings.Default.MainFormSize = this.Size;
                }
                Properties.Settings.Default.MainFormWindowState = this.WindowState;
            }

            if (CurrentGraphForm != null && CurrentGraphForm.WindowState == FormWindowState.Maximized)
            {
                CurrentGraphForm.ResumeLayout();
                CurrentGraphForm.ZedGraphControl.Visible = true;
                CurrentGraphForm.Refresh();
            }
        }
コード例 #5
0
ファイル: seems.cs プロジェクト: tomas-pluskal/pwiz
        private void peptideMassMapProteinDigestToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PeptideMassMapProteinDigestForm peptideMassMapProteinDigestForm = new PeptideMassMapProteinDigestForm();

            peptideMassMapProteinDigestForm.ShowDialog(this);
            if (peptideMassMapProteinDigestForm.DialogResult == DialogResult.Cancel)
            {
                return;
            }

            if (peptideMassMapProteinDigestForm.MsDigestReportXml != null)
            {
                Map <string, List <Pair <double, int> > > pointAnnotations = new Map <string, List <Pair <double, int> > >();

                XmlTextReader reader = new XmlTextReader(new StringReader(peptideMassMapProteinDigestForm.MsDigestReportXml));

                double peptideMonoMz = 0, peptideAvgMz = 0;
                int    peptideCharge = 0;
                string peptideSequence;
                int    previousLabelCount = CurrentGraphForm.CurrentPointAnnotations.Count;
                while (reader.Read())
                {
                    switch (reader.NodeType)
                    {
                    case XmlNodeType.Element:
                        if (reader.Name == "peptide")
                        {
                            peptideMonoMz   = peptideAvgMz = 0;
                            peptideCharge   = 0;
                            peptideSequence = "";
                        }
                        else if (reader.Name == "mi_m_over_z")
                        {
                            peptideMonoMz = Convert.ToDouble(reader.ReadElementContentAsString());
                        }
                        else if (reader.Name == "av_m_over_z")
                        {
                            peptideAvgMz = Convert.ToDouble(reader.ReadElementContentAsString());
                        }
                        else if (reader.Name == "charge")
                        {
                            peptideCharge = Convert.ToInt32(reader.ReadElementContentAsString());
                        }
                        else if (reader.Name == "database_sequence")
                        {
                            peptideSequence = reader.ReadElementContentAsString();
                            if (peptideMonoMz > 0)
                            {
                                pointAnnotations[peptideSequence].Add(new Pair <double, int>(peptideMonoMz, peptideCharge));
                            }
                            if (peptideAvgMz > 0)
                            {
                                pointAnnotations[peptideSequence].Add(new Pair <double, int>(peptideAvgMz, peptideCharge));
                            }
                        }
                        break;
                    }
                }

                if (CurrentGraphForm.CurrentScan.IsMassSpectrum)
                {
                    CurrentGraphForm.AnnotationSettings.setScanLabels(pointAnnotations);
                    if (CurrentGraphForm.CurrentPointAnnotations.Count > previousLabelCount)
                    {
                        CurrentGraphForm.updateGraph();
                    }
                }
            }
        }
コード例 #6
0
ファイル: seems.cs プロジェクト: tomas-pluskal/pwiz
 private void centroidToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
 {
     CurrentGraphForm.updateGraph();
 }