示例#1
0
        /// <summary>
        /// Build Suffix Tree using reference sequence
        /// </summary>
        /// <param name="referenceSequence">sequence to build SuffixTree</param>
        /// <returns>Suffix Tree</returns>
        protected override ISuffixTree BuildSuffixTree(ISequence referenceSequence)
        {
            ISuffixTreeBuilder suffixTreeBuilder = Factory.CreateNew(referenceSequence);
            ISuffixTree        suffixTree        = suffixTreeBuilder.BuildSuffixTree(referenceSequence);

            return(suffixTree);
        }
示例#2
0
        public void TestFindMaximumMatchInSequence()
        {
            string   sequenceString = "BANANA";
            Sequence sequence       = new Sequence(Alphabets.Protein, sequenceString);

            using (SimpleSuffixTreeBuilder simpleSuffixTreebldr = new SimpleSuffixTreeBuilder())
            {
                ISuffixTreeBuilder simpleSuffixTreeBuilder = simpleSuffixTreebldr;
                ISuffixTree        simpleSuffixTree        = simpleSuffixTreeBuilder.BuildSuffixTree(sequence);

                string   queryString   = "ANA";
                Sequence querySequence = new Sequence(Alphabets.Protein, queryString);

                IList <MaxUniqueMatch> MUMs = simpleSuffixTreeBuilder.FindMaximumMatches(simpleSuffixTree, querySequence, 3);

                // Verify the count of MUMs found
                Assert.AreEqual(1, MUMs.Count);
                simpleSuffixTreeBuilder = null;
            }
        }