public PeptideDocNode UpdateMolecule(IdentityPath parent, PeptideDocNode peptideDocNode) { CheckCancelled(); AnnotationUpdater updater; _annotationUpdaters.TryGetValue(AnnotationDef.AnnotationTarget.peptide, out updater); var identityPath = new IdentityPath(parent, peptideDocNode.Peptide); if (updater != null) { var peptide = new Databinding.Entities.Peptide(SkylineDataSchema, new IdentityPath(parent, peptideDocNode.Peptide)); var annotations = updater.UpdateAnnotations(peptideDocNode.Annotations, peptide); if (!Equals(annotations, peptideDocNode.Annotations)) { peptideDocNode = (PeptideDocNode)peptideDocNode.ChangeAnnotations(annotations); } } if (!RecursePrecursors) { return(peptideDocNode); } var newChildren = peptideDocNode.TransitionGroups.Select(tg => UpdatePrecursor(identityPath, tg)).ToArray(); if (!ArrayUtil.ReferencesEqual(peptideDocNode.Children, newChildren)) { peptideDocNode = (PeptideDocNode)peptideDocNode.ChangeChildren(newChildren); } return(peptideDocNode); }
public static string GetRowDisplayText(Protein protein, Databinding.Entities.Peptide peptide) { var proteomic = protein.DocNode.IsProteomic; if (peptide != null) { return(proteomic ? peptide.Sequence : peptide.MoleculeName); } else { return(proteomic ? ProteinMetadataManager.ProteinModalDisplayText(protein.DocNode) : protein.Name); } }
public bool Matches(SrmDocument document, Protein protein, Databinding.Entities.Peptide peptide, FoldChangeResult foldChangeResult, CutoffSettings cutoffSettings) { foreach (var match in matchOptions) { switch (match) { case MatchOption.ProteinName: case MatchOption.ProteinAccession: case MatchOption.ProteinPreferredName: case MatchOption.ProteinGene: case MatchOption.PeptideSequence: case MatchOption.PeptideModifiedSequence: case MatchOption.MoleculeGroupName: case MatchOption.MoleculeName: case MatchOption.CAS: case MatchOption.HMDB: case MatchOption.InChiKey: { var matchString = GetMatchString(document, protein, peptide); if (matchString == null || !Regex.IsMatch(matchString, RegExpr)) { return(false); } break; } case MatchOption.BelowLeftCutoff: { if (!cutoffSettings.FoldChangeCutoffValid || foldChangeResult.Log2FoldChange >= -cutoffSettings.Log2FoldChangeCutoff) { return(false); } break; } case MatchOption.AboveRightCutoff: { if (!cutoffSettings.FoldChangeCutoffValid || foldChangeResult.Log2FoldChange <= cutoffSettings.Log2FoldChangeCutoff) { return(false); } break; } case MatchOption.BelowPValueCutoff: { if (!cutoffSettings.PValueCutoffValid || foldChangeResult.AdjustedPValue <= Math.Pow(10, -cutoffSettings.PValueCutoff)) { return(false); } break; } case MatchOption.AbovePValueCutoff: { if (!cutoffSettings.PValueCutoffValid || foldChangeResult.AdjustedPValue >= Math.Pow(10, -cutoffSettings.PValueCutoff)) { return(false); } break; } } } return(true); }
public string GetMatchString(SrmDocument document, Protein protein, Databinding.Entities.Peptide peptide) { if (protein == null) { return(null); } var perProtein = peptide == null; foreach (var m in matchOptions) { switch (m) { case MatchOption.ProteinName: case MatchOption.ProteinAccession: case MatchOption.ProteinPreferredName: case MatchOption.ProteinGene: return(GetProteinText(protein, MatchOptionToDisplayMode(m))); case MatchOption.PeptideSequence: if (!perProtein) { return(peptide.Sequence); } break; case MatchOption.PeptideModifiedSequence: if (!perProtein) { return(peptide.ModifiedSequence.ToString()); } break; case MatchOption.MoleculeGroupName: return(protein.Name); case MatchOption.MoleculeName: if (!perProtein) { return(peptide.MoleculeName); } break; case MatchOption.CAS: if (!perProtein) { return(peptide.CAS); } break; case MatchOption.HMDB: if (!perProtein) { return(peptide.HMDB); } break; case MatchOption.InChiKey: if (!perProtein) { return(peptide.InChiKey); } break; } } if (protein.DocNode.IsProteomic) { return(GetRowDisplayText(protein, peptide)); } return(perProtein ? protein.Name : peptide.MoleculeName); }
public string GetMatchString(SrmDocument document, Protein protein, Databinding.Entities.Peptide peptide) { return(GetRowString(document, protein, peptide, false)); }
private string GetRowString(SrmDocument document, Protein protein, Databinding.Entities.Peptide peptide, bool showProteinForPeptides) { if (protein == null) { return(null); } var perProtein = peptide == null; foreach (var m in matchOptions) { switch (m) { case MatchOption.ProteinName: case MatchOption.ProteinAccession: case MatchOption.ProteinPreferredName: case MatchOption.ProteinGene: if (!perProtein && showProteinForPeptides) { return(string.Format(@"{0} ({1})", GetRowDisplayText(protein, peptide), GetProteinText(protein, m))); } return(GetProteinText(protein, m)); case MatchOption.PeptideSequence: if (!perProtein) { return(peptide.Sequence); } break; case MatchOption.PeptideModifiedSequence: if (!perProtein) { return(peptide.ModifiedSequence.ToString()); } break; case MatchOption.MoleculeGroupName: return(protein.Name); case MatchOption.MoleculeName: if (!perProtein) { return(peptide.MoleculeName); } break; case MatchOption.CAS: if (!perProtein) { return(peptide.CAS); } break; case MatchOption.HMDB: if (!perProtein) { return(peptide.HMDB); } break; case MatchOption.InChiKey: if (!perProtein) { return(peptide.InChiKey); } break; } } return(GetRowDisplayText(protein, peptide)); }
public string GetDisplayString(SrmDocument document, Protein protein, Databinding.Entities.Peptide peptide) { return(GetRowString(document, protein, peptide, true)); }