[Biojava-l] StringIndexOutOfBoundsException while parsing blast result

David Toomey dtoomey at rcsi.ie
Tue Sep 30 13:26:02 UTC 2008


Hi

 

I am parsing a blast result and I am getting a
StringIndexOutOfBoundsException. The stack trace is

 

        at java.lang.String.substring(String.java:1938)

        at java.lang.String.substring(String.java:1905)

        at
org.biojava.bio.program.sax.BlastLikeAlignmentSAXParser.parseLine(BlastLikeA
lignmentSAXParser.java:291)

        at
org.biojava.bio.program.sax.BlastLikeAlignmentSAXParser.parse(BlastLikeAlign
mentSAXParser.java:116)

        at
org.biojava.bio.program.sax.HitSectionSAXParser.outputHSPInfo(HitSectionSAXP
arser.java:517)

        at
org.biojava.bio.program.sax.HitSectionSAXParser.firstHSPEvent(HitSectionSAXP
arser.java:287)

        at
org.biojava.bio.program.sax.HitSectionSAXParser.interpret(HitSectionSAXParse
r.java:251)

        at
org.biojava.bio.program.sax.HitSectionSAXParser.parse(HitSectionSAXParser.ja
va:117)

        at
org.biojava.bio.program.sax.BlastSAXParser.hitsSectionReached(BlastSAXParser
.java:634)

        at
org.biojava.bio.program.sax.BlastSAXParser.interpret(BlastSAXParser.java:341
)

        at
org.biojava.bio.program.sax.BlastSAXParser.parse(BlastSAXParser.java:168)

        at
org.biojava.bio.program.sax.BlastLikeSAXParser.onNewDataSet(BlastLikeSAXPars
er.java:314)

        at
org.biojava.bio.program.sax.BlastLikeSAXParser.interpret(BlastLikeSAXParser.
java:276)

        at
org.biojava.bio.program.sax.BlastLikeSAXParser.parse(BlastLikeSAXParser.java
:163)

        at ie.rcsi.blast.StandardParser.parse(StandardParser.java:65)

        at ie.rcsi.blast.BlastParser.parse(BlastParser.java:44)

        at ie.rcsi.blast.Main.main(Main.java:30)

 

I have updated BlastLikeAlignmentSAXParser to output some debug info and
narrowed down the line causing the problem to the following line

 

2,4-cyclodiphosphate synthase OS=Plasmodium falciparum (isolate 3D7) 

GN=ISPF

 

If I remove the carriage return and put it on a single line then everything
works fine. Strangely if I copy this entry and put it in a file on it's own
it also parses correctly, even with the carriage return!!!

 

Has anyone seen this before or does anyone have a suggestion on what I might
to do fix it. I send the complete blast result if it would help. I have
tried using blast 2.2.18 and 2.2.17 and the problem is the same.

 

Cheers

 

Dave

 

 





More information about the Biojava-l mailing list