Example #1
0
        public void TestStreamingPersistentSegmentedSequence()
        {
            string            sequenceString   = "AAATTGGC";
            Sequence          sequence         = new Sequence(Alphabets.Protein, sequenceString);
            SegmentedSequence segmentedSequece = new SegmentedSequence(sequence);

            sequenceString = "ANANA";
            sequence       = new Sequence(Alphabets.Protein, sequenceString);
            segmentedSequece.Sequences.Add(sequence);

            using (SimpleSuffixTreeBuilder simpleSuffixTreeBuilder = new SimpleSuffixTreeBuilder())
            {
                simpleSuffixTreeBuilder.PersistenceThreshold = 0;

                ISuffixTree persistentSuffixTree = simpleSuffixTreeBuilder.BuildSuffixTree(segmentedSequece);

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

                IList <MaxUniqueMatch> MUMs = simpleSuffixTreeBuilder.FindMatches(persistentSuffixTree, querySequence, 3);

                // Verify the count of MUMs found
                Assert.AreEqual(3, MUMs.Count);
            }
        }
Example #2
0
        public void TestStreamingInMemorySimpleSequence()
        {
            string   sequenceString = "AGTATGCCCCCCCCCCTGCCG";
            Sequence sequence       = new Sequence(Alphabets.Protein, sequenceString);

            using (SimpleSuffixTreeBuilder simpleSuffixTreeBuilder = new SimpleSuffixTreeBuilder())
            {
                ISuffixTree inMemorySuffixTree = simpleSuffixTreeBuilder.BuildSuffixTree(sequence);

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

                IList <MaxUniqueMatch> MUMs = simpleSuffixTreeBuilder.FindMatches(inMemorySuffixTree, querySequence, 3);

                // Verify the count of MUMs found
                Assert.AreEqual(2, MUMs.Count);
            }
        }