private void LoadMotif() { DialogResult dlg = dlgOpenMotif.ShowDialog(); if (dlg != DialogResult.OK) { return; } SetText(dlgOpenMotif); string filename = dlgOpenMotif.FileName; try { Motif = Motif.ReadFromFile(filename); } catch { MessageBox.Show("The file may be corrupted or not a valid PeSA motif file.", Analyzer.ProgramName); return; } Validator = new MotifValidator(); Settings settings = Settings.Load("default.settings"); int heightImage = 200; int widthImage = 800; if (settings != null) { heightImage = settings.MotifHeight; widthImage = settings.MotifWidth; } mdPositive.Image = Motif.GetPositiveMotif(widthImage, heightImage); mdNegative.Image = Motif.GetNegativeMotif(widthImage, heightImage); mdChart.Image = Motif.GetBarChart(pMotif.Width - 6); eWildtype.Text = Motif.WildTypePeptide; }
private bool DrawMotifs() { try { ClearMotifs(); if (PA == null) { return(true); } Settings settings = Settings.Load("default.settings"); int heightImage = 200; int widthImage = 800; if (settings != null) { heightImage = settings.MotifHeight; widthImage = settings.MotifWidth; } Motif = new Motif(PA.NormalizedPeptideWeights, PA.NormalizedWildtypeWeights, PA.WildTypePeptide, PA.PositiveThreshold, PA.NegativeThreshold); mdPositive.Image = Motif.GetPositiveMotif(widthImage, heightImage); mdNegative.Image = Motif.GetNegativeMotif(widthImage, heightImage); mdChart.Image = Motif.GetBarChart(pMotif.Width - 6); return(true); } catch { return(false); } }
private bool DrawMotifs() { try { ClearMotifs(); if (OA == null) { return(true); } Settings settings = Settings.Load("default.settings"); int heightImage = 200; int widthImage = 800; if (settings != null) { heightImage = settings.MotifHeight; widthImage = settings.MotifWidth; } if (!CreateMotif()) { return(false); } mdPositive.Image = Motif.GetPositiveMotif(widthImage, heightImage); mdNegative.Image = Motif.GetNegativeMotif(widthImage, heightImage); mdChart.Image = Motif.GetBarChart(pMotif.Width - 6); return(true); } catch { return(false); } }
private void DisplayMotif() { if (Motif == null) { return; } Settings settings = Settings.Load("default.settings"); int heightImage = 200; int widthImage = 800; if (settings != null) { heightImage = settings.MotifHeight; widthImage = settings.MotifWidth; } if (Motif.PositiveColumns != null) { mdPositive.Image = Motif.GetPositiveMotif(widthImage, heightImage); } else if (Motif.Frequencies != null) { mdPositive.Image = Motif.GetFrequencyMotif(widthImage, heightImage); } else { mdPositive.Image = null; } if (Motif.NegativeColumns != null) { mdNegative.Image = Motif.GetNegativeMotif(widthImage, heightImage); } else { mdNegative.Visible = false; mdNegative.Image = null; } if (Motif.PositiveColumns != null) { mdChart.Image = Motif.GetBarChart(pMotif.Width - 6); } else { mdChart.Visible = false; } ePositiveThreshold.Text = Motif.PositiveThreshold.ToString(); toolTip1.SetToolTip(eScorerPosThreshold, string.Format("Range: [{0:N2}, {1:N2}]", Motif.PositiveThreshold, Motif.MaxPosWeight)); eNegativeThreshold.Text = Motif.NegativeThreshold.ToString(); toolTip1.SetToolTip(eScorerNegThreshold, string.Format("Range: [{0:N2}, {1:N2}]", 0, Motif.NegativeThreshold)); eWildtype.Text = Motif.WildTypePeptide; eTargetPosition.Text = ""; eTargetAminoAcid.Text = ""; }
private void LoadMotif() { DialogResult dlg = dlgOpenMotif.ShowDialog(); if (dlg != DialogResult.OK) { return; } SetText(dlgOpenMotif); string filename = dlgOpenMotif.FileName; try { Motif = Motif.ReadFromFile(filename); } catch { MessageBox.Show("The file may be corrupted or not a valid PeSA motif file.", Analyzer.ProgramName); } Settings settings = Settings.Load("default.settings"); int heightImage = 200; int widthImage = 800; if (settings != null) { heightImage = settings.MotifHeight; widthImage = settings.MotifWidth; } mdPositive.Image = Motif.GetPositiveMotif(widthImage, heightImage); mdNegative.Image = Motif.GetNegativeMotif(widthImage, heightImage); mdChart.Image = Motif.GetBarChart(pMotif.Width - 6); ePositiveThreshold.Text = Motif.PositiveThreshold.ToString(); toolTip1.SetToolTip(eScorerPosThreshold, string.Format("Range: [{0:N2}, {1:N2}]", Motif.PositiveThreshold, Motif.MaxPosWeight)); eNegativeThreshold.Text = Motif.NegativeThreshold.ToString(); toolTip1.SetToolTip(eScorerNegThreshold, string.Format("Range: [{0:N2}, {1:N2}]", 0, Motif.NegativeThreshold)); eWildtype.Text = Motif.WildTypePeptide; eTarget.Text = ""; }