[Biojava-l] seqString() produces stacktrace

mark.schreiber at group.novartis.com mark.schreiber at group.novartis.com
Sun Jan 11 21:57:40 EST 2004


I've done some investigations and the offending line is:


gappedSequence.removeGaps(11, 6);

This seems to be a real bug (at least in BJ1.3.1). Confusingly if you 
change the 6 to any other legal value everything works as expected. 
Matthew do you know whats going on here??

- Mark


Mark Schreiber
Principal Scientist (Bioinformatics)

Novartis Institute for Tropical Diseases (NITD)
1 Science Park Road
#04-14 The Capricorn
Singapore 117528

phone +65 6722 2973
fax  +65 6722 2910





"david de beule" <daviddebeule at pandora.be>
Sent by: biojava-l-bounces at portal.open-bio.org
01/11/2004 12:38 AM

 
        To:     <biojava-l at biojava.org>
        cc: 
        Subject:        [Biojava-l] seqString() produces stacktrace


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



_______________________________________________
Biojava-l mailing list  -  Biojava-l at biojava.org
http://biojava.org/mailman/listinfo/biojava-l





More information about the Biojava-l mailing list