[Biojava-dev] [Bug 2602] New: ParseException thrown when parsing Genbank file.

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Oct 1 20:48:15 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2602

           Summary: ParseException thrown when parsing Genbank file.
           Product: BioJava
           Version: live (CVS source)
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: seq.io
        AssignedTo: biojava-dev at biojava.org
        ReportedBy: tritt at wisc.edu


When attempting to read in a Genbank file using RichSequence.IOTools, I
received a ParseException. When using SeqIOTools, I do not have this problem.
The code that exposed the bug is given below. 

public static void main(String[] args) {

        String dnaDir = args[args.length-1];

        BufferedReader[] br = new BufferedReader[8];

        FileReader orthologs = null;
        for (int i = 0; i < br.length; i++)
                br[i] = null;

        try {
                orthologs = new FileReader(args[0]);
                for (int i = 0; i < br.length; i++)
                        br[i] = new BufferedReader(new FileReader(args[i+1]));
        } catch (FileNotFoundException ex){
                ex.printStackTrace();
                System.exit(-1);
        }

        RichSequenceIterator[] seqIt = new RichSequenceIterator[8];

        HashMap<String,RichFeature>[] features = new HashMap[8];
        for (int i = 0; i < features.length; i++){
                features[i] = new HashMap<String,RichFeature>();
        }

        for (int i = 0; i < br.length; i++)
                seqIt[i] = RichSequence.IOTools.readGenbankDNA(br[i], null);

        for (int i = 0; i < seqIt.length; i++){
                RichSequence seq = null;
                try {
                        seq = seqIt[i].nextRichSequence();
                        seqIt[i] = null;
                        br[i] = null;
                } catch (NoSuchElementException ex) {
                        ex.printStackTrace();
                        System.exit(-1);
                } catch (BioException ex) {
                        ex.printStackTrace();
                        System.exit(-1);
                }
                 .
                 .
                 .

The following error message was received.

org.biojava.bio.BioException: Could not read sequence
        at
org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:113)
        at OrthologSeqExtractor.main(OrthologSeqExtractor.java:76)
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=EDL933
Id=null
Comments=Bad dbxref
Parse_block=FEATURES   Location/Qualifierssource   1..5528423/db_xref  
"GenBank:AE005174"/db_xref   "RefSeq_NA:NC_002655"/db_xref  
"ATCC:700927"/db_xref   "taxon:155864"/db_xref   "ERIC:SOP"/mol_type   "genomic
DNA"/note   "enterohemorrhagic"/organism   "Escherichia coli"/serotype  
"O157:H7:K-"/strain   "EDL933"/transl_table   11/db_xref  
"ASAP:ABH-0023909"/db_xref   "ERIC:ABH-0023909"

                  .
                  .
                  .

Stack trace follows ....


        at
org.biojavax.bio.seq.io.GenbankFormat.readRichSequence(GenbankFormat.java:462)
        at
org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:110)
        ... 1 more


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the biojava-dev mailing list