public static IEnumerable <IHashableFeature> GetNFlankAny1AndNTermEAny2(NEC nec, string nflankAny, string nTermEAny) { NFlank nFlankFeature = NFlank.GetInstance(); string nFlankRegion = nFlankFeature.FeatureFunction(nec); if (-1 == nFlankRegion.IndexOfAny(nflankAny.ToCharArray())) { yield break; } NTermE nTermEFeature = NTermE.GetInstance(); string nTermERegion = nTermEFeature.FeatureFunction(nec); if (-1 == nTermERegion.IndexOfAny(nTermEAny.ToCharArray())) { yield break; } AnyIn anyFeature1 = AnyIn.GetInstance(nflankAny, nFlankFeature); AnyIn anyFeature2 = AnyIn.GetInstance(nTermEAny, nTermEFeature); And andFeature = And.GetInstance(anyFeature1, anyFeature2); Debug.Assert((bool)andFeature.Evaluate(nec)); // real assert - must only generate true features yield return(andFeature); }
public override bool Equals(object obj) { NTermE other = obj as NTermE; if (other == null) { return(false); } else { Debug.Assert(obj.ToString() == ToString()); // real assert return(true); } }
public static IEnumerable <IHashableFeature> GetAndNFlankNotNTermEEnumeration(NEC nec) { NFlank nFlankFeature = NFlank.GetInstance(); string nFlankRegion = nFlankFeature.FeatureFunction(nec); Set <string> aaSeqSet = Set <string> .GetInstance(SpecialFunctions.SubstringEnumeration(nFlankRegion, 1)); foreach (string aaSeq in aaSeqSet) { Not notFeature = Not.GetInstance(In.GetInstance(aaSeq, NTermE.GetInstance())); //Only generate the feature when the amino acid is not in NTermE if ((bool)notFeature.Evaluate(nec)) { In inFeature = In.GetInstance(aaSeq, nFlankFeature); And andFeature = And.GetInstance(inFeature, notFeature); Debug.Assert((bool)andFeature.Evaluate(nec)); // real assert - must only generate true features yield return(andFeature); } } }
internal static NTermE GetInstance() { NTermE region = new NTermE(); return(region); }