[Biojava-l] A Exception Has Occurred During Parsing.
Richard Holland
holland at eaglegenomics.com
Fri Dec 11 14:17:21 UTC 2009
If the problem is random, it's almost certainly due to problems with the NCBI server feeding you data. There are restrictions on usage - e.g. NCBI only allows a certain number of requests - so you might be running into those.
cheers,
Richard
On 11 Dec 2009, at 11:36, ilhami visne wrote:
> I created a new class NCBIGenbankSequenceFetcher.java which extends GenbankRichSequenceDB and overrid the "getAddress(String id)" to limit the sequence for an id (seq_start and seq_stop).
>
> public class NCBIGenbankSequenceFetcher extends GenbankRichSequenceDB{
>
> private String seq_start;
> private String seq_stop;
> private String strand="1";//1=plus, 2=minus
>
> public NCBIGenbankSequenceFetcher() {
> }
>
> public NCBIGenbankSequenceFetcher(String seq_start, String seq_stop) {
> this.seq_start = seq_start;
> this.seq_stop = seq_stop;
> }
>
> public NCBIGenbankSequenceFetcher(String seq_start, String seq_stop,String strand) {
> this.seq_start = seq_start;
> this.seq_stop = seq_stop;
> this.strand = strand;
> }
>
> @Override
> protected URL getAddress(String id) throws MalformedURLException {
> FetchURL seqURL = new FetchURL("Genbank", "text");
> String baseurl = seqURL.getbaseURL();
> String db = seqURL.getDB();
> String url = baseurl+db+"&id="+id+"&rettype=gb";
> if(seq_start != null && seq_stop != null){
> url +="&seq_start="+seq_start+"&seq_stop="+seq_stop+"&strand="+strand;
> }
> return new URL(url);
> }
> }
>
> From an other class, i create an instance of this class and then call its "getRichSequence(id)" method. (Not the same, but similar)
>
> for(String gi:ids){ // ids is a list<string>
> seq = new NCBIGenbankSequenceFetcher(seq_start, seq_stop,strand).getRichSequence(gi);
> }
>
> What i found later is that it randomly throws the exception, not by any particular sequence. So my guess an io error, which arises during the data streaming from server.
>
> ilhami visne.
>
> On 12/11/2009 10:59 AM, Richard Holland wrote:
>> Hello. Could you also post the relevant parts of your code that you are running when this exception happens?
>>
>> cheers,
>> Richard
>>
>> On 11 Dec 2009, at 00:46, Ilhami Visne wrote:
>>
>>
>>
>>> Hi,
>>>
>>> I'm following the suggestion "Please submit the details that follow to
>>>
>>> biojava-l at biojava.org or post a bug report to http://bugzilla.open-bio.org/
>>> "
>>> .
>>>
>>> The sequence of concerns is at
>>>
>>> http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=39645757&rettype=gb&seq_start=1353&seq_stop=2128&strand=1
>>>
>>>
>>> Format_object=org.biojavax.bio.seq.io.GenbankFormat
>>> Accession=null
>>> Id=null
>>> Comments=Bad section
>>> Parse_block=
>>> Stack trace follows ....
>>>
>>>
>>> at
>>> org.biojavax.bio.seq.io.GenbankFormat.readSection(GenbankFormat.java:603)
>>> at
>>> org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(GenbankFormat.java:278)
>>> at
>>> org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:110)
>>> ... 8 more
>>> Caused by: java.lang.NullPointerException
>>> at
>>> org.biojavax.bio.seq.io.GenbankFormat.readSection(GenbankFormat.java:593)
>>> ... 10 more
>>> org.biojava.bio.BioException: IO failure whilst reading from Genbank
>>>
>>> Any quick fix,patch?
>>>
>>> thanks.
>>> Ilhami Visne
>>> _______________________________________________
>>> Biojava-l mailing list -
>>> Biojava-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/biojava-l
>>>
>>>
>>>
>> --
>> Richard Holland, BSc MBCS
>> Operations and Delivery Director, Eagle Genomics Ltd
>> T: +44 (0)1223 654481 ext 3 | E:
>> holland at eaglegenomics.com
>> http://www.eaglegenomics.com/
>>
>>
>>
>>
>>
>
--
Richard Holland, BSc MBCS
Operations and Delivery Director, Eagle Genomics Ltd
T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com
http://www.eaglegenomics.com/
More information about the Biojava-l
mailing list