[Biojava-l] FiniteAlphabet.symbols() depreciated

Matthew Pocock mrp@sanger.ac.uk
Fri, 30 Mar 2001 11:14:55 +0100


Hi Robin,

The symbols method (returning a SymbolList) is bloat in the 
FiniteAlphabet interface - it makes some implementations unwieldey (what 
should you return if someone asks for DNA^16 and then gets the symbols 
which will be a list longer than 'int' can index). But, if you use it, 
it stays in.

You can iterate over the matches alphabet directly if you want using 
FiniteAlphabet.iterator() and you can find out how many codons match 
there by using FiniteAlphabet.size(). The only other funcitonality that 
a List offers over the alphabet is an imposed ordering, which is 
funcitonality now handled by the AlphabetIndex interface.

I presume that dcodon came from a Protein->Codon reverse-translation 
table. Yes? No? I am guessing that currelist becomes a List of Lists of 
codons where some of the inner lists are length 1 and others are longer 
(for ambiguous codons). How do you go on to use currelist?

All the best,
Matthew

Emig, Robin wrote:

> 	I just wanted to find out the rationalization for why
> FiniteAlphabet.symbols() was depreciated? The reason is that I have the
> following code:
> 
> //for each dcodon, get possible codons
> 	
> currelist.add(((FiniteAlphabet)dcodon.getMatches()).symbols().toList()));
> 
> dcodon is a symbol based on an 3xDNA alphabet, and could contain
> ambiquities.
> 
> Now, I'm a little unsure about how to proceed. I could get an iterator and
> then add all the items to a list one at a time, kinda messy. Is there a
> better way? Or should we keep the .symbols() method?
> -Robin
> 
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l