[Biojava-l] Basis and Atomic Symbols

Thomas Down td2@sanger.ac.uk
Tue, 6 Mar 2001 23:22:36 +0000


On Wed, Mar 07, 2001 at 11:44:53AM +1300, Schreiber, Mark wrote:
> Hi
> 
> Is there anyway to convert a basis symbol into a list of non-redundant
> Atomic symbols that would make up the basis symbol.

I take it you mean "take the basis symbol 'awa' and return
'ata' and 'aaa'?

The getMatches method returns an Alphabet which contains
these symbols.  You can iterate over it and populate
a list if that's helpful.

> Alternatively if a basis symbol is actually non-redundant can this be
> determined and is there a way to convert it to an Atomic Symbol (casting is
> not allowed).

A non-ambiguous basis symbol (I take it this is what you
mean by non-redundant) IS an atomic symbol.  The behind-the-scenes
Symbol construction code in AlphabetManager and friends should
ensure that this is the case.  You can check with instanceof

This doesn't avoid the need for a cast, though.  What is the
problem with casting?


     Thomas.