[Biojava-dev] Problems with cross-product alphabets and alignments

Matthew Pocock matthew_pocock at yahoo.co.uk
Fri Mar 14 16:14:56 EST 2003


I'm looking at AlphabetManger.createSymbol(Annotation, List, Alphabet) 
now (the code that ultimately should be invoked), and don't see anything 
realy wrong. There is no code here that could return a gap (the global 
gap, or the alphabet gap). Could you commit a unit test that exercisies 
this bug, and then we can work from the same position towards a fix.

Matthew

Lachlan James Coin wrote:
> The alphabet being used is a SparseCrossProductAlphabet.  However, the 
> getSymbol method is inherited from AbstractAlphabet.  The problem seems to be 
> in the following code within the getSymbol() method of AbstractAlphabet.  
> atomic is a count of the number of atomic symbols in the list of symbols 
> (syms).  Because a gap is not an atomic symbol it doesn't count, and hence 
> atomic< syms.size().  One way to fix this is to make gap an atomic symbol, but 
> this causes lots of other problems (at least the validate() methods fail)
> 
>  if(atomic == syms.size()) {
>       return getSymbolImpl(syms);
>       } else {
>       return AlphabetManager.createSymbol(
>        '*', Annotation.EMPTY_ANNOTATION,
>         syms, this
>       );
> 
> Any ideas?
> 
> Thanks,
> 
> Lachlan
> 
> 


-- 
BioJava Consulting LTD - Support and training for BioJava
http://www.biojava.co.uk



More information about the biojava-dev mailing list