diff --git a/ProteoformSuiteGUI/DisplayObjects/DisplayProteoformRelation.cs b/ProteoformSuiteGUI/DisplayObjects/DisplayProteoformRelation.cs index 86172250..6acefabd 100644 --- a/ProteoformSuiteGUI/DisplayObjects/DisplayProteoformRelation.cs +++ b/ProteoformSuiteGUI/DisplayObjects/DisplayProteoformRelation.cs @@ -22,7 +22,9 @@ public int PeakCenterCount { get { - return peak != null ? peak.peak_relation_group_count : -1000000; + return peak != null ? + peak.peak_relation_group_count : + -1000000; } } @@ -30,7 +32,9 @@ public double PeakCenterDeltaMass { get { - return peak != null ? peak.DeltaMass : Double.NaN; + return peak != null ? + peak.DeltaMass : + Double.NaN; } } @@ -92,8 +96,9 @@ public double agg_intensity_1 { get { - try { return ((ExperimentalProteoform)connected_proteoforms[0]).agg_intensity; } - catch { return Double.NaN; } + return connected_proteoforms[0] as ExperimentalProteoform != null ? + ((ExperimentalProteoform)connected_proteoforms[0]).agg_intensity : + Double.NaN; } } @@ -101,8 +106,9 @@ public double agg_RT_1 { get { - try { return ((ExperimentalProteoform)connected_proteoforms[0]).agg_rt; } - catch { return Double.NaN; } + return connected_proteoforms[0] as ExperimentalProteoform != null ? + ((ExperimentalProteoform)connected_proteoforms[0]).agg_rt : + Double.NaN; } } @@ -110,8 +116,9 @@ public int num_observations_1 { get { - try { return ((ExperimentalProteoform)connected_proteoforms[0]).aggregated_components.Count; } - catch { return -1000000; } + return connected_proteoforms[0] as ExperimentalProteoform != null ? + ((ExperimentalProteoform)connected_proteoforms[0]).aggregated_components.Count : + -1000000; } } @@ -119,8 +126,9 @@ public double proteoform_mass_1 { get { - try {return ((ExperimentalProteoform)connected_proteoforms[0]).agg_mass; } - catch { return Double.NaN; } + return connected_proteoforms[0] as ExperimentalProteoform != null ? + ((ExperimentalProteoform)connected_proteoforms[0]).agg_mass : + Double.NaN; } } @@ -128,8 +136,7 @@ public string accession_1 { get { - try { return ((ExperimentalProteoform)connected_proteoforms[0]).accession; } - catch { return null; } + return connected_proteoforms[0].accession; } } @@ -139,7 +146,7 @@ public double proteoform_mass_2 { get { - return connected_proteoforms[1] is ExperimentalProteoform ? + return connected_proteoforms[1] as ExperimentalProteoform != null ? ((ExperimentalProteoform)connected_proteoforms[1]).agg_mass : ((TheoreticalProteoform)connected_proteoforms[1]).modified_mass; } @@ -149,8 +156,9 @@ public double agg_intensity_2 { get { - try { return ((ExperimentalProteoform)connected_proteoforms[1]).agg_intensity; } - catch { return 0; } + return connected_proteoforms[1] as ExperimentalProteoform != null ? + ((ExperimentalProteoform)connected_proteoforms[1]).agg_intensity : + 0; } } @@ -158,8 +166,9 @@ public double agg_RT_2 { get { - try { return ((ExperimentalProteoform)connected_proteoforms[1]).agg_rt; } - catch { return 0; } + return connected_proteoforms[1] as ExperimentalProteoform != null ? + ((ExperimentalProteoform)connected_proteoforms[1]).agg_rt : + 0; } } @@ -167,8 +176,9 @@ public int num_observations_2 { get { - try { return ((ExperimentalProteoform)connected_proteoforms[1]).aggregated_components.Count; } - catch { return 0; } + return connected_proteoforms[1] as ExperimentalProteoform != null ? + ((ExperimentalProteoform)connected_proteoforms[1]).aggregated_components.Count : + 0; } } @@ -176,8 +186,7 @@ public string accession_2 { get { - try { return (connected_proteoforms[1]).accession; } - catch { return null; } + return connected_proteoforms[1].accession; } } @@ -185,16 +194,19 @@ public string Name { get { - try { return ((TheoreticalProteoform)connected_proteoforms[1]).name; } - catch { return null; } } + return connected_proteoforms[1] as TheoreticalProteoform != null ? + ((TheoreticalProteoform)connected_proteoforms[1]).name : + ""; + } } public string Fragment { get { - try { return ((TheoreticalProteoform)connected_proteoforms[1]).fragment; } - catch { return null; } + return connected_proteoforms[1] as TheoreticalProteoform != null ? + ((TheoreticalProteoform)connected_proteoforms[1]).fragment : + ""; } } @@ -202,8 +214,9 @@ public string PtmDescription { get { - try { return connected_proteoforms[1].ptm_description; } - catch { return null; } + return connected_proteoforms[1] as TheoreticalProteoform != null ? + ((TheoreticalProteoform)connected_proteoforms[1]).description : + ""; } } diff --git a/ProteoformSuiteGUI/ExperimentExperimentComparison.Designer.cs b/ProteoformSuiteGUI/ExperimentExperimentComparison.Designer.cs index df84056d..85e116f9 100644 --- a/ProteoformSuiteGUI/ExperimentExperimentComparison.Designer.cs +++ b/ProteoformSuiteGUI/ExperimentExperimentComparison.Designer.cs @@ -79,6 +79,12 @@ private void InitializeComponent() this.nUD_MaxRetTimeDifference = new System.Windows.Forms.NumericUpDown(); this.label1 = new System.Windows.Forms.Label(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.tb_peakTableFilter = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.tb_relationTableFilter = new System.Windows.Forms.TextBox(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgv_EE_Peaks)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUD_EE_Upper_Bound)).BeginInit(); @@ -120,6 +126,8 @@ private void InitializeComponent() this.splitContainer3.Panel1.SuspendLayout(); this.splitContainer3.Panel2.SuspendLayout(); this.splitContainer3.SuspendLayout(); + this.groupBox5.SuspendLayout(); + this.groupBox6.SuspendLayout(); this.SuspendLayout(); // // button1 @@ -213,21 +221,22 @@ private void InitializeComponent() 0, -2147483648}); this.yMaxEE.Name = "yMaxEE"; - this.yMaxEE.Size = new System.Drawing.Size(120, 20); + this.yMaxEE.Size = new System.Drawing.Size(87, 20); this.yMaxEE.TabIndex = 9; this.yMaxEE.ValueChanged += new System.EventHandler(this.yMaxEE_ValueChanged); // // xMaxEE // + this.xMaxEE.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.xMaxEE.DecimalPlaces = 2; - this.xMaxEE.Location = new System.Drawing.Point(125, 44); + this.xMaxEE.Location = new System.Drawing.Point(107, 44); this.xMaxEE.Minimum = new decimal(new int[] { 100, 0, 0, -2147483648}); this.xMaxEE.Name = "xMaxEE"; - this.xMaxEE.Size = new System.Drawing.Size(120, 20); + this.xMaxEE.Size = new System.Drawing.Size(100, 20); this.xMaxEE.TabIndex = 11; this.xMaxEE.ValueChanged += new System.EventHandler(this.xMaxEE_ValueChanged); // @@ -240,7 +249,7 @@ private void InitializeComponent() 0, -2147483648}); this.yMinEE.Name = "yMinEE"; - this.yMinEE.Size = new System.Drawing.Size(120, 20); + this.yMinEE.Size = new System.Drawing.Size(87, 20); this.yMinEE.TabIndex = 12; this.yMinEE.ValueChanged += new System.EventHandler(this.yMinEE_ValueChanged); // @@ -263,11 +272,11 @@ private void InitializeComponent() this.cb_Graph_lowerThreshold.AutoSize = true; this.cb_Graph_lowerThreshold.Checked = true; this.cb_Graph_lowerThreshold.CheckState = System.Windows.Forms.CheckState.Checked; - this.cb_Graph_lowerThreshold.Location = new System.Drawing.Point(117, 52); + this.cb_Graph_lowerThreshold.Location = new System.Drawing.Point(16, 58); this.cb_Graph_lowerThreshold.Name = "cb_Graph_lowerThreshold"; - this.cb_Graph_lowerThreshold.Size = new System.Drawing.Size(55, 17); + this.cb_Graph_lowerThreshold.Size = new System.Drawing.Size(103, 17); this.cb_Graph_lowerThreshold.TabIndex = 27; - this.cb_Graph_lowerThreshold.Text = "Graph"; + this.cb_Graph_lowerThreshold.Text = "Show Threshold"; this.cb_Graph_lowerThreshold.UseVisualStyleBackColor = true; this.cb_Graph_lowerThreshold.CheckedChanged += new System.EventHandler(this.cb_Graph_lowerThreshold_CheckedChanged); // @@ -281,7 +290,7 @@ private void InitializeComponent() 0, -2147483648}); this.xMinEE.Name = "xMinEE"; - this.xMinEE.Size = new System.Drawing.Size(120, 20); + this.xMinEE.Size = new System.Drawing.Size(101, 20); this.xMinEE.TabIndex = 24; this.xMinEE.ValueChanged += new System.EventHandler(this.xMinEE_ValueChanged); // @@ -324,7 +333,7 @@ private void InitializeComponent() // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(6, 19); + this.label3.Location = new System.Drawing.Point(3, 16); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(113, 13); this.label3.TabIndex = 15; @@ -483,7 +492,8 @@ private void InitializeComponent() // // splitContainer5.Panel2 // - this.splitContainer5.Panel2.Controls.Add(this.cb_view_decoy_histogram); + this.splitContainer5.Panel2.Controls.Add(this.groupBox6); + this.splitContainer5.Panel2.Controls.Add(this.groupBox5); this.splitContainer5.Panel2.Controls.Add(this.bt_compare_EE); this.splitContainer5.Panel2.Controls.Add(this.groupBox4); this.splitContainer5.Panel2.Controls.Add(this.groupBox3); @@ -517,7 +527,7 @@ private void InitializeComponent() // this.cb_view_decoy_histogram.AutoSize = true; this.cb_view_decoy_histogram.Enabled = false; - this.cb_view_decoy_histogram.Location = new System.Drawing.Point(18, 19); + this.cb_view_decoy_histogram.Location = new System.Drawing.Point(16, 35); this.cb_view_decoy_histogram.Name = "cb_view_decoy_histogram"; this.cb_view_decoy_histogram.Size = new System.Drawing.Size(190, 17); this.cb_view_decoy_histogram.TabIndex = 32; @@ -542,9 +552,9 @@ private void InitializeComponent() this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.groupBox4.Controls.Add(this.nUD_EE_Upper_Bound); this.groupBox4.Controls.Add(this.label10); - this.groupBox4.Location = new System.Drawing.Point(218, 119); + this.groupBox4.Location = new System.Drawing.Point(236, 130); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(160, 83); + this.groupBox4.Size = new System.Drawing.Size(207, 83); this.groupBox4.TabIndex = 30; this.groupBox4.TabStop = false; this.groupBox4.Text = "EE Histogram Boundary"; @@ -556,9 +566,9 @@ private void InitializeComponent() this.groupBox3.Controls.Add(this.xMinEE); this.groupBox3.Controls.Add(this.xMaxEE); this.groupBox3.Controls.Add(this.yMinEE); - this.groupBox3.Location = new System.Drawing.Point(198, 219); + this.groupBox3.Location = new System.Drawing.Point(236, 219); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(245, 106); + this.groupBox3.Size = new System.Drawing.Size(207, 106); this.groupBox3.TabIndex = 29; this.groupBox3.TabStop = false; this.groupBox3.Text = "EE Histogram Scaling"; @@ -572,7 +582,7 @@ private void InitializeComponent() this.groupBox2.Controls.Add(this.label6); this.groupBox2.Location = new System.Drawing.Point(12, 219); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(180, 106); + this.groupBox2.Size = new System.Drawing.Size(218, 106); this.groupBox2.TabIndex = 0; this.groupBox2.TabStop = false; this.groupBox2.Text = "No Man\'s Land"; @@ -586,30 +596,29 @@ private void InitializeComponent() this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.nUD_PeakCountMinThreshold); this.groupBox1.Controls.Add(this.label4); - this.groupBox1.Controls.Add(this.cb_Graph_lowerThreshold); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.nUD_PeakWidthBase); - this.groupBox1.Location = new System.Drawing.Point(12, 42); + this.groupBox1.Location = new System.Drawing.Point(12, 25); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(200, 171); + this.groupBox1.Size = new System.Drawing.Size(218, 188); this.groupBox1.TabIndex = 28; this.groupBox1.TabStop = false; this.groupBox1.Text = "EE Peak List Parameters"; // // tb_max_accepted_fdr // - this.tb_max_accepted_fdr.Location = new System.Drawing.Point(132, 96); + this.tb_max_accepted_fdr.Location = new System.Drawing.Point(52, 111); this.tb_max_accepted_fdr.Margin = new System.Windows.Forms.Padding(2); this.tb_max_accepted_fdr.Name = "tb_max_accepted_fdr"; this.tb_max_accepted_fdr.ReadOnly = true; - this.tb_max_accepted_fdr.Size = new System.Drawing.Size(86, 20); + this.tb_max_accepted_fdr.Size = new System.Drawing.Size(120, 20); this.tb_max_accepted_fdr.TabIndex = 31; // // label9 // - this.label9.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.label9.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(-1, 99); + this.label9.Location = new System.Drawing.Point(5, 96); this.label9.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(129, 13); @@ -624,7 +633,7 @@ private void InitializeComponent() 0, 0, 65536}); - this.nUD_MaxRetTimeDifference.Location = new System.Drawing.Point(52, 134); + this.nUD_MaxRetTimeDifference.Location = new System.Drawing.Point(52, 154); this.nUD_MaxRetTimeDifference.Margin = new System.Windows.Forms.Padding(2); this.nUD_MaxRetTimeDifference.Maximum = new decimal(new int[] { 50, @@ -639,7 +648,7 @@ private void InitializeComponent() // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(5, 118); + this.label1.Location = new System.Drawing.Point(5, 138); this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(178, 13); @@ -666,6 +675,66 @@ private void InitializeComponent() this.splitContainer3.SplitterDistance = 440; this.splitContainer3.TabIndex = 17; // + // groupBox5 + // + this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.groupBox5.Controls.Add(this.cb_view_decoy_histogram); + this.groupBox5.Controls.Add(this.cb_Graph_lowerThreshold); + this.groupBox5.Location = new System.Drawing.Point(449, 219); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(236, 106); + this.groupBox5.TabIndex = 33; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "EE Histogram Selection"; + // + // groupBox6 + // + this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.groupBox6.Controls.Add(this.label11); + this.groupBox6.Controls.Add(this.tb_relationTableFilter); + this.groupBox6.Controls.Add(this.label8); + this.groupBox6.Controls.Add(this.tb_peakTableFilter); + this.groupBox6.Location = new System.Drawing.Point(449, 113); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(263, 100); + this.groupBox6.TabIndex = 34; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "Table Control"; + // + // tb_peakTableFilter + // + this.tb_peakTableFilter.Location = new System.Drawing.Point(25, 22); + this.tb_peakTableFilter.Name = "tb_peakTableFilter"; + this.tb_peakTableFilter.Size = new System.Drawing.Size(100, 20); + this.tb_peakTableFilter.TabIndex = 0; + this.tb_peakTableFilter.TextChanged += new System.EventHandler(this.tb_peakTableFilter_TextChanged); + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(137, 25); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(104, 13); + this.label8.TabIndex = 1; + this.label8.Text = "EE Peak Table Filter"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(137, 60); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(118, 13); + this.label11.TabIndex = 3; + this.label11.Text = "EE Relation Table Filter"; + // + // tb_relationTableFilter + // + this.tb_relationTableFilter.Location = new System.Drawing.Point(25, 57); + this.tb_relationTableFilter.Name = "tb_relationTableFilter"; + this.tb_relationTableFilter.Size = new System.Drawing.Size(100, 20); + this.tb_relationTableFilter.TabIndex = 2; + this.tb_relationTableFilter.TextChanged += new System.EventHandler(this.tb_relationTableFilter_TextChanged); + // // ExperimentExperimentComparison // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -703,7 +772,6 @@ private void InitializeComponent() this.splitContainer6.ResumeLayout(false); this.splitContainer5.Panel1.ResumeLayout(false); this.splitContainer5.Panel2.ResumeLayout(false); - this.splitContainer5.Panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).EndInit(); this.splitContainer5.ResumeLayout(false); this.splitContainer4.Panel1.ResumeLayout(false); @@ -722,6 +790,10 @@ private void InitializeComponent() this.splitContainer3.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); this.splitContainer3.ResumeLayout(false); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); this.ResumeLayout(false); } @@ -770,6 +842,12 @@ private void InitializeComponent() private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label5; private System.Windows.Forms.CheckBox cb_view_decoy_histogram; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox tb_relationTableFilter; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox tb_peakTableFilter; } } diff --git a/ProteoformSuiteGUI/ExperimentExperimentComparison.cs b/ProteoformSuiteGUI/ExperimentExperimentComparison.cs index eef837ab..0f7ddce4 100644 --- a/ProteoformSuiteGUI/ExperimentExperimentComparison.cs +++ b/ProteoformSuiteGUI/ExperimentExperimentComparison.cs @@ -16,6 +16,7 @@ public partial class ExperimentExperimentComparison : Form, ISweetForm #region Private Field private RelationUtility relationUtility; + private List displayRelations = new List(); #endregion Private Field @@ -87,7 +88,7 @@ public void FillTablesAndCharts() { dgv_EE_Peaks.CurrentCellDirtyStateChanged -= EE_Peak_List_DirtyStateChanged;//remove event handler on form load and table refresh event FillEEPeakListTable(); - FillEEPairsGridView(); + FillEERelationsGridView(); DisplayProteoformRelation.FormatRelationsGridView(dgv_EE_Relations, false, true); DisplayUtility.FormatPeakListGridView(dgv_EE_Peaks, true); GraphEERelations(); @@ -134,13 +135,13 @@ public void InitializeParameterSet() nUD_MaxRetTimeDifference.Maximum = 60; nUD_MaxRetTimeDifference.Value = Convert.ToDecimal(SaveState.lollipop.ee_max_RetentionTime_difference); - //tb_peakTableFilter.TextChanged -= tb_peakTableFilter_TextChanged; - //tb_peakTableFilter.Text = ""; - //tb_peakTableFilter.TextChanged += tb_peakTableFilter_TextChanged; + tb_peakTableFilter.TextChanged -= tb_peakTableFilter_TextChanged; + tb_peakTableFilter.Text = ""; + tb_peakTableFilter.TextChanged += tb_peakTableFilter_TextChanged; - //tb_relationTableFilter.TextChanged -= tb_relationTableFilter_TextChanged; - //tb_relationTableFilter.Text = ""; - //tb_relationTableFilter.TextChanged += tb_relationTableFilter_TextChanged; + tb_relationTableFilter.TextChanged -= tb_relationTableFilter_TextChanged; + tb_relationTableFilter.Text = ""; + tb_relationTableFilter.TextChanged += tb_relationTableFilter_TextChanged; //MASS WINDOW nUD_EE_Upper_Bound.Minimum = 0; @@ -179,14 +180,14 @@ private void update_figures_of_merit() #region EE Peak List Private Methods - //private void tb_peakTableFilter_TextChanged(object sender, EventArgs e) - //{ - // IEnumerable selected_peaks = tb_peakTableFilter.Text == "" ? - // SaveState.lollipop.ee_peaks : - // ExtensionMethods.filter(SaveState.lollipop.ee_peaks, tb_peakTableFilter.Text); - // DisplayUtility.FillDataGridView(dgv_EE_Peaks, selected_peaks.OfType()); - // DisplayUtility.FormatPeakListGridView(dgv_EE_Peaks, true); - //} + private void tb_peakTableFilter_TextChanged(object sender, EventArgs e) + { + IEnumerable selected_peaks = tb_peakTableFilter.Text == "" ? + SaveState.lollipop.ee_peaks : + ExtensionMethods.filter(SaveState.lollipop.ee_peaks, tb_peakTableFilter.Text); + DisplayUtility.FillDataGridView(dgv_EE_Peaks, selected_peaks.OfType()); + DisplayUtility.FormatPeakListGridView(dgv_EE_Peaks, true); + } private void FillEEPeakListTable() { @@ -218,18 +219,19 @@ private void EE_Peak_List_DirtyStateChanged(object sender, EventArgs e) #region Histogram Private Methods - //private void tb_relationTableFilter_TextChanged(object sender, EventArgs e) - //{ - // IEnumerable selected_peaks = tb_relationTableFilter.Text == "" ? - // SaveState.lollipop.ee_relations : - // ExtensionMethods.filter(SaveState.lollipop.ee_relations, tb_relationTableFilter.Text); - // DisplayUtility.FillDataGridView(dgv_EE_Relations, selected_peaks.OfType().Select(r => new DisplayProteoformRelation(r))); - // DisplayProteoformRelation.FormatRelationsGridView(dgv_EE_Relations, false, true); - //} + private void tb_relationTableFilter_TextChanged(object sender, EventArgs e) + { + IEnumerable selected_peaks = tb_relationTableFilter.Text == "" ? + displayRelations : + ExtensionMethods.filter(displayRelations.ToList(), tb_relationTableFilter.Text); + DisplayUtility.FillDataGridView(dgv_EE_Relations, selected_peaks); + DisplayProteoformRelation.FormatRelationsGridView(dgv_EE_Relations, false, true); + } - private void FillEEPairsGridView() + private void FillEERelationsGridView() { - DisplayUtility.FillDataGridView(dgv_EE_Relations, SaveState.lollipop.ee_relations.Select(r => new DisplayProteoformRelation(r))); + displayRelations = SaveState.lollipop.ee_relations.Select(r => new DisplayProteoformRelation(r)).ToList(); + DisplayUtility.FillDataGridView(dgv_EE_Relations, displayRelations); } private void GraphEERelations() diff --git a/ProteoformSuiteGUI/ExperimentTheoreticalComparison.Designer.cs b/ProteoformSuiteGUI/ExperimentTheoreticalComparison.Designer.cs index a7834089..a929db1d 100644 --- a/ProteoformSuiteGUI/ExperimentTheoreticalComparison.Designer.cs +++ b/ProteoformSuiteGUI/ExperimentTheoreticalComparison.Designer.cs @@ -47,7 +47,13 @@ private void InitializeComponent() this.splitContainer5 = new System.Windows.Forms.SplitContainer(); this.dgv_ET_Peak_List = new System.Windows.Forms.DataGridView(); this.ct_ET_peakList = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); this.cb_view_decoy_histogram = new System.Windows.Forms.CheckBox(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.label12 = new System.Windows.Forms.Label(); + this.tb_relationTableFilter = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.tb_peakTableFilter = new System.Windows.Forms.TextBox(); this.bt_compare_ET = new System.Windows.Forms.Button(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.tb_max_accepted_fdr = new System.Windows.Forms.TextBox(); @@ -72,8 +78,9 @@ private void InitializeComponent() this.nUD_NoManLower = new System.Windows.Forms.NumericUpDown(); this.label1 = new System.Windows.Forms.Label(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.dgv_ET_Pairs = new System.Windows.Forms.DataGridView(); + this.dgv_ET_Relations = new System.Windows.Forms.DataGridView(); this.ct_ET_Histogram = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.cb_Graph_lowerThreshold = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -92,6 +99,8 @@ private void InitializeComponent() this.splitContainer5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgv_ET_Peak_List)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ct_ET_peakList)).BeginInit(); + this.groupBox6.SuspendLayout(); + this.groupBox5.SuspendLayout(); this.groupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUD_PeakWidthBase)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUD_PeakCountMinThreshold)).BeginInit(); @@ -110,7 +119,7 @@ private void InitializeComponent() this.splitContainer2.Panel1.SuspendLayout(); this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dgv_ET_Pairs)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgv_ET_Relations)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ct_ET_Histogram)).BeginInit(); this.SuspendLayout(); // @@ -147,7 +156,8 @@ private void InitializeComponent() // // splitContainer3.Panel2 // - this.splitContainer3.Panel2.Controls.Add(this.cb_view_decoy_histogram); + this.splitContainer3.Panel2.Controls.Add(this.groupBox6); + this.splitContainer3.Panel2.Controls.Add(this.groupBox5); this.splitContainer3.Panel2.Controls.Add(this.bt_compare_ET); this.splitContainer3.Panel2.Controls.Add(this.groupBox4); this.splitContainer3.Panel2.Controls.Add(this.groupBox3); @@ -283,11 +293,23 @@ private void InitializeComponent() this.ct_ET_peakList.TabIndex = 1; this.ct_ET_peakList.Text = "chart1"; // + // groupBox6 + // + this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox6.Controls.Add(this.cb_Graph_lowerThreshold); + this.groupBox6.Controls.Add(this.cb_view_decoy_histogram); + this.groupBox6.Location = new System.Drawing.Point(486, 185); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(263, 93); + this.groupBox6.TabIndex = 36; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "ET Histogram Selection"; + // // cb_view_decoy_histogram // this.cb_view_decoy_histogram.AutoSize = true; this.cb_view_decoy_histogram.Enabled = false; - this.cb_view_decoy_histogram.Location = new System.Drawing.Point(192, 62); + this.cb_view_decoy_histogram.Location = new System.Drawing.Point(25, 29); this.cb_view_decoy_histogram.Name = "cb_view_decoy_histogram"; this.cb_view_decoy_histogram.Size = new System.Drawing.Size(196, 17); this.cb_view_decoy_histogram.TabIndex = 33; @@ -295,6 +317,54 @@ private void InitializeComponent() this.cb_view_decoy_histogram.UseVisualStyleBackColor = true; this.cb_view_decoy_histogram.CheckedChanged += new System.EventHandler(this.cb_view_decoy_histogram_CheckedChanged); // + // groupBox5 + // + this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox5.Controls.Add(this.label12); + this.groupBox5.Controls.Add(this.tb_relationTableFilter); + this.groupBox5.Controls.Add(this.label13); + this.groupBox5.Controls.Add(this.tb_peakTableFilter); + this.groupBox5.Location = new System.Drawing.Point(486, 79); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(263, 100); + this.groupBox5.TabIndex = 35; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "Table Control"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(137, 60); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(118, 13); + this.label12.TabIndex = 3; + this.label12.Text = "EE Relation Table Filter"; + // + // tb_relationTableFilter + // + this.tb_relationTableFilter.Location = new System.Drawing.Point(25, 57); + this.tb_relationTableFilter.Name = "tb_relationTableFilter"; + this.tb_relationTableFilter.Size = new System.Drawing.Size(100, 20); + this.tb_relationTableFilter.TabIndex = 2; + this.tb_relationTableFilter.TextChanged += new System.EventHandler(this.tb_relationTableFilter_TextChanged); + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(137, 25); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(104, 13); + this.label13.TabIndex = 1; + this.label13.Text = "EE Peak Table Filter"; + // + // tb_peakTableFilter + // + this.tb_peakTableFilter.Location = new System.Drawing.Point(25, 22); + this.tb_peakTableFilter.Name = "tb_peakTableFilter"; + this.tb_peakTableFilter.Size = new System.Drawing.Size(100, 20); + this.tb_peakTableFilter.TabIndex = 0; + this.tb_peakTableFilter.TextChanged += new System.EventHandler(this.tb_peakTableFilter_TextChanged); + // // bt_compare_ET // this.bt_compare_ET.Dock = System.Windows.Forms.DockStyle.Bottom; @@ -316,18 +386,18 @@ private void InitializeComponent() this.groupBox4.Controls.Add(this.label3); this.groupBox4.Controls.Add(this.nUD_PeakWidthBase); this.groupBox4.Controls.Add(this.nUD_PeakCountMinThreshold); - this.groupBox4.Location = new System.Drawing.Point(199, 97); + this.groupBox4.Location = new System.Drawing.Point(29, 73); this.groupBox4.Margin = new System.Windows.Forms.Padding(2); this.groupBox4.Name = "groupBox4"; this.groupBox4.Padding = new System.Windows.Forms.Padding(2); - this.groupBox4.Size = new System.Drawing.Size(242, 101); + this.groupBox4.Size = new System.Drawing.Size(242, 108); this.groupBox4.TabIndex = 15; this.groupBox4.TabStop = false; this.groupBox4.Text = "ET Peak List Parameters"; // // tb_max_accepted_fdr // - this.tb_max_accepted_fdr.Location = new System.Drawing.Point(133, 71); + this.tb_max_accepted_fdr.Location = new System.Drawing.Point(138, 76); this.tb_max_accepted_fdr.Margin = new System.Windows.Forms.Padding(2); this.tb_max_accepted_fdr.Name = "tb_max_accepted_fdr"; this.tb_max_accepted_fdr.ReadOnly = true; @@ -338,7 +408,7 @@ private void InitializeComponent() // this.label9.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(0, 74); + this.label9.Location = new System.Drawing.Point(4, 79); this.label9.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(129, 13); @@ -349,7 +419,7 @@ private void InitializeComponent() // this.label4.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(16, 18); + this.label4.Location = new System.Drawing.Point(16, 25); this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(113, 13); @@ -360,7 +430,7 @@ private void InitializeComponent() // this.label3.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(16, 48); + this.label3.Location = new System.Drawing.Point(16, 55); this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(105, 13); @@ -376,7 +446,7 @@ private void InitializeComponent() 0, 0, 196608}); - this.nUD_PeakWidthBase.Location = new System.Drawing.Point(133, 16); + this.nUD_PeakWidthBase.Location = new System.Drawing.Point(138, 23); this.nUD_PeakWidthBase.Margin = new System.Windows.Forms.Padding(2); this.nUD_PeakWidthBase.Maximum = new decimal(new int[] { 5, @@ -384,7 +454,7 @@ private void InitializeComponent() 0, 65536}); this.nUD_PeakWidthBase.Name = "nUD_PeakWidthBase"; - this.nUD_PeakWidthBase.Size = new System.Drawing.Size(80, 20); + this.nUD_PeakWidthBase.Size = new System.Drawing.Size(86, 20); this.nUD_PeakWidthBase.TabIndex = 13; this.nUD_PeakWidthBase.Value = new decimal(new int[] { 1, @@ -396,10 +466,10 @@ private void InitializeComponent() // nUD_PeakCountMinThreshold // this.nUD_PeakCountMinThreshold.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.nUD_PeakCountMinThreshold.Location = new System.Drawing.Point(133, 43); + this.nUD_PeakCountMinThreshold.Location = new System.Drawing.Point(138, 50); this.nUD_PeakCountMinThreshold.Margin = new System.Windows.Forms.Padding(2); this.nUD_PeakCountMinThreshold.Name = "nUD_PeakCountMinThreshold"; - this.nUD_PeakCountMinThreshold.Size = new System.Drawing.Size(80, 20); + this.nUD_PeakCountMinThreshold.Size = new System.Drawing.Size(86, 20); this.nUD_PeakCountMinThreshold.TabIndex = 10; this.nUD_PeakCountMinThreshold.ValueChanged += new System.EventHandler(this.nUD_PeakCountMinThreshold_ValueChanged); // @@ -410,11 +480,11 @@ private void InitializeComponent() this.groupBox3.Controls.Add(this.label6); this.groupBox3.Controls.Add(this.nUD_ET_Lower_Bound); this.groupBox3.Controls.Add(this.nUD_ET_Upper_Bound); - this.groupBox3.Location = new System.Drawing.Point(431, 115); + this.groupBox3.Location = new System.Drawing.Point(278, 73); this.groupBox3.Margin = new System.Windows.Forms.Padding(2); this.groupBox3.Name = "groupBox3"; this.groupBox3.Padding = new System.Windows.Forms.Padding(2); - this.groupBox3.Size = new System.Drawing.Size(192, 83); + this.groupBox3.Size = new System.Drawing.Size(192, 108); this.groupBox3.TabIndex = 14; this.groupBox3.TabStop = false; this.groupBox3.Text = "ET Histogram Boundaries"; @@ -423,7 +493,7 @@ private void InitializeComponent() // this.label5.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(31, 27); + this.label5.Location = new System.Drawing.Point(20, 30); this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(59, 13); @@ -434,7 +504,7 @@ private void InitializeComponent() // this.label6.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(31, 54); + this.label6.Location = new System.Drawing.Point(20, 57); this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(59, 13); @@ -444,7 +514,7 @@ private void InitializeComponent() // nUD_ET_Lower_Bound // this.nUD_ET_Lower_Bound.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.nUD_ET_Lower_Bound.Location = new System.Drawing.Point(107, 23); + this.nUD_ET_Lower_Bound.Location = new System.Drawing.Point(96, 26); this.nUD_ET_Lower_Bound.Margin = new System.Windows.Forms.Padding(2); this.nUD_ET_Lower_Bound.Maximum = new decimal(new int[] { 0, @@ -464,7 +534,7 @@ private void InitializeComponent() // nUD_ET_Upper_Bound // this.nUD_ET_Upper_Bound.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.nUD_ET_Upper_Bound.Location = new System.Drawing.Point(107, 54); + this.nUD_ET_Upper_Bound.Location = new System.Drawing.Point(96, 57); this.nUD_ET_Upper_Bound.Margin = new System.Windows.Forms.Padding(2); this.nUD_ET_Upper_Bound.Maximum = new decimal(new int[] { 500, @@ -483,11 +553,11 @@ private void InitializeComponent() this.groupBox2.Controls.Add(this.xMinET); this.groupBox2.Controls.Add(this.yMinET); this.groupBox2.Controls.Add(this.xMaxET); - this.groupBox2.Location = new System.Drawing.Point(431, 202); + this.groupBox2.Location = new System.Drawing.Point(278, 185); this.groupBox2.Margin = new System.Windows.Forms.Padding(2); this.groupBox2.Name = "groupBox2"; this.groupBox2.Padding = new System.Windows.Forms.Padding(2); - this.groupBox2.Size = new System.Drawing.Size(192, 83); + this.groupBox2.Size = new System.Drawing.Size(192, 92); this.groupBox2.TabIndex = 11; this.groupBox2.TabStop = false; this.groupBox2.Text = "ET Histogram Scaling"; @@ -495,7 +565,7 @@ private void InitializeComponent() // yMaxET // this.yMaxET.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.yMaxET.Location = new System.Drawing.Point(63, 20); + this.yMaxET.Location = new System.Drawing.Point(63, 29); this.yMaxET.Margin = new System.Windows.Forms.Padding(2); this.yMaxET.Minimum = new decimal(new int[] { 100, @@ -516,7 +586,7 @@ private void InitializeComponent() 0, 0, 65536}); - this.xMinET.Location = new System.Drawing.Point(23, 41); + this.xMinET.Location = new System.Drawing.Point(23, 50); this.xMinET.Margin = new System.Windows.Forms.Padding(2); this.xMinET.Minimum = new decimal(new int[] { 100, @@ -531,7 +601,7 @@ private void InitializeComponent() // yMinET // this.yMinET.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.yMinET.Location = new System.Drawing.Point(63, 60); + this.yMinET.Location = new System.Drawing.Point(63, 69); this.yMinET.Margin = new System.Windows.Forms.Padding(2); this.yMinET.Minimum = new decimal(new int[] { 100, @@ -552,7 +622,7 @@ private void InitializeComponent() 0, 0, 65536}); - this.xMaxET.Location = new System.Drawing.Point(107, 41); + this.xMaxET.Location = new System.Drawing.Point(107, 50); this.xMaxET.Margin = new System.Windows.Forms.Padding(2); this.xMaxET.Minimum = new decimal(new int[] { 100, @@ -571,11 +641,11 @@ private void InitializeComponent() this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.nUD_NoManLower); this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Location = new System.Drawing.Point(199, 202); + this.groupBox1.Location = new System.Drawing.Point(32, 185); this.groupBox1.Margin = new System.Windows.Forms.Padding(2); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(2); - this.groupBox1.Size = new System.Drawing.Size(221, 83); + this.groupBox1.Size = new System.Drawing.Size(239, 92); this.groupBox1.TabIndex = 8; this.groupBox1.TabStop = false; this.groupBox1.Text = "No Man\'s Land"; @@ -589,7 +659,7 @@ private void InitializeComponent() 0, 0, 131072}); - this.nUD_NoManUpper.Location = new System.Drawing.Point(124, 60); + this.nUD_NoManUpper.Location = new System.Drawing.Point(133, 61); this.nUD_NoManUpper.Margin = new System.Windows.Forms.Padding(2); this.nUD_NoManUpper.Maximum = new decimal(new int[] { 1, @@ -615,7 +685,7 @@ private void InitializeComponent() // this.label2.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(5, 62); + this.label2.Location = new System.Drawing.Point(14, 63); this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(93, 13); @@ -631,7 +701,7 @@ private void InitializeComponent() 0, 0, 131072}); - this.nUD_NoManLower.Location = new System.Drawing.Point(124, 20); + this.nUD_NoManLower.Location = new System.Drawing.Point(133, 29); this.nUD_NoManLower.Margin = new System.Windows.Forms.Padding(2); this.nUD_NoManLower.Maximum = new decimal(new int[] { 99, @@ -647,7 +717,7 @@ private void InitializeComponent() // this.label1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(5, 21); + this.label1.Location = new System.Drawing.Point(14, 30); this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(93, 13); @@ -664,7 +734,7 @@ private void InitializeComponent() // // splitContainer2.Panel1 // - this.splitContainer2.Panel1.Controls.Add(this.dgv_ET_Pairs); + this.splitContainer2.Panel1.Controls.Add(this.dgv_ET_Relations); // // splitContainer2.Panel2 // @@ -674,20 +744,20 @@ private void InitializeComponent() this.splitContainer2.SplitterWidth = 3; this.splitContainer2.TabIndex = 0; // - // dgv_ET_Pairs - // - this.dgv_ET_Pairs.AllowUserToAddRows = false; - this.dgv_ET_Pairs.AllowUserToDeleteRows = false; - this.dgv_ET_Pairs.AllowUserToOrderColumns = true; - this.dgv_ET_Pairs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dgv_ET_Pairs.Dock = System.Windows.Forms.DockStyle.Fill; - this.dgv_ET_Pairs.Location = new System.Drawing.Point(0, 0); - this.dgv_ET_Pairs.Margin = new System.Windows.Forms.Padding(2); - this.dgv_ET_Pairs.Name = "dgv_ET_Pairs"; - this.dgv_ET_Pairs.ReadOnly = true; - this.dgv_ET_Pairs.RowTemplate.Height = 28; - this.dgv_ET_Pairs.Size = new System.Drawing.Size(710, 508); - this.dgv_ET_Pairs.TabIndex = 0; + // dgv_ET_Relations + // + this.dgv_ET_Relations.AllowUserToAddRows = false; + this.dgv_ET_Relations.AllowUserToDeleteRows = false; + this.dgv_ET_Relations.AllowUserToOrderColumns = true; + this.dgv_ET_Relations.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgv_ET_Relations.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgv_ET_Relations.Location = new System.Drawing.Point(0, 0); + this.dgv_ET_Relations.Margin = new System.Windows.Forms.Padding(2); + this.dgv_ET_Relations.Name = "dgv_ET_Relations"; + this.dgv_ET_Relations.ReadOnly = true; + this.dgv_ET_Relations.RowTemplate.Height = 28; + this.dgv_ET_Relations.Size = new System.Drawing.Size(710, 508); + this.dgv_ET_Relations.TabIndex = 0; // // ct_ET_Histogram // @@ -709,6 +779,19 @@ private void InitializeComponent() this.ct_ET_Histogram.TabIndex = 0; this.ct_ET_Histogram.Text = "chart1"; // + // cb_Graph_lowerThreshold + // + this.cb_Graph_lowerThreshold.AutoSize = true; + this.cb_Graph_lowerThreshold.Checked = true; + this.cb_Graph_lowerThreshold.CheckState = System.Windows.Forms.CheckState.Checked; + this.cb_Graph_lowerThreshold.Location = new System.Drawing.Point(25, 53); + this.cb_Graph_lowerThreshold.Name = "cb_Graph_lowerThreshold"; + this.cb_Graph_lowerThreshold.Size = new System.Drawing.Size(103, 17); + this.cb_Graph_lowerThreshold.TabIndex = 28; + this.cb_Graph_lowerThreshold.Text = "Show Threshold"; + this.cb_Graph_lowerThreshold.UseVisualStyleBackColor = true; + this.cb_Graph_lowerThreshold.CheckedChanged += new System.EventHandler(this.cb_Graph_lowerThreshold_CheckedChanged); + // // ExperimentTheoreticalComparison // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -726,7 +809,6 @@ private void InitializeComponent() this.splitContainer1.ResumeLayout(false); this.splitContainer3.Panel1.ResumeLayout(false); this.splitContainer3.Panel2.ResumeLayout(false); - this.splitContainer3.Panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); this.splitContainer3.ResumeLayout(false); this.splitContainer4.Panel1.ResumeLayout(false); @@ -740,6 +822,10 @@ private void InitializeComponent() this.splitContainer5.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dgv_ET_Peak_List)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ct_ET_peakList)).EndInit(); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUD_PeakWidthBase)).EndInit(); @@ -761,7 +847,7 @@ private void InitializeComponent() this.splitContainer2.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dgv_ET_Pairs)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgv_ET_Relations)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ct_ET_Histogram)).EndInit(); this.ResumeLayout(false); @@ -804,7 +890,14 @@ private void InitializeComponent() private System.Windows.Forms.Button bt_compare_ET; private System.Windows.Forms.TextBox tb_max_accepted_fdr; private System.Windows.Forms.Label label9; - private System.Windows.Forms.DataGridView dgv_ET_Pairs; + private System.Windows.Forms.DataGridView dgv_ET_Relations; private System.Windows.Forms.CheckBox cb_view_decoy_histogram; + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.TextBox tb_relationTableFilter; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.TextBox tb_peakTableFilter; + private System.Windows.Forms.CheckBox cb_Graph_lowerThreshold; } } \ No newline at end of file diff --git a/ProteoformSuiteGUI/ExperimentTheoreticalComparison.cs b/ProteoformSuiteGUI/ExperimentTheoreticalComparison.cs index c4e13f9c..530fc09f 100644 --- a/ProteoformSuiteGUI/ExperimentTheoreticalComparison.cs +++ b/ProteoformSuiteGUI/ExperimentTheoreticalComparison.cs @@ -16,6 +16,7 @@ public partial class ExperimentTheoreticalComparison : Form, ISweetForm #region Private Fields private RelationUtility relationUtility; + private List displayRelations = new List(); #endregion Private Fields @@ -57,7 +58,7 @@ public void FillTablesAndCharts() dgv_ET_Peak_List.CurrentCellDirtyStateChanged -= ET_Peak_List_DirtyStateChanged;//remove event handler on form load and table refresh event FillETPeakListTable(); FillETRelationsGridView(); - DisplayProteoformRelation.FormatRelationsGridView(dgv_ET_Pairs, true, false); + DisplayProteoformRelation.FormatRelationsGridView(dgv_ET_Relations, true, false); DisplayUtility.FormatPeakListGridView(dgv_ET_Peak_List, false); GraphETRelations(); GraphETPeaks(); @@ -67,7 +68,7 @@ public void FillTablesAndCharts() public List GetDGVs() { - return new List() { dgv_ET_Pairs, dgv_ET_Peak_List }; + return new List() { dgv_ET_Relations, dgv_ET_Peak_List }; } public void ClearListsTablesFigures() @@ -77,9 +78,9 @@ public void ClearListsTablesFigures() foreach (var series in ct_ET_Histogram.Series) series.Points.Clear(); foreach (var series in ct_ET_peakList.Series) series.Points.Clear(); - dgv_ET_Pairs.DataSource = null; + dgv_ET_Relations.DataSource = null; dgv_ET_Peak_List.DataSource = null; - dgv_ET_Pairs.Rows.Clear(); + dgv_ET_Relations.Rows.Clear(); dgv_ET_Peak_List.Rows.Clear(); } @@ -117,13 +118,13 @@ public void InitializeParameterSet() nUD_PeakCountMinThreshold.Maximum = 1000; nUD_PeakCountMinThreshold.Value = Convert.ToDecimal(SaveState.lollipop.min_peak_count_et); // ET pairs with [Peak Center Count] AND ET peaks with [Peak Count] above this value are considered acceptable for use in proteoform family. this will be eventually set following ED analysis. - //tb_peakTableFilter.TextChanged -= tb_peakTableFilter_TextChanged; - //tb_peakTableFilter.Text = ""; - //tb_peakTableFilter.TextChanged += tb_peakTableFilter_TextChanged; + tb_peakTableFilter.TextChanged -= tb_peakTableFilter_TextChanged; + tb_peakTableFilter.Text = ""; + tb_peakTableFilter.TextChanged += tb_peakTableFilter_TextChanged; - //tb_relationTableFilter.TextChanged -= tb_relationTableFilter_TextChanged; - //tb_relationTableFilter.Text = ""; - //tb_relationTableFilter.TextChanged += tb_relationTableFilter_TextChanged; + tb_relationTableFilter.TextChanged -= tb_relationTableFilter_TextChanged; + tb_relationTableFilter.Text = ""; + tb_relationTableFilter.TextChanged += tb_relationTableFilter_TextChanged; //MASS WINDOW //only do this if ET hasn't already been run @@ -194,23 +195,18 @@ private void GraphETPeaks() DisplayUtility.GraphDeltaMassPeaks(ct_ET_peakList, SaveState.lollipop.et_peaks, "Peak Count", "Median Decoy Count", SaveState.lollipop.et_relations, "Nearby Relations"); } - private void FillETRelationsGridView() - { - DisplayUtility.FillDataGridView(dgv_ET_Pairs, SaveState.lollipop.et_relations.Select(r => new DisplayProteoformRelation(r))); - } - #endregion Other Private Methods #region ET Peak List Private Methods - //private void tb_peakTableFilter_TextChanged(object sender, EventArgs e) - //{ - // IEnumerable selected_peaks = tb_peakTableFilter.Text == "" ? - // SaveState.lollipop.et_peaks : - // ExtensionMethods.filter(SaveState.lollipop.et_peaks, tb_peakTableFilter.Text); - // DisplayUtility.FillDataGridView(dgv_ET_Peak_List, selected_peaks.OfType()); - // DisplayUtility.FormatPeakListGridView(dgv_ET_Peak_List, false); - //} + private void tb_peakTableFilter_TextChanged(object sender, EventArgs e) + { + IEnumerable selected_peaks = tb_peakTableFilter.Text == "" ? + SaveState.lollipop.et_peaks : + ExtensionMethods.filter(SaveState.lollipop.et_peaks, tb_peakTableFilter.Text); + DisplayUtility.FillDataGridView(dgv_ET_Peak_List, selected_peaks.OfType()); + DisplayUtility.FormatPeakListGridView(dgv_ET_Peak_List, false); + } private void FillETPeakListTable() { @@ -282,14 +278,20 @@ private void ET_peak_List_Menu_ItemClicked(object sender, ToolStripItemClickedEv #region Histogram Private Methods - //private void tb_relationTableFilter_TextChanged(object sender, EventArgs e) - //{ - // IEnumerable selected_peaks = tb_relationTableFilter.Text == "" ? - // SaveState.lollipop.et_relations : - // ExtensionMethods.filter(SaveState.lollipop.et_relations, tb_relationTableFilter.Text); - // DisplayUtility.FillDataGridView(dgv_ET_Pairs, selected_peaks.OfType().Select(r => new DisplayProteoformRelation(r))); - // DisplayProteoformRelation.FormatRelationsGridView(dgv_ET_Pairs, true, false); - //} + private void tb_relationTableFilter_TextChanged(object sender, EventArgs e) + { + IEnumerable selected_peaks = tb_relationTableFilter.Text == "" ? + displayRelations : + ExtensionMethods.filter(displayRelations.ToList(), tb_relationTableFilter.Text); + DisplayUtility.FillDataGridView(dgv_ET_Relations, selected_peaks); + DisplayProteoformRelation.FormatRelationsGridView(dgv_ET_Relations, true, false); + } + + private void FillETRelationsGridView() + { + displayRelations = SaveState.lollipop.et_relations.Select(r => new DisplayProteoformRelation(r)).ToList(); + DisplayUtility.FillDataGridView(dgv_ET_Relations, displayRelations); + } private void GraphETRelations() { @@ -346,6 +348,14 @@ private void xMaxET_ValueChanged(object sender, EventArgs e) ct_ET_Histogram.ChartAreas[0].AxisX.Maximum = Convert.ToDouble(xMaxET.Value); } + //Stripline + private void cb_Graph_lowerThreshold_CheckedChanged(object sender, EventArgs e) + { + if (cb_Graph_lowerThreshold.Checked) + ct_ET_Histogram.ChartAreas[0].AxisY.StripLines.Add(new StripLine() { BorderColor = Color.Red, IntervalOffset = Convert.ToDouble(nUD_PeakCountMinThreshold.Value) }); + else if (!cb_Graph_lowerThreshold.Checked) ct_ET_Histogram.ChartAreas[0].AxisY.StripLines.Clear(); + } + #endregion Histogram Private Methods #region Parameters Private Methods @@ -377,7 +387,7 @@ private void nUD_PeakCountMinThreshold_ValueChanged(object sender, EventArgs e) p.Accepted = p.peak_relation_group_count >= SaveState.lollipop.min_peak_count_et; Parallel.ForEach(p.grouped_relations, r => r.Accepted = p.Accepted); }); - dgv_ET_Pairs.Refresh(); + dgv_ET_Relations.Refresh(); dgv_ET_Peak_List.Refresh(); ct_ET_Histogram.ChartAreas[0].AxisY.StripLines.Clear(); StripLine lowerCountBound_stripline = new StripLine() { BorderColor = Color.Red, IntervalOffset = SaveState.lollipop.min_peak_count_et }; @@ -409,7 +419,7 @@ private void ct_ET_peakList_MouseClick(object sender, MouseEventArgs e) private void ET_Peak_List_DirtyStateChanged(object sender, EventArgs e) { relationUtility.peak_acceptability_change(dgv_ET_Peak_List); - dgv_ET_Pairs.Refresh(); + dgv_ET_Relations.Refresh(); dgv_ET_Peak_List.Refresh(); update_figures_of_merit(); } diff --git a/ProteoformSuiteGUI/LoadDeconvolutionResults.Designer.cs b/ProteoformSuiteGUI/LoadDeconvolutionResults.Designer.cs index 3dd6bd89..a4189731 100644 --- a/ProteoformSuiteGUI/LoadDeconvolutionResults.Designer.cs +++ b/ProteoformSuiteGUI/LoadDeconvolutionResults.Designer.cs @@ -57,6 +57,7 @@ private void InitializeComponent() this.groupBox4 = new System.Windows.Forms.GroupBox(); this.rb_chemicalCalibration = new System.Windows.Forms.RadioButton(); this.rb_standardOptions = new System.Windows.Forms.RadioButton(); + this.btn_stepThrough = new System.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgv_loadFiles1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgv_loadFiles2)).BeginInit(); @@ -201,7 +202,7 @@ private void InitializeComponent() // // btn_fullRun // - this.btn_fullRun.Location = new System.Drawing.Point(675, 626); + this.btn_fullRun.Location = new System.Drawing.Point(843, 626); this.btn_fullRun.Name = "btn_fullRun"; this.btn_fullRun.Size = new System.Drawing.Size(156, 92); this.btn_fullRun.TabIndex = 17; @@ -211,7 +212,7 @@ private void InitializeComponent() // // bt_clearResults // - this.bt_clearResults.Location = new System.Drawing.Point(837, 626); + this.bt_clearResults.Location = new System.Drawing.Point(1005, 626); this.bt_clearResults.Name = "bt_clearResults"; this.bt_clearResults.Size = new System.Drawing.Size(156, 92); this.bt_clearResults.TabIndex = 26; @@ -361,10 +362,21 @@ private void InitializeComponent() this.rb_standardOptions.UseVisualStyleBackColor = true; this.rb_standardOptions.CheckedChanged += new System.EventHandler(this.rb_standardOptions_CheckedChanged); // + // btn_stepThrough + // + this.btn_stepThrough.Location = new System.Drawing.Point(680, 626); + this.btn_stepThrough.Name = "btn_stepThrough"; + this.btn_stepThrough.Size = new System.Drawing.Size(156, 92); + this.btn_stepThrough.TabIndex = 36; + this.btn_stepThrough.Text = "Step Through Processes"; + this.btn_stepThrough.UseVisualStyleBackColor = true; + this.btn_stepThrough.Click += new System.EventHandler(this.btn_stepThrough_Click); + // // LoadDeconvolutionResults // this.ClientSize = new System.Drawing.Size(1362, 736); this.ControlBox = false; + this.Controls.Add(this.btn_stepThrough); this.Controls.Add(this.groupBox4); this.Controls.Add(this.cmb_loadTable3); this.Controls.Add(this.cmb_loadTable2); @@ -430,5 +442,6 @@ private void InitializeComponent() private System.Windows.Forms.RadioButton rb_standardOptions; private System.Windows.Forms.Label lb_filter3; private System.Windows.Forms.TextBox tb_filter3; + private System.Windows.Forms.Button btn_stepThrough; } } \ No newline at end of file diff --git a/ProteoformSuiteGUI/LoadDeconvolutionResults.cs b/ProteoformSuiteGUI/LoadDeconvolutionResults.cs index 9d49c9ad..d71a168b 100644 --- a/ProteoformSuiteGUI/LoadDeconvolutionResults.cs +++ b/ProteoformSuiteGUI/LoadDeconvolutionResults.cs @@ -282,7 +282,7 @@ private void clear_files(ComboBox cmb, DataGridView dgv) } #endregion CLEAR BUTTONS Private Methods - #region FULL RUN Private Methods + #region FULL RUN & STEP THROUGH Private Methods private void btn_fullRun_Click(object sender, EventArgs e) { @@ -305,7 +305,15 @@ private void cb_run_when_load_CheckedChanged(object sender, EventArgs e) { ProteoformSweet.run_when_form_loads = cb_run_when_load.Checked; } - #endregion FULL RUN Private Methods + + private void btn_stepThrough_Click(object sender, EventArgs e) + { + (MdiParent as ProteoformSweet).resultsToolStripMenuItem.ShowDropDown(); + MessageBox.Show("Use the Results menu to step through processing results.\n\n" + + "Load results and databases in this panel, and then proceed to Raw Experimental Components.", "Step Through Introduction."); + } + + #endregion FULL RUN & STEP THROUGH Private Methods #region FILTERS Private Methods diff --git a/ProteoformSuiteGUI/ProteoformSweet.Designer.cs b/ProteoformSuiteGUI/ProteoformSweet.Designer.cs index c02e03e1..9557e973 100644 --- a/ProteoformSuiteGUI/ProteoformSweet.Designer.cs +++ b/ProteoformSuiteGUI/ProteoformSweet.Designer.cs @@ -242,7 +242,7 @@ private void InitializeComponent() private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem resultsToolStripMenuItem; + public System.Windows.Forms.ToolStripMenuItem resultsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem loadDeconvolutionResultsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem rawExperimentalProteoformsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem neuCodeProteoformPairsToolStripMenuItem; diff --git a/ProteoformSuiteGUI/ProteoformSweet.cs b/ProteoformSuiteGUI/ProteoformSweet.cs index a0dd8b9a..190fc19a 100644 --- a/ProteoformSuiteGUI/ProteoformSweet.cs +++ b/ProteoformSuiteGUI/ProteoformSweet.cs @@ -36,7 +36,7 @@ public partial class ProteoformSweet : Form SaveFileDialog saveResults = new SaveFileDialog(); SaveFileDialog saveExcelDialog = new SaveFileDialog(); List forms; - Form current_form; + ISweetForm current_form; #endregion Private Fields @@ -89,7 +89,7 @@ private void showForm(Form form) { form.Show(); form.WindowState = FormWindowState.Maximized; - current_form = form; + current_form = form as ISweetForm; } #endregion Private Setup Methods @@ -265,8 +265,11 @@ private void exportTablesToolStripMenuItem_Click(object sender, EventArgs e) private void export_table() { - if (current_form != resultsSummary && current_form != loadDeconvolutionResults) - SaveExcelFile(((ISweetForm)current_form).GetDGVs(), current_form.Name + "_table.xlsx"); + List grid_views = current_form.GetDGVs(); + if (grid_views != null) + { + SaveExcelFile(grid_views, (current_form as Form).Name + "_table.xlsx"); + } else { MessageBox.Show("There is no table on this page to export. Please navigate to another page with the Results tab."); @@ -276,7 +279,7 @@ private void export_table() private void SaveExcelFile(List dgvs, string filename) { saveExcelDialog.FileName = filename; - DialogResult dr = this.saveExcelDialog.ShowDialog(); + DialogResult dr = saveExcelDialog.ShowDialog(); if (dr == DialogResult.OK) { DGVExcelWriter writer = new DGVExcelWriter(); diff --git a/ProteoformSuiteInternal/PtmCombos.cs b/ProteoformSuiteInternal/PtmCombos.cs index 999523b7..ac3e6c2b 100644 --- a/ProteoformSuiteInternal/PtmCombos.cs +++ b/ProteoformSuiteInternal/PtmCombos.cs @@ -27,9 +27,11 @@ from modification in ptm_data[position].OfType() if (limit_triples_and_greater) { + List unique_mods = ptm_data.Values.SelectMany(m => m).OfType().Distinct().ToList(); for (int i = 3; i < num_ptms_needed + 1; i++) { - unique_mass_combinations.AddRange(ptm_data.Values.SelectMany(m => m).OfType().Select(m => new PtmSet(Enumerable.Repeat(new Ptm(-1, m), i).ToList(), modification_ranks, added_ptm_penalization))); + List mods_to_repeat = unique_mods.Where(m => ptm_data.Count(kv => kv.Value.Contains(m)) >= i).ToList(); // where the number of unique positions is greater than the number of times to repeat; + unique_mass_combinations.AddRange(mods_to_repeat.Select(m => new PtmSet(Enumerable.Repeat(new Ptm(-1, m), i).ToList(), modification_ranks, added_ptm_penalization))); } } diff --git a/Test/TestModification.cs b/Test/TestModification.cs index 26304ce7..2f040765 100644 --- a/Test/TestModification.cs +++ b/Test/TestModification.cs @@ -176,5 +176,29 @@ public void TestPtmCombos4() Assert.AreEqual(1 + 3 + 3, PtmCombos.get_combinations(ptm_data, 2, fake_ranks, 1, false).Count()); Assert.AreEqual(1 + 3 + 3 + 3, PtmCombos.get_combinations(ptm_data, 3, fake_ranks, 1, false).Count()); } + + [Test] + public void test_limit_large_combos() + { + IDictionary> a1 = new Dictionary> + { + { 1, new List{ ConstructorsForTesting.get_modWithMass("ox", 16) } }, + { 2, new List{ ConstructorsForTesting.get_modWithMass("ox", 16) } }, + { 3, new List{ ConstructorsForTesting.get_modWithMass("ox", 16) } }, + { 4, new List{ ConstructorsForTesting.get_modWithMass("ac", 42) } }, + }; + List sets1 = PtmCombos.get_combinations(a1, 3, new Dictionary { { 16, 1 }, { 42, 2 } }, 1, true); + Assert.AreEqual(1, sets1.Count(s => s.ptm_combination.Count == 3)); + Assert.True(sets1.Where(s => s.ptm_combination.Count == 3).First().ptm_combination.All(p => p.modification.id == "ox")); + + IDictionary> a2 = new Dictionary> + { + { 1, new List{ ConstructorsForTesting.get_modWithMass("ox", 16), ConstructorsForTesting.get_modWithMass("ox", 16) } }, + { 3, new List{ ConstructorsForTesting.get_modWithMass("ox", 16) } }, + { 4, new List{ ConstructorsForTesting.get_modWithMass("ac", 42) } }, + }; + List sets2 = PtmCombos.get_combinations(a2, 3, new Dictionary { { 16, 1 }, { 42, 2 } }, 1, true); + Assert.AreEqual(0, sets2.Count(s => s.ptm_combination.Count == 3)); + } } } diff --git a/Test/TestTheoreticalDatabaseCreate.cs b/Test/TestTheoreticalDatabaseCreate.cs index 6a99dc6e..9c80f31a 100755 --- a/Test/TestTheoreticalDatabaseCreate.cs +++ b/Test/TestTheoreticalDatabaseCreate.cs @@ -57,6 +57,7 @@ public void testTheoreticalDatabaseCreateWithPTMs() SaveState.lollipop.min_peptide_length = 7; SaveState.lollipop.ptmset_mass_tolerance = 0.00001; SaveState.lollipop.combine_identical_sequences = true; + SaveState.lollipop.theoretical_database.limit_triples_and_greater = false; SaveState.lollipop.enter_input_files(new string[] { Path.Combine(TestContext.CurrentContext.TestDirectory, "uniprot_yeast_test_12entries.xml") }, Lollipop.acceptable_extensions[2], Lollipop.file_types[2], SaveState.lollipop.input_files); SaveState.lollipop.enter_input_files(new string[] { Path.Combine(TestContext.CurrentContext.TestDirectory, "ptmlist.txt") }, Lollipop.acceptable_extensions[2], Lollipop.file_types[2], SaveState.lollipop.input_files); @@ -95,6 +96,7 @@ public void testTheoreticalDatabaseCreateWithoutPTMs() SaveState.lollipop.min_peptide_length = 7; SaveState.lollipop.ptmset_mass_tolerance = 0.00001; SaveState.lollipop.combine_identical_sequences = true; + SaveState.lollipop.theoretical_database.limit_triples_and_greater = false; SaveState.lollipop.enter_input_files(new string[] { Path.Combine(TestContext.CurrentContext.TestDirectory, "uniprot_yeast_test_12entries.xml") }, Lollipop.acceptable_extensions[2], Lollipop.file_types[2], SaveState.lollipop.input_files); SaveState.lollipop.enter_input_files(new string[] { Path.Combine(TestContext.CurrentContext.TestDirectory, "ptmlist.txt") }, Lollipop.acceptable_extensions[2], Lollipop.file_types[2], SaveState.lollipop.input_files);