AW: [Biojava-l] Parse Genbank file

BIBIS, Garnier, Christophe cgarnier at ttz-Bremerhaven.de
Mon Dec 6 10:16:58 EST 2004


Hello,

It means it did not find a class, probably the Alphabet class but i wonder
why because it is an Interface part of the biojava distribution.
Be sure you have the biojava jar file available in your classpath.

And maybe if you want to parse a genbank file use something like that (see
as well the tutorials):

	private static void readGenBankFile()
	{
		BufferedReader br = null;
		File f = new File("your_genbank_file_path");

		try
		{
			br = new BufferedReader(new FileReader(f));
		}
		catch (FileNotFoundException ex)
		{
			ex.printStackTrace();
			System.exit(-1);
		}

		SequenceIterator sequences = SeqIOTools.readGenbank(br);
		while (sequences.hasNext())
		{
			try
			{
				Sequence seq = sequences.nextSequence();

				System.out.println("sequence: " + seq);
				printSequence(seq);

			}
			catch (BioException ex)
			{
				ex.printStackTrace();
			}
			catch (NoSuchElementException ex)
			{
				ex.printStackTrace();
			}
		}
	}



Regards,
christophe

-----Urspr¨¹ngliche Nachricht-----
Von: Xingen Zhu [mailto:xingenzhu at yahoo.com.cn]
Gesendet: Montag, 29. November 2004 18:46
An: biojava-l at biojava.org
Betreff: [Biojava-l] Parse Genbank file


Hi all,
 I am a new user of biojava.  I use the following java program to parse a
genebank file:
  import java.util.*;
import java.io.*;
 
import org.biojava.bio.*;
import org.biojava.bio.symbol.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.seq.io.*;
 
public class biojava {
 
 public static void main(String[] args) {
  try {
        File genbankFile = new File("e:\\java\\gb.txt"); 
        BufferedReader gReader = new BufferedReader(new 
          InputStreamReader(new FileInputStream(genbankFile)));
       GenbankFormat gFormat = new GenbankFormat();
       Alphabet alpha = DNATools.getDNA();
    
  } catch (Throwable t) {
      t.printStackTrace();
      System.exit(1); 
 }
 
}
}
 
 
This program can be compiled, but not run. The error message is
 Java.lang.NoClassDefFoundError
 
If delete the following line
Alphabet alpha = DNATools.getDNA();
 
It will complie and run 
 
Any idea?
 
Thanks a lot.
Michael




---------------------------------
Do You Yahoo!?
ÏÓÓÊÏä̫С£¿ÑÅ»¢µçÓÊ×ÔÖúÀ©ÈÝ£¡



More information about the Biojava-l mailing list