Exemple #1
0
        private void dgv_ET_Peak_List_CellClick(object sender, MouseEventArgs e)
        {
            int clickedRow = dgv_ET_Peak_List.HitTest(e.X, e.Y).RowIndex;
            int clickedCol = dgv_ET_Peak_List.HitTest(e.X, e.Y).ColumnIndex;

            if (clickedRow < Sweet.lollipop.et_relations.Count && clickedRow >= 0 && clickedCol >= 0 && clickedCol < dgv_ET_Peak_List.ColumnCount)
            {
                if (e.Button == MouseButtons.Left)
                {
                    ct_ET_peakList.ChartAreas[0].AxisX.StripLines.Clear();
                    DeltaMassPeak selected_peak = (dgv_ET_Peak_List.Rows[clickedRow].DataBoundItem as DisplayObject).display_object as DeltaMassPeak;
                    DisplayUtility.GraphSelectedDeltaMassPeak(ct_ET_peakList, selected_peak, Sweet.lollipop.et_relations);
                }
                else
                {
                    if (e.Button == MouseButtons.Right && clickedRow >= 0 && clickedRow < Sweet.lollipop.et_relations.Count)
                    {
                        ContextMenuStrip ET_peak_List_Menu = new ContextMenuStrip();
                        int position_xy_mouse_row          = dgv_ET_Peak_List.HitTest(e.X, e.Y).RowIndex;

                        DisplayDeltaMassPeak selected_peak = dgv_ET_Peak_List.Rows[clickedRow].DataBoundItem as DisplayDeltaMassPeak;

                        if (position_xy_mouse_row > 0)
                        {
                            ET_peak_List_Menu.Items.Add("Increase Experimental Mass " + Lollipop.MONOISOTOPIC_UNIT_MASS + " Da").Name = "IncreaseMass";
                            ET_peak_List_Menu.Items.Add("Decrease Experimental Mass " + Lollipop.MONOISOTOPIC_UNIT_MASS + " Da").Name = "DecreaseMass";
                        }
                        ET_peak_List_Menu.Show(dgv_ET_Peak_List, new Point(e.X, e.Y));

                        //event menu click
                        ET_peak_List_Menu.ItemClicked += new ToolStripItemClickedEventHandler((s, ev) => ET_peak_List_Menu_ItemClicked(s, ev, selected_peak));
                    }
                }
            }
        }
Exemple #2
0
 public List <DataTable> SetTables()
 {
     DataTables = new List <DataTable>
     {
         DisplayProteoformRelation.FormatRelationsGridView(Sweet.lollipop.ee_relations.OfType <ProteoformRelation>().Select(r => new DisplayProteoformRelation(r)).ToList(), "EERelations", false, true, false),
         DisplayDeltaMassPeak.FormatPeakListGridView(Sweet.lollipop.ee_peaks.Select(p => new DisplayDeltaMassPeak(p)).ToList(), "EEPeaks", true)
     };
     return(DataTables);
 }
Exemple #3
0
        private void tb_peakTableFilter_TextChanged(object sender, EventArgs e)
        {
            IEnumerable <object> selected_peaks = tb_peakTableFilter.Text == "" ?
                                                  Sweet.lollipop.ee_peaks :
                                                  ExtensionMethods.filter(Sweet.lollipop.ee_peaks, tb_peakTableFilter.Text);

            DisplayUtility.FillDataGridView(dgv_EE_Peaks, selected_peaks.OfType <DeltaMassPeak>().Select(p => new DisplayDeltaMassPeak(p)));
            DisplayDeltaMassPeak.FormatPeakListGridView(dgv_EE_Peaks, true);
        }
Exemple #4
0
 public List <DataTable> SetTables()
 {
     DataTables = new List <DataTable>
     {
         DisplayProteoformRelation.FormatRelationsGridView(Sweet.lollipop.et_relations.OfType <ProteoformRelation>().Select(p => new DisplayProteoformRelation(p)).ToList(), "ETRelations", true, false, cb_discoveryHistogram.Checked),
         DisplayDeltaMassPeak.FormatPeakListGridView(Sweet.lollipop.et_peaks.Select(p => new DisplayDeltaMassPeak(p)).ToList(), "ETPeaks", false)
     };
     return(DataTables);
 }
Exemple #5
0
 public void FillTablesAndCharts()
 {
     dgv_EE_Peaks.CurrentCellDirtyStateChanged -= EE_Peak_List_DirtyStateChanged;//remove event handler on form load and table refresh event
     DisplayUtility.FillDataGridView(dgv_EE_Peaks, Sweet.lollipop.ee_peaks.OrderByDescending(p => p.peak_relation_group_count).Select(p => new DisplayDeltaMassPeak(p)));
     DisplayUtility.FillDataGridView(dgv_EE_Relations, Sweet.lollipop.ee_relations.Select(r => new DisplayProteoformRelation(r)));
     DisplayProteoformRelation.FormatRelationsGridView(dgv_EE_Relations, false, true, false);
     DisplayDeltaMassPeak.FormatPeakListGridView(dgv_EE_Peaks, true);
     GraphEERelations();
     GraphEEPeaks();
     if (cb_Graph_lowerThreshold.Checked)
     {
         ct_EE_Histogram.ChartAreas[0].AxisY.StripLines.Add(new StripLine()
         {
             BorderColor = Color.Red, IntervalOffset = Convert.ToDouble(nUD_PeakCountMinThreshold.Value)
         });
     }
     else
     {
         ct_EE_Histogram.ChartAreas[0].AxisY.StripLines.Clear();
     }
     update_figures_of_merit();
     dgv_EE_Peaks.CurrentCellDirtyStateChanged += EE_Peak_List_DirtyStateChanged;//re-instate event handler after form load and table refresh event
 }
Exemple #6
0
        //will leave option to change one at a time by right clicking
        private void ET_peak_List_Menu_ItemClicked(object sender, ToolStripItemClickedEventArgs e, DisplayDeltaMassPeak peak)
        {
            int int_mass_shifter = 0;

            try
            {
                int_mass_shifter = Convert.ToInt32(peak.MassShifter);
            }
            catch
            {
                MessageBox.Show("Oops, this mass shifter " + peak.MassShifter + " is not an integer.");
                return;
            }

            switch (e.ClickedItem.Name.ToString())
            {
            case "IncreaseMass":
                peak.MassShifter = (int_mass_shifter + 1).ToString();
                break;

            case "DecreaseMass":
                peak.MassShifter = (int_mass_shifter - 1).ToString();
                break;
            }
            dgv_ET_Peak_List.Refresh();
        }