public void SimpleMatchTestStartLater() { var match = ProteinMatcher.Match("XAAAA", 1, "A2A", 1); Assert.IsTrue(match.HasMatch, "Has Match"); Assert.AreEqual(0, match.Distance, "Distance is 0"); }
public List <ProteinMatch> FindInSequence(ProteinSequenceWithFundaments sequence, int fundamentIndex, string expression, int maximumDistance) { var result = new List <ProteinMatch>(); var minimalDistance = maximumDistance; var startFrom = 0; //if (fundamentIndex > 1) //{ // var lastFundament = sequence[fundamentIndex - 1]; // if (lastFundament != null) // { // startFrom = lastFundament.Index + lastFundament.Length; // } //} for (var i = startFrom; i < sequence.ProteinSequence.Sequence.Length; i++) { var match = ProteinMatcher.Match(sequence.ProteinSequence.Sequence, i, expression, maximumDistance); if (!match.HasMatch || match.Distance >= minimalDistance) { continue; } if (match.Distance < minimalDistance) { result.Clear(); minimalDistance = match.Distance; } if (match.Distance == minimalDistance) { sequence[fundamentIndex] = match; } } return(result); }
public ProteinMatcherTests() { _matcher = new ProteinMatcher(); }