Skip to content

Commit

Permalink
Merge pull request #327 from acesnik/master
Browse files Browse the repository at this point in the history
Gene-centric proteoform families
  • Loading branch information
Anthony authored Mar 21, 2017
2 parents a40bfcc + c836800 commit f4d5e39
Show file tree
Hide file tree
Showing 36 changed files with 989 additions and 587 deletions.
15 changes: 8 additions & 7 deletions ProteoformSuiteGUI/ExperimentExperimentComparison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,21 @@ public void compare_ee()
public void run_the_gamut()
{
this.Cursor = Cursors.WaitCursor;
Lollipop.make_ee_relationships();
Lollipop.make_ee_relationships(Lollipop.proteoform_community);
((ProteoformSweet)MdiParent).proteoformFamilies.ClearListsAndTables();

Parallel.Invoke
(
() => this.FillTablesAndCharts(),
() => { if (Lollipop.neucode_labeled) Lollipop.proteoform_community.construct_families(); }
);

if (Lollipop.neucode_labeled)
{
Parallel.Invoke
(
() => this.FillTablesAndCharts(),
() => Lollipop.proteoform_community.construct_families()
);
((ProteoformSweet)this.MdiParent).proteoformFamilies.fill_proteoform_families("");
((ProteoformSweet)this.MdiParent).proteoformFamilies.update_figures_of_merit();
}
else { this.FillTablesAndCharts(); }

this.Cursor = Cursors.Default;
compared_ee = true;
}
Expand Down
2 changes: 1 addition & 1 deletion ProteoformSuiteGUI/ExperimentTheoreticalComparison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void compare_et()
public void run_the_gamut()
{
this.Cursor = Cursors.WaitCursor;
Lollipop.make_et_relationships();
Lollipop.make_et_relationships(Lollipop.proteoform_community);
((ProteoformSweet)MdiParent).proteoformFamilies.ClearListsAndTables();
this.FillTablesAndCharts();
this.Cursor = Cursors.Default;
Expand Down
201 changes: 122 additions & 79 deletions ProteoformSuiteGUI/ProteoformFamilies.Designer.cs

Large diffs are not rendered by default.

26 changes: 21 additions & 5 deletions ProteoformSuiteGUI/ProteoformFamilies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@ public partial class ProteoformFamilies : Form
public ProteoformFamilies()
{
InitializeComponent();
}
private void ProteoformFamilies_Load(object sender, EventArgs e)
{
initialize_settings();
}

private void ProteoformFamilies_Load(object sender, EventArgs e)
{ }

public void initialize_every_time()
{
this.tb_familyBuildFolder.Text = Lollipop.family_build_folder_path;
this.nud_decimalRoundingLabels.Value = Convert.ToDecimal(Lollipop.deltaM_edge_display_rounding);
this.cb_buildAsQuantitative.Enabled = Lollipop.qVals.Count > 0;
this.cb_buildAsQuantitative.Checked = false;
this.cmbx_geneLabel.SelectedIndex = Lollipop.gene_name_labels.IndexOf(ProteoformCommunity.preferred_gene_label);
this.cb_geneCentric.Checked = ProteoformCommunity.gene_centric_families;
}

public void initialize_settings()
Expand All @@ -42,12 +44,16 @@ public void initialize_settings()
cmbx_nodeLayout.Items.AddRange(Lollipop.node_positioning);
cmbx_nodeLabelPositioning.Items.AddRange(CytoscapeScript.node_label_positions);
cmbx_edgeLabel.Items.AddRange(Lollipop.edge_labels);
cmbx_geneLabel.Items.AddRange(Lollipop.gene_name_labels.ToArray());
cmbx_tableSelector.Items.AddRange(table_names);

cmbx_colorScheme.SelectedIndex = 0;
cmbx_nodeLayout.SelectedIndex = 0;
cmbx_nodeLabelPositioning.SelectedIndex = 0;
cmbx_edgeLabel.SelectedIndex = 0;
cmbx_geneLabel.SelectedIndex = 1;
ProteoformCommunity.preferred_gene_label = cmbx_geneLabel.SelectedItem.ToString();
ProteoformCommunity.gene_centric_families = cb_geneCentric.Checked;

cmbx_tableSelector.SelectedIndexChanged -= cmbx_tableSelector_SelectedIndexChanged;
cmbx_tableSelector.SelectedIndex = 0;
Expand Down Expand Up @@ -238,7 +244,7 @@ private void btn_buildAllFamilies_Click(object sender, EventArgs e)
{
string time_stamp = SaveState.time_stamp();
tb_recentTimeStamp.Text = time_stamp;
string message = CytoscapeScript.write_cytoscape_script(Lollipop.proteoform_community.families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, cb_buildAsQuantitative.Checked, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding);
string message = CytoscapeScript.write_cytoscape_script(Lollipop.proteoform_community.families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, cb_buildAsQuantitative.Checked, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding, cb_geneCentric.Checked, cmbx_geneLabel.SelectedItem.ToString());
MessageBox.Show(message, "Cytoscape Build");
}

Expand All @@ -247,7 +253,7 @@ private void btn_buildSelectedFamilies_Click(object sender, EventArgs e)
string time_stamp = SaveState.time_stamp();
tb_recentTimeStamp.Text = time_stamp;
object[] selected = DisplayUtility.get_selected_objects(dgv_main);
string message = CytoscapeScript.write_cytoscape_script(selected, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, cb_buildAsQuantitative.Checked, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding);
string message = CytoscapeScript.write_cytoscape_script(selected, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, cb_buildAsQuantitative.Checked, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding, cb_geneCentric.Checked, cmbx_geneLabel.SelectedItem.ToString());
MessageBox.Show(message, "Cytoscape Build");
}

Expand Down Expand Up @@ -314,5 +320,15 @@ private void write_inclusion_list(List<ExperimentalProteoform> proteoforms)
}
else return;
}

private void cmbx_geneLabel_SelectedIndexChanged(object sender, EventArgs e)
{
ProteoformCommunity.preferred_gene_label = cmbx_geneLabel.SelectedItem.ToString();
}

private void cb_geneCentric_CheckedChanged(object sender, EventArgs e)
{
ProteoformCommunity.gene_centric_families = cb_geneCentric.Checked;
}
}
}
45 changes: 44 additions & 1 deletion ProteoformSuiteGUI/Quantification.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 21 additions & 5 deletions ProteoformSuiteGUI/Quantification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ private void btn_refreshCalculation_Click(object sender, EventArgs e)
public void initialize_every_time()
{
this.tb_familyBuildFolder.Text = Lollipop.family_build_folder_path;
if (cmbx_geneLabel.Items.Count > 0) this.cmbx_geneLabel.SelectedIndex = Lollipop.gene_name_labels.IndexOf(ProteoformCommunity.preferred_gene_label);
this.cb_geneCentric.Checked = ProteoformCommunity.gene_centric_families;
}

private void initialize()
Expand All @@ -97,13 +99,17 @@ private void initialize()
cmbx_colorScheme.Items.AddRange(CytoscapeScript.color_scheme_names);
cmbx_nodeLayout.Items.AddRange(Lollipop.node_positioning);
cmbx_nodeLabelPositioning.Items.AddRange(CytoscapeScript.node_label_positions);
cmbx_geneLabel.Items.AddRange(Lollipop.gene_name_labels.ToArray());
cb_redBorder.Checked = true;
cb_boldLabel.Checked = true;
cb_moreOpacity.Checked = false;

cmbx_colorScheme.SelectedIndex = 0;
cmbx_nodeLayout.SelectedIndex = 0;
cmbx_nodeLabelPositioning.SelectedIndex = 0;
cmbx_geneLabel.SelectedIndex = 1;
ProteoformCommunity.preferred_gene_label = cmbx_geneLabel.SelectedItem.ToString();
ProteoformCommunity.gene_centric_families = cb_geneCentric.Checked;

//Set parameters
nud_bkgdShift.ValueChanged -= nud_bkgdShift_ValueChanged;
Expand Down Expand Up @@ -337,7 +343,7 @@ private void btn_buildAllQuantifiedFamilies_Click(object sender, EventArgs e)
{
string time_stamp = SaveState.time_stamp();
tb_recentTimeStamp.Text = time_stamp;
string message = CytoscapeScript.write_cytoscape_script(Lollipop.proteoform_community.families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding);
string message = CytoscapeScript.write_cytoscape_script(Lollipop.proteoform_community.families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding, cb_geneCentric.Checked, cmbx_geneLabel.SelectedItem.ToString());
MessageBox.Show(message, "Cytoscape Build");
}

Expand All @@ -346,7 +352,7 @@ private void btn_buildFamiliesWithSignificantChange_Click(object sender, EventAr
List<ProteoformFamily> families = Lollipop.getInterestingFamilies(Lollipop.satisfactoryProteoforms, Lollipop.minProteoformFoldChange, Lollipop.minProteoformFDR, Lollipop.minProteoformIntensity).Distinct().ToList();
string time_stamp = SaveState.time_stamp();
tb_recentTimeStamp.Text = time_stamp;
string message = CytoscapeScript.write_cytoscape_script(families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding);
string message = CytoscapeScript.write_cytoscape_script(families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding, cb_geneCentric.Checked, cmbx_geneLabel.SelectedItem.ToString());
MessageBox.Show(message, "Cytoscape Build");
}

Expand All @@ -355,7 +361,7 @@ private void btn_buildSelectedQuantFamilies_Click(object sender, EventArgs e)
string time_stamp = SaveState.time_stamp();
tb_recentTimeStamp.Text = time_stamp;
object[] selected = DisplayUtility.get_selected_objects(dgv_quantification_results);
string message = CytoscapeScript.write_cytoscape_script(selected, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding);
string message = CytoscapeScript.write_cytoscape_script(selected, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding, cb_geneCentric.Checked, cmbx_geneLabel.SelectedItem.ToString());
MessageBox.Show(message, "Cytoscape Build");
}

Expand All @@ -365,7 +371,7 @@ private void btn_buildFamiliesAllGO_Click(object sender, EventArgs e)
List<ProteoformFamily> go_families = Lollipop.getInterestingFamilies(Lollipop.goTermNumbers.Where(n => n.Aspect == a).Distinct().ToList(), Lollipop.proteoform_community.families);
string time_stamp = SaveState.time_stamp();
tb_recentTimeStamp.Text = time_stamp;
string message = CytoscapeScript.write_cytoscape_script(go_families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding);
string message = CytoscapeScript.write_cytoscape_script(go_families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding, cb_geneCentric.Checked, cmbx_geneLabel.SelectedItem.ToString());
MessageBox.Show(message, "Cytoscape Build");
}

Expand All @@ -375,7 +381,7 @@ private void btn_buildFromSelectedGoTerms_Click(object sender, EventArgs e)
List<ProteoformFamily> selected_families = Lollipop.getInterestingFamilies(selected_gos, Lollipop.proteoform_community.families).Distinct().ToList();
string time_stamp = SaveState.time_stamp();
tb_recentTimeStamp.Text = time_stamp;
string message = CytoscapeScript.write_cytoscape_script(selected_families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding);
string message = CytoscapeScript.write_cytoscape_script(selected_families, Lollipop.proteoform_community.families, Lollipop.family_build_folder_path, time_stamp, true, cb_redBorder.Checked, cb_boldLabel.Checked, cb_moreOpacity.Checked, cmbx_colorScheme.SelectedItem.ToString(), cmbx_nodeLabelPositioning.SelectedItem.ToString(), Lollipop.deltaM_edge_display_rounding, cb_geneCentric.Checked, cmbx_geneLabel.SelectedItem.ToString());
MessageBox.Show(message, "Cytoscape Build");
}

Expand Down Expand Up @@ -486,5 +492,15 @@ private void btn_customBackgroundBrowse_Click(object sender, EventArgs e)
}
}
}

private void cmbx_geneLabel_SelectedIndexChanged(object sender, EventArgs e)
{
ProteoformCommunity.preferred_gene_label = cmbx_geneLabel.SelectedItem.ToString();
}

private void cb_geneCentric_CheckedChanged(object sender, EventArgs e)
{
ProteoformCommunity.gene_centric_families = cb_geneCentric.Checked;
}
}
}
Loading

0 comments on commit f4d5e39

Please sign in to comment.