[Biojava-dev] [Fwd: [Biojava-l] failed to read genbank peptide file]

mark.schreiber at group.novartis.com mark.schreiber at group.novartis.com
Thu Aug 12 13:20:38 EDT 2004


I'm travelling right now so I can't. Any other takers?

More generally we need to improve some areas of the protein I/O. Notably 
the EmblLikeFormat doesn't really work too well for SwissProt. There are 
just too many subtle differences between the two.

- Mark





Matthew Pocock <matthew_pocock at yahoo.co.uk>
Sent by: biojava-dev-bounces at portal.open-bio.org
08/05/2004 09:06 PM

 
        To:     Biojava-dev <biojava-dev at biojava.org>
        cc: 
        Subject:        [Biojava-dev] [Fwd: [Biojava-l] failed to read genbank peptide file]


This looks like it may be a real bug. Does anyone have time to look into 
this?

Matthew (feeling wasted after ISMB)

----- Message from Hongyu Zhang <forward at hongyu.org> on Thu, 29 Jul 2004 
22:41:02 -0700 -----
To:
biojava-l at biojava.org
Subject:
[Biojava-l] failed to read genbank peptide file

I am new to biojava. After being very happy with bioperl, I am glad to
start my biojava adventure. But it looks like something is still not
quite mature in biojava right now.

I've used the example in "biojava in anger" to successfully
read Genbank nucleotide files, but when reading peptide files I got
constant errors. I did change the read function from readGenbank()
to readGenpept(), but it didn't help :( . Is anyone aware of the
problems when reading Genbank formatted peptide files?

I put three sections below
1) the Java code
2) the command line and input file to this code
3) error message


1) First is my code, which is copied and revised from "biojava in
anger":

import org.biojava.bio.seq.*;
import org.biojava.bio.seq.io.*;
import java.io.*;
import org.biojava.bio.*;
import java.util.*;

public class ReadGB {
  public static void main(String[] args) {
    BufferedReader br = null;

    try {

      //create a buffered reader to read the sequence file specified
by args[0]
      br = new BufferedReader(new FileReader(args[0]));

    }
    catch (FileNotFoundException ex) {
      //can't find the file specified by args[0]
      ex.printStackTrace();
      System.exit(-1);
    }

    //read the GenBank File
    SequenceIterator sequences = SeqIOTools.readGenpept(br);

    //iterate through the sequences
    while(sequences.hasNext()){
      try {

        Sequence seq = sequences.nextSequence();
        //do stuff with the sequence

      }
      catch (BioException ex) {
        //not in GenBank format
        ex.printStackTrace();
      }catch (NoSuchElementException ex) {
        //request for more sequence when there isn't any
        ex.printStackTrace();
      }
    }
  }
}


2) After I successfully compiled the java code, I ran it in unix shell
window like this:
$ java ReadGB input_file

where the input_file is copied from the followin NCBI link:
http://www.ncbi.nih.gov/entrez/batchseq.cgi?txt=on&list_uids=7288210

3) And then I got this error message

org.biojava.bio.BioException: Couldn't realize feature
        at
org.biojava.bio.seq.SimpleFeatureRealizer$TemplateImpl.realize(SimpleFeatureRealizer.java:147)
        at
org.biojava.bio.seq.SimpleFeatureRealizer.realizeFeature(SimpleFeatureRealizer.java:97)
        at
org.biojava.bio.seq.impl.SimpleSequence.realizeFeature(SimpleSequence.java:217)
        at
org.biojava.bio.seq.impl.SimpleSequence.createFeature(SimpleSequence.java:223)
        at
org.biojava.bio.seq.io.SequenceBuilderBase.makeSequence(SequenceBuilderBase.java:175)
        at
org.biojava.bio.seq.io.SmartSequenceBuilder.makeSequence(SmartSequenceBuilder.java:103)
        at
org.biojava.bio.seq.io.SequenceBuilderFilter.makeSequence(SequenceBuilderFilter.java:99)
        at
org.biojava.bio.seq.io.StreamReader.nextSequence(StreamReader.java:102)
        at ReadGB.main(ReadGB.java:30)
Caused by: org.biojava.bio.BioError: Could not initialize OntoTools
        at org.biojava.ontology.OntoTools.<clinit>(OntoTools.java:106)
        at
org.biojava.bio.seq.impl.SimpleFeature.<init>(SimpleFeature.java:392)
        at
org.biojava.bio.seq.impl.SimpleStrandedFeature.<init>(SimpleStrandedFeature.java:97)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at
org.biojava.bio.seq.SimpleFeatureRealizer$TemplateImpl.realize(SimpleFeatureRealizer.java:141)
        ... 8 more
Caused by: java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:61)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
        at org.biojava.ontology.OntoTools.<clinit>(OntoTools.java:61)
        ... 15 more
org.biojava.bio.BioException: Couldn't realize feature
        at
org.biojava.bio.seq.SimpleFeatureRealizer$TemplateImpl.realize(SimpleFeatureRealizer.java:147)
        at
org.biojava.bio.seq.SimpleFeatureRealizer.realizeFeature(SimpleFeatureRealizer.java:97)
        at
org.biojava.bio.seq.impl.SimpleSequence.realizeFeature(SimpleSequence.java:217)
        at
org.biojava.bio.seq.impl.SimpleSequence.createFeature(SimpleSequence.java:223)
        at
org.biojava.bio.seq.io.SequenceBuilderBase.makeSequence(SequenceBuilderBase.java:175)
        at
org.biojava.bio.seq.io.SmartSequenceBuilder.makeSequence(SmartSequenceBuilder.java:103)
        at
org.biojava.bio.seq.io.SequenceBuilderFilter.makeSequence(SequenceBuilderFilter.java:99)
        at
org.biojava.bio.seq.io.StreamReader.nextSequence(StreamReader.java:102)
        at ReadGB.main(ReadGB.java:30)
Caused by: java.lang.NoClassDefFoundError
        at
org.biojava.bio.seq.impl.SimpleFeature.<init>(SimpleFeature.java:392)
        at
org.biojava.bio.seq.impl.SimpleStrandedFeature.<init>(SimpleStrandedFeature.java:97)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at
org.biojava.bio.seq.SimpleFeatureRealizer$TemplateImpl.realize(SimpleFeatureRealizer.java:141)
        ... 8 more
org.biojava.bio.BioException: Couldn't realize feature
        at
org.biojava.bio.seq.SimpleFeatureRealizer$TemplateImpl.realize(SimpleFeatureRealizer.java:147)
        at
org.biojava.bio.seq.SimpleFeatureRealizer.realizeFeature(SimpleFeatureRealizer.java:97)
        at
org.biojava.bio.seq.impl.SimpleSequence.realizeFeature(SimpleSequence.java:217)
        at
org.biojava.bio.seq.impl.SimpleSequence.createFeature(SimpleSequence.java:223)
        at
org.biojava.bio.seq.io.SequenceBuilderBase.makeSequence(SequenceBuilderBase.java:175)
        at
org.biojava.bio.seq.io.SmartSequenceBuilder.makeSequence(SmartSequenceBuilder.java:103)
        at
org.biojava.bio.seq.io.SequenceBuilderFilter.makeSequence(SequenceBuilderFilter.java:99)
        at
org.biojava.bio.seq.io.StreamReader.nextSequence(StreamReader.java:102)
        at ReadGB.main(ReadGB.java:30)
Caused by: java.lang.NoClassDefFoundError
        at
org.biojava.bio.seq.impl.SimpleFeature.<init>(SimpleFeature.java:392)
        at
org.biojava.bio.seq.impl.SimpleStrandedFeature.<init>(SimpleStrandedFeature.java:97)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at
org.biojava.bio.seq.SimpleFeatureRealizer$TemplateImpl.realize(SimpleFeatureRealizer.java:141)
        ... 8 more


Thanks for your help.


--
Hongyu Zhang
Computational biologist
Ceres Inc.





_______________________________________________
Biojava-l mailing list  -  Biojava-l at biojava.org
http://biojava.org/mailman/listinfo/biojava-l

_______________________________________________
biojava-dev mailing list
biojava-dev at biojava.org
http://biojava.org/mailman/listinfo/biojava-dev





More information about the biojava-dev mailing list