[Biojava-l] Alphabets with ambiguity symbols included

Thomas Down td2@sanger.ac.uk
Mon, 28 Oct 2002 23:31:31 +0000


On Mon, Oct 28, 2002 at 10:29:29PM +0000, David Huen wrote:
> How do I get an Alphabet that has all the ambiguity symbols too?  Do we have 
> one canned?
> 
> I'm trying to get a Distribution to generate an almighty brew of random 
> symbols to torture test the SymbolList implementations with a jUnit.

The idea is that the Alphabets `implicitly' contain all
possible ambiguity symbols, rather than ever actually defining
them all.  This is kind-of important for things situations
like protein where you (generally) don't want to enumerate all
the 2**20 possibilities...  For the same reason, ambiguities
never directly appear in Distributions.

If you want a complete set of possible ambiguity symbols,
for torture-testing or whatever, I'd suggest using
AlphabetManager.getAllSymbols.  This returns a Set containing
all possible symbols (ambiguous, atomic, and gap) which
can exist in a given FiniteAlphabet.  Works very nicely for
DNA-sized alphabets, use at own risk for large alphabets...

      Thomas.