[Biojava-l] seqString() produces stacktrace

david de beule daviddebeule at pandora.be
Sat Jan 10 11:38:53 EST 2004


Hi all,

This piece of code:

Alphabet dna1 = DNATools.getDNA();
   SymbolTokenization dnaToke1 = dna1.getTokenization("token");
   SymbolList symbolList = new SimpleSymbolList(dnaToke1, "ACTGGACCTAAGG");
   Sequence sequence = new SimpleSequence(symbolList, "test", "test", null);
   SimpleGappedSequence gappedSequence = new SimpleGappedSequence(sequence);

   gappedSequence.addGapsInView(4, 4);
   gappedSequence.removeGap(7);
   gappedSequence.removeGaps(4, 3);
   gappedSequence.addGapsInView(7, 2);
   gappedSequence.addGapsInView(9, 3);
   gappedSequence.addGapsInView(12, 2);
   gappedSequence.addGapsInView(14, 3);
   gappedSequence.addGapsInView(17, 2);
   gappedSequence.removeGap(18);
   gappedSequence.removeGaps(11, 6);

   System.out.println(gappedSequence.seqString());

breaks on the seqString() call and gives produces the following stacktrace:

java.lang.ArrayIndexOutOfBoundsException: 13
 at
org.biojava.bio.symbol.SimpleSymbolList.symbolAt(SimpleSymbolList.java:271)
 at
org.biojava.bio.seq.impl.SimpleSequence.symbolAt(SimpleSequence.java:120)
 at
org.biojava.bio.symbol.SimpleGappedSymbolList.symbolAt(SimpleGappedSymbolLis
t.java:508)
 at
org.biojava.bio.symbol.AbstractSymbolList$SymbolIterator.next(AbstractSymbol
List.java:201)
 at
org.biojava.bio.seq.io.CharacterTokenization.tokenizeSymbolList(CharacterTok
enization.java:211)
 at
org.biojava.bio.symbol.AlphabetManager$WellKnownTokenizationWrapper.tokenize
SymbolList(AlphabetManager.java:1383)
 at
org.biojava.bio.symbol.AbstractSymbolList.seqString(AbstractSymbolList.java:
102)

Can this be a bug ?
Any help would be appreciated,

David De Beule





More information about the Biojava-l mailing list