[Biojava-l] how can i read a genbank

Rajeswari rajeee_sss at yahoo.com
Wed Oct 11 07:41:21 UTC 2006


Dear developers.,
   
  I got the biojava program to read a genbank file from biojava.org.
   
  it is as follows:
   
  import org.biojava.bio.seq.*;
import org.biojava.bio.seq.io.*;
import java.io.*;
import org.biojava.bio.*;
import java.util.*;
 
public class genbank1
 {
  public static void main(String[] args)
  {
    BufferedReader br = null;
 
    try
    {
         FileReader f=new FileReader(mygen.java);
        br = new BufferedReader(f);
 
    }
    catch (FileNotFoundException ex)
    {
         ex.printStackTrace();
      System.exit(-1);
    }
 
    
    SequenceIterator sequences = SeqIOTools.readGenbank(br);
 
         while(sequences.hasNext())
         {
      try
        {
 
        Sequence seq = sequences.nextSequence();
      
 
      }
      catch(BioException ex)
      {
       ex.printStackTrace();
      }
      catch(NoSuchElementException ex)
        {
        ex.printStackTrace();
      }
    }
  }
}

   
  And i saved it as genbank1.java
   
  it was compiled with javac genbank1.java
   
   
  and when i try to execute  it shows no classfoundException.
   
   
  i run the pro as follows:
   
  c:\jdk1.4\bin\java genbank1 mygen.java
   
  mygen.java consists of the genbank file.
   
   
   
  i think the error may be deu to the genbank file.
   
   
  can anybody tell me how to do this pro correct? and provide me the exact format of a genbank file with extension.
   
   
   
  regards
  s.rajee

 		
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail.



More information about the Biojava-l mailing list