[Biojava-l] NCBI Genbank

Thomas Down td2@sanger.ac.uk
Sat, 9 Feb 2002 08:20:53 +0000


On Fri, Feb 08, 2002 at 03:48:36PM -0500, wanner.de@pg.com wrote:
> Hello
> 
> Very new to bioJava site, wondered if methods are available for parsing NCBI
> Genbank information.  If possible siting
> examples in the documentation would be appreciated.  Any suggestions concerning
> bioJava and NCBI Genbank would
> be welcomed.....

Does the following code fragment do what you want:

   BufferedReader stream = new BufferredReader(
       new FileReader("some-genbank-file.gb")
   ) ;
   SequenceIterator si = SeqIOTools.readGenbank(stream);
   while (si.hasNext()) {
       Sequence seq = si.nextSequence();
       // Your processing here...
   }


That should work both with 1.1x releases and with 1.2rc1.
If you're just starting, I'd actually recommend you look
at 1.2 -- the project has moved on a long way since the
1.1 releases.

For more information about reading and writing sequence
files, look at:

   http://www.biojava.org/tutorials/chap_iobasics.html

Or the JavaDoc documentation for the package
  
   org.biojava.bio.seq.io

Hope this helps,

    Thomas.