[Biojava-l] Parsing Genbank-sequences from NCBI

David Scott david at autohandle.com
Fri Aug 4 18:57:04 UTC 2006


hi seth-

the 3rd argument to SimpleDocRef constructor is the REFERENCE title - 
which appears to be null in the trace - which happens, but rarely. i had 
the exact same problem recently - and richard put in code to check for a 
null title and then call a special 2 argument constructor for 
SimpleDocRef - any chance you don't have that code checked out?

best-
david

Seth Johnson wrote:
> Hi Richard,
>
>
> I'm back for more help.  I've just completed getting and parsing the entire
> human genome RefSeq list from NCBI.  I'm not going to post my source code
> since the invoking code has been described by the gentlemen who started the
> original thread last month.  The result of the parsing is such that out of
> ~28K sequences, 13 produced the exceptions below.  I've used the latest
> biojava code from CVS, not quite sure what the problem is on these 13.
>
>
>
> Trying to get: NM_006145
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
> --------------------------------------------------------------------------------
>
> Trying to get: NM_000602
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> -------------------------------------------------------------------------------
>
> Trying to get: NM_006226
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> ----------------------------------------------------------------------------------
>
> Trying to get: NM_000371
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> --------------------------------------------------------------------------------
>
> Trying to get: NM_019072
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> --------------------------------------------------------------------------------
>
> Trying to get: NM_017884
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> --------------------------------------------------------------------------------
>
> Trying to get: NM_022107
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> ---------------------------------------------------------------------------------
>
> Trying to get: NM_031418
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> ---------------------------------------------------------------------------------------
>
> Trying to get: NM_030809
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> -------------------------------------------------------------------------------------
>
> Trying to get: NM_032731
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> ------------------------------------------------------------------------------------
>
> Trying to get: NM_001029888
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> ------------------------------------------------------------------------------------
>
> Trying to get: NM_001029869
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
> ------------------------------------------------------------------------------------
>
> Trying to get: NM_182572
>
> org.biojava.bio.BioException: Failed to read Genbank sequence
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:157)
>
>         at exonhit.parsers.RefSeqParser.updateRefSeq(RefSeqParser.java:162)
>
>         at exonhit.parsers.RefSeqParser.update(RefSeqParser.java:146)
>
>         at exonhit.parsers.RefSeqParser.main(RefSeqParser.java:195)
>
> Caused by: org.biojava.bio.BioException: Could not read sequence
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:112)
>
>         at org.biojavax.bio.db.ncbi.GenbankRichSequenceDB.getRichSequence(
> GenbankRichSequenceDB.java:153)
>
>         ... 3 more
>
> Caused by: java.lang.IllegalArgumentException: Could not find constructor
> for class org.biojavax.SimpleDocRef(class java.util.ArrayList,class
> java.lang.String,null)
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:78)
>
>         at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java
> :104)
>
>         at org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(
> GenbankFormat.java:387)
>
>         at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(
> RichStreamReader.java:109)
>
>         ... 4 more
>
> Caused by: java.lang.NullPointerException
>
>         at org.biojavax.SimpleRichObjectBuilder.buildObject(
> SimpleRichObjectBuilder.java:59)
>
>         ... 7 more
>
>
>
>
>   




More information about the Biojava-l mailing list