public static StaticMod GetStaticMod(int uniModId, char aa, ModTerminus? modTerminus) { // Always check the simple AA mod case var idKeysToTry = new List<UniMod.UniModIdKey> { new UniMod.UniModIdKey { Id = uniModId, Aa = aa, AllAas = false, Terminus = null }, new UniMod.UniModIdKey { Id = uniModId, Aa = aa, AllAas = true, Terminus = null } }; // If mod is on a terminal AA, it could still be a non-terminal mod // Or a terminal mod that applies to any amino acid if (modTerminus != null) { idKeysToTry.Add(new UniMod.UniModIdKey { Id = uniModId, Aa = aa, AllAas = false, Terminus = modTerminus }); idKeysToTry.Add(new UniMod.UniModIdKey { Id = uniModId, Aa = aa, AllAas = true, Terminus = modTerminus }); } foreach (var key in idKeysToTry) { StaticMod staticMod; if (UniMod.DictUniModIds.TryGetValue(key, out staticMod)) return staticMod; } return null; }
public AATermKey(byte? aa, ModTerminus? terminus) { _aa = aa; _terminus = terminus; }
private bool? IsAAConflict(byte? aa, ModTerminus? terminus) { return _aasConflictingMods[GetAAConflictIndex(aa, terminus)]; }
private void AddConflictKey(byte? aa, ModTerminus? terminus, bool startingValue) { int i = GetAAConflictIndex(aa, terminus); _aasConflictingMods[i] = startingValue || _aasConflictingMods[i].HasValue; }
private static int GetAAConflictIndex(byte? aa, ModTerminus? terminus) { int i = 0; if (terminus.HasValue) i = ((int)terminus + 1)*30; return aa.HasValue ? aa.Value - i : i; }
public StaticMod(string name, string aas, ModTerminus? term, bool isVariable, string formula, LabelAtoms labelAtoms, RelativeRT relativeRT, double? monoMass, double? avgMass, IList<FragmentLoss> losses, int? uniModId, string shortName) : base(name) { AAs = aas; Terminus = term; IsVariable = IsExplicit = isVariable; // All variable mods are explicit Formula = formula; LabelAtoms = labelAtoms; RelativeRT = relativeRT; MonoisotopicMass = monoMass; AverageMass = avgMass; Losses = losses; UnimodId = uniModId; ShortName = shortName; Validate(); }
public StaticMod(string name, string aas, ModTerminus? term, bool isVariable, string formula, LabelAtoms labelAtoms, RelativeRT relativeRT, double? monoMass, double? avgMass, IList<FragmentLoss> losses) : this(name, aas, term, isVariable, formula, labelAtoms, relativeRT, monoMass, avgMass, losses, null, null) { }
public StaticMod(string name, string aas, ModTerminus? term, string formula, LabelAtoms labelAtoms, double? monoMass, double? avgMass) : this(name, aas, term, false, formula, labelAtoms, RelativeRT.Matching, monoMass, avgMass, null, null, null) { }
public StaticMod(string name, string aas, ModTerminus? term, LabelAtoms labelAtoms) : this(name, aas, term, null, labelAtoms, null, null) { }
public StaticMod(string name, string aas, ModTerminus? term, string formula) : this(name, aas, term, formula, LabelAtoms.None, null, null) { }