[Biojava-l] A Exception Has Occurred During Parsing.

mark.schreiber at novartis.com mark.schreiber at novartis.com
Mon Dec 14 02:38:04 UTC 2009


Hi -

Judging by the sporadic nature of the bug and the error report I think you 
are correct that there is an I/O problem. I think you are not getting back 
a Genbank format object but probably an error message from NCBI or a time 
out return or similar.

It would be useful if the NCBIGenbankSequenceFetcher could be modified to 
optionally log the response to the URL.

Best regards,

- Mark

biojava-l-bounces at lists.open-bio.org wrote on 12/11/2009 07:36:46 PM:

> 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/
> >
> >
> > 
> 
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l

_________________________

CONFIDENTIALITY NOTICE

The information contained in this e-mail message is intended only for the 
exclusive use of the individual or entity named above and may contain 
information that is privileged, confidential or exempt from disclosure 
under applicable law. If the reader of this message is not the intended 
recipient, or the employee or agent responsible for delivery of the 
message to the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, please 
notify the sender immediately by e-mail and delete the material from any 
computer.  Thank you.



More information about the Biojava-l mailing list