public void TestMatch() { Alphabet alphabet = DnaAlphabet.Instance(); Sequence seq = new Sequence(AlphabetType.DNA, "acctccgg"); Prosite prosite = new Prosite("c-t-c-x.", alphabet); Match match = prosite.Match(seq, 1); Assert.AreEqual(null, match); match = prosite.Match(seq, 3); Assert.AreEqual(3, match.Start); Assert.AreEqual(4, match.Length); Assert.AreEqual(1, match.Strand); Assert.AreEqual(1.0, match.Similarity, 1e-2); prosite = new Prosite("a-c-c.", alphabet); match = prosite.Match(seq, 1); Assert.AreEqual(1, match.Start); prosite = new Prosite("<a-c-c.", alphabet); match = prosite.Match(seq, 3); Assert.AreEqual(null, match); prosite = new Prosite("c-g-g.", alphabet); match = prosite.Match(seq, 6); Assert.AreEqual(8, match.End); prosite = new Prosite("c-y-y-c.", alphabet); Assert.IsNotNull(prosite.Match(seq, 2)); prosite = new Prosite("c-{d}-c.", alphabet); //Assert.IsNotNull(prosite.Match(seq, 1)); //<-- not sure why this pattern wont work prosite = new Prosite("c-x(0,2)-g.", alphabet); FeatureList matches = seq.Search(0, 0, prosite); Assert.AreEqual(2, matches.Count); Assert.AreEqual("ccgg", matches[0].Letters()); Assert.AreEqual("cgg", matches[1].Letters()); }