private void ShowHalfLifeForm(Peptide peptide, string proteinName, string cohort)
            {
                if (0 != (GetKeyState(0x10) & 0x8000))
                {
                    var halfLifeRowDataForm = new HalfLifeRowDataForm(_form.Workspace)
                    {
                        Protein = proteinName,
                    };
                    if (peptide != null)
                    {
                        halfLifeRowDataForm.Peptide = peptide.ToString();
                    }
                    var resultData = HalfLives[cohort].Value;
                    halfLifeRowDataForm.RowDatas = resultData.RowDatas;
                    halfLifeRowDataForm.Show(_form.DockPanel, _form.DockState);
                    return;
                }
                var halfLifeForm = new HalfLifeForm(_form.Workspace)
                {
                    Peptide     = peptide == null ? "" : peptide.Sequence,
                    ProteinName = proteinName,
                    Cohort      = cohort,
                };

                halfLifeForm.SetHalfLifeSettings(_form.HalfLifeSettings);
                for (int i = 0; i < _form.checkedListBoxTimePoints.Items.Count; i++)
                {
                    halfLifeForm.SetTimePointExcluded((double)_form.checkedListBoxTimePoints.Items[i],
                                                      !_form.checkedListBoxTimePoints.GetItemChecked(i));
                }
                halfLifeForm.Show(_form.DockPanel, _form.DockState);
            }
 private EventHandler GetClickEventHandler(HalfLifeCalculationType halfLifeCalculationType)
 {
     return((sender, args) =>
     {
         var cohortBuilder = new StringBuilder();
         if (!string.IsNullOrEmpty(Cohort))
         {
             cohortBuilder.Append(Cohort);
         }
         if (!string.IsNullOrEmpty(Sample))
         {
             if (cohortBuilder.Length > 0)
             {
                 cohortBuilder.Append(" ");
             }
             cohortBuilder.Append(Sample);
         }
         var halfLifeForm = new HalfLifeForm(_form.Workspace)
         {
             Peptide = _displayRow.Peptide == null ? "" : _displayRow.Peptide.Sequence,
             ProteinName = _displayRow.ProteinName,
             Cohort = cohortBuilder.ToString(),
         };
         halfLifeForm.SetHalfLifeSettings(_displayRow.GetHalfLifeCalculator().HalfLifeSettings);
         halfLifeForm.Show(_form.DockPanel, _form.DockState);
     });
 }
Beispiel #3
0
        private void BtnShowGraphOnClick(object sender, EventArgs e)
        {
            var halfLifeForm = new HalfLifeForm(Workspace)
            {
                Peptide     = Peptide.Sequence,
                ProteinName = Peptide.ProteinName,
            };

            halfLifeForm.Show(DockPanel, DockState);
        }
Beispiel #4
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            var row = dataGridView1.Rows[e.RowIndex];

            if (e.ColumnIndex == colPeptide.Index)
            {
                var peptideSequence = row.Cells[e.ColumnIndex].Value as string;
                if (string.IsNullOrEmpty(peptideSequence))
                {
                    return;
                }
                using (var session = Workspace.OpenSession())
                {
                    var peptideAnalysisIds =
                        session.CreateQuery(
                            "SELECT pa.Id FROM DbPeptideAnalysis pa WHERE pa.Peptide.Sequence = :sequence")
                        .SetParameter("sequence", Peptide.TrimSequence(peptideSequence))
                        .List();
                    if (peptideAnalysisIds.Count >= 0)
                    {
                        PeptideAnalysisFrame.ShowPeptideAnalysis(
                            TurnoverForm.Instance.LoadPeptideAnalysis((long)peptideAnalysisIds[0]));
                    }
                }
                return;
            }
            if (e.ColumnIndex == colProteinKey.Index)
            {
                var halfLifeForm = new HalfLifeForm(Workspace)
                {
                    Peptide     = Peptide.TrimSequence(Convert.ToString(row.Cells[colPeptide.Index].Value) ?? ""),
                    ProteinName = Convert.ToString(row.Cells[colProteinName.Index].Value),
                    MinScore    = double.Parse(tbxMinScore.Text),
                };
                halfLifeForm.Show(DockPanel, DockState);
            }
        }
 private void BtnShowGraphOnClick(object sender, EventArgs e)
 {
     var halfLifeForm = new HalfLifeForm(Workspace)
                            {
                                Peptide = Peptide.Sequence,
                                ProteinName = Peptide.ProteinName,
                            };
     halfLifeForm.Show(DockPanel, DockState);
 }
 private EventHandler GetClickEventHandler(HalfLifeCalculationType halfLifeCalculationType)
 {
     return (sender, args) =>
                {
                    var cohortBuilder = new StringBuilder();
                    if (!string.IsNullOrEmpty(Cohort))
                    {
                        cohortBuilder.Append(Cohort);
                    }
                    if (!string.IsNullOrEmpty(Sample))
                    {
                        if (cohortBuilder.Length > 0)
                        {
                            cohortBuilder.Append(" ");
                        }
                        cohortBuilder.Append(Sample);
                    }
                    var halfLifeForm = new HalfLifeForm(_form.Workspace)
                            {
                                Peptide = _displayRow.Peptide == null ? "" : _displayRow.Peptide.Sequence,
                                ProteinName = _displayRow.ProteinName,
                                Cohort = cohortBuilder.ToString(),
                            };
                    halfLifeForm.SetHalfLifeSettings(_displayRow.GetHalfLifeCalculator().HalfLifeSettings);
                     halfLifeForm.Show(_form.DockPanel, _form.DockState);
                };
 }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0)
     {
         return;
     }
     var row = dataGridView1.Rows[e.RowIndex];
     if (e.ColumnIndex == colPeptide.Index)
     {
         var peptideSequence = row.Cells[e.ColumnIndex].Value as string;
         if (string.IsNullOrEmpty(peptideSequence))
         {
             return;
         }
         using (var session = Workspace.OpenSession())
         {
             var peptideAnalysisIds =
                 session.CreateQuery(
                     "SELECT pa.Id FROM DbPeptideAnalysis pa WHERE pa.Peptide.Sequence = :sequence")
                     .SetParameter("sequence", Peptide.TrimSequence(peptideSequence))
                     .List();
             if (peptideAnalysisIds.Count >= 0)
             {
                 PeptideAnalysisFrame.ShowPeptideAnalysis(
                     TurnoverForm.Instance.LoadPeptideAnalysis((long) peptideAnalysisIds[0]));
             }
         }
         return;
     }
     if (e.ColumnIndex == colProteinKey.Index)
     {
         var halfLifeForm = new HalfLifeForm(Workspace)
         {
             Peptide = Peptide.TrimSequence(Convert.ToString(row.Cells[colPeptide.Index].Value) ?? ""),
             ProteinName = Convert.ToString(row.Cells[colProteinName.Index].Value),
             MinScore = double.Parse(tbxMinScore.Text),
         };
         halfLifeForm.Show(DockPanel, DockState);
     }
 }
Beispiel #8
0
 private void ShowHalfLifeForm(Peptide peptide, string proteinName, string cohort)
 {
     if (0 != (GetKeyState(0x10) & 0x8000))
     {
         var halfLifeRowDataForm = new HalfLifeRowDataForm(_form.Workspace)
                                       {
                                           Protein = proteinName,
                                       };
         if (peptide != null)
         {
             halfLifeRowDataForm.Peptide = peptide.ToString();
         }
         var resultData = HalfLives[cohort].Value;
         halfLifeRowDataForm.RowDatas = resultData.RowDatas;
         halfLifeRowDataForm.Show(_form.DockPanel, _form.DockState);
         return;
     }
     var halfLifeForm = new HalfLifeForm(_form.Workspace)
                            {
                                Peptide = peptide == null ? "" : peptide.Sequence,
                                ProteinName = proteinName,
                                Cohort = cohort,
                            };
     halfLifeForm.SetHalfLifeSettings(_form.HalfLifeSettings);
     for (int i = 0; i < _form.checkedListBoxTimePoints.Items.Count; i++)
     {
         halfLifeForm.SetTimePointExcluded((double)_form.checkedListBoxTimePoints.Items[i],
                                           !_form.checkedListBoxTimePoints.GetItemChecked(i));
     }
     halfLifeForm.Show(_form.DockPanel, _form.DockState);
 }