[Biojava-l] Parsing exception reading sequence from GenbankRichSequenceDB
Scott Frees
sfrees at ramapo.edu
Thu Feb 16 14:24:56 UTC 2012
Hello –
I have developed an application that searches and compares
g-quadruplexes within mRNA. The web application has been running
without any problems on several different web servers for over a year.
Suddenly, just this week, it is unable to download sequence data
using GenbankRichSequenceDB – has anyone else has had this problem?
We are using BioJava 1.8.1
Below is the exception trace, and the code that follows is a small
test app that generates the exception. This code worked without any
problems prior to Tuesday this week, and we haven't made any
modification to our application.
------------------------------------------------------
org.biojava.bio.BioException: Failed to read Genbank sequence
at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(GenbankRichSequenceDB.java:163)
at Tester.main(Tester.java:11)
Caused by: org.biojava.bio.BioException: Could not read sequence
at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:113)
at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(GenbankRichSequenceDB.java:159)
... 1 more
Caused by: org.biojava.bio.seq.io.ParseException:
A Exception Has Occurred During Parsing.
Please submit the details that follow to biojava-l at biojava.org or post
a bug report to http://bugzilla.open-bio.org/
Format_object=org.biojavax.bio.seq.io.GenbankFormat
Accession=null
Id=null
Comments=Bad section
Parse_block=<?xml version="1.0"?>
Stack trace follows ....
at org.biojavax.bio.seq.io.GenbankFormat.readSection(GenbankFormat.java:620)
at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(GenbankFormat.java:279)
at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:110)
... 2 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range: -4
at java.lang.String.substring(Unknown Source)
at java.lang.String.substring(Unknown Source)
at org.biojavax.bio.seq.io.GenbankFormat.readSection(GenbankFormat.java:610)
... 4 more
-----------------------------
import org.biojava.bio.BioException;
import org.biojava.bio.seq.db.IllegalIDException;
import org.biojavax.bio.db.ncbi.GenbankRichSequenceDB;
import org.biojavax.bio.seq.RichSequence;
public class Tester {
public static void main(String args[]) {
String id = "NM_001110.2"; // Issue occurs with any ID
GenbankRichSequenceDB ncbi = new GenbankRichSequenceDB();
try {
RichSequence rs = ncbi.getRichSequence(id);
System.out.println(rs.seqString());
} catch (IllegalIDException e) {
e.printStackTrace();
} catch (BioException e) {
e.printStackTrace();
}
}
}
More information about the Biojava-l
mailing list