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 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); } DisplayMotif(); ClearResults(); }
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 = ""; }