public PeptideAnalysisData SetExcludedMasses(ExcludedMasses value) { return(new PeptideAnalysisData(this) { ExcludedMasses = value }); }
protected override void OnCellEndEdit(DataGridViewCellEventArgs e) { base.OnCellEndEdit(e); var row = Rows[e.RowIndex]; var cell = row.Cells[e.ColumnIndex]; ExcludedMasses.SetExcluded((int)row.Tag, (bool)cell.Value); }
public PeptideAnalysisData(DbPeptideAnalysis dbPeptideAnalysis) { Name = dbPeptideAnalysis.Name; PeptideId = dbPeptideAnalysis.Peptide.GetId(); MinCharge = dbPeptideAnalysis.MinCharge; MaxCharge = dbPeptideAnalysis.MaxCharge; ExcludedMasses = ExcludedMasses.FromByteArray(dbPeptideAnalysis.ExcludedMasses); MassAccuracy = dbPeptideAnalysis.MassAccuracy; FileAnalyses = ImmutableSortedList <long, PeptideFileAnalysisData> .EMPTY; }
public override int GetHashCode() { unchecked { int hashCode = (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PeptideId.GetHashCode(); hashCode = (hashCode * 397) ^ MinCharge; hashCode = (hashCode * 397) ^ (ExcludedMasses != null ? ExcludedMasses.GetHashCode() : 0); hashCode = (hashCode * 397) ^ MaxCharge; hashCode = (hashCode * 397) ^ MassAccuracy.GetHashCode(); hashCode = (hashCode * 397) ^ (FileAnalyses != null ? FileAnalyses.GetHashCode() : 0); return(hashCode); } }
public PeptideAnalysisData SetExcludedMasses(ExcludedMasses value) { return new PeptideAnalysisData(this) {ExcludedMasses = value}; }
protected void ShowChromatograms() { if (MsGraphControl.GraphPane == null) { // TODO: How can this happen? return; } MsGraphControl.GraphPane.GraphObjList.Clear(); MsGraphControl.GraphPane.CurveList.Clear(); var selectedCharges = gridIntensities.GetSelectedCharges(); var selectedMasses = gridIntensities.GetSelectedMasses(); var chromatograms = PeptideFileAnalysis.ChromatogramSet; var mzRanges = PeptideFileAnalysis.TurnoverCalculator.GetMzs(0); var monoisotopicMass = Workspace.GetAminoAcidFormulas().GetMonoisotopicMass(PeptideAnalysis.Peptide.Sequence); for (int charge = PeptideAnalysis.MinCharge; charge <= PeptideAnalysis.MaxCharge; charge++) { if (selectedCharges.Count > 0 && !selectedCharges.Contains(charge)) { continue; } for (int iMass = 0; iMass < PeptideAnalysis.GetMassCount(); iMass++) { var mzKey = new MzKey(charge, iMass); double massDifference = mzRanges[iMass].Center - monoisotopicMass; var label = massDifference.ToString("0.#"); if (label[0] != '-') { label = "+" + label; } label = "M" + label; label += new string('+', charge); if (selectedMasses.Count > 0) { if (!selectedMasses.Contains(iMass)) { continue; } } else { if (ExcludedMasses.IsExcluded(mzKey.MassIndex)) { continue; } } ChromatogramSetData.Chromatogram chromatogram; if (!chromatograms.Chromatograms.TryGetValue(mzKey, out chromatogram)) { continue; } var graphItem = new ChromatogramGraphItem { Title = label, }; graphItem.Color = TracerChromatogramForm.GetColor(iMass, PeptideAnalysis.GetMassCount()); var mzRange = PeptideFileAnalysis.TurnoverCalculator.GetMzs(mzKey.Charge)[mzKey.MassIndex]; var massAccuracy = PeptideAnalysis.GetMassAccuracy(); var intensities = chromatogram.ChromatogramPoints.Select(point => point.GetIntensity(mzRange, massAccuracy)).ToArray(); if (Smooth) { intensities = TracerChromatograms.SavitzkyGolaySmooth(intensities); } PointPairList points = new PointPairList(chromatograms.Times, intensities); graphItem.Points = points; var lineItem = (LineItem)MsGraphControl.AddGraphItem(MsGraphControl.GraphPane, graphItem); lineItem.Line.Style = TracerChromatogramForm.GetDashStyle(charge - PeptideAnalysis.MinCharge); lineItem.Line.Width = Settings.Default.ChromatogramLineWidth; lineItem.Label.IsVisible = false; } } }