There are two ways to get alphabets: directly through the corresponding class, or through the Alphabets static class.

.NET Bio supports several alphabet styles oriented around DNA, RNA and Proteins. For each group, there are two sub-groups: base and Ambiguous.

The Alphabets class has properties which let you select an alphabet, and methods to identify an alphabet based on a set of characters, or to perform validations on alphabets (to check if a given alphabet is included in another for example).

For example, to use the base DNA alphabet, you can use:

var dnaAlphabet = Alphabets.DNA;

to use the ambiguous form, it would be:
var dnaAlphabet = Alphabets.AmbiguousDNA;

As mentioned, you can also go directly to the given class and use the static Instance property; for example:
var dnaAlphabet = DnaAlphabet.Instance;

Once you have an alphabet, you can examine the contents (valid symbols) or use it to construct a sequence.

Last edited Jun 16, 2014 at 10:55 PM by markjulmar, version 1


No comments yet.