There is a Boyer-Moore search algorithm in .NET Bio, as well as support for Suffix Trees which are good for this sort of thing.

They are both located in the Bio.Algorithms.StringSearch namespace. You could use it like this:

ISequence sequence = new Sequence(Alphabets.AmbiguousDNA, "AGCTAGGTAGCTCAAAAAAGGG"); 
IPatternFinder searcher = new BoyerMoore()
{ 
   IgnoreCase = true 
};

foreach (var pos in searcher.FindMatch(sequence, "*GCTCA*GGG"))
{
   Console.WriteLine("Found Match at: {0}", pos);
}

Last edited Jun 17, 2014 at 4:23 PM by markjulmar, version 3

Comments

fibula13 Jun 17, 2014 at 5:18 PM 
Awesome