[Biojava-l] Reading Fasta file problem (new to biojava)

Chris Cole chris at compbio.dundee.ac.uk
Wed Dec 16 15:00:47 UTC 2009


On 16/12/09 11:22, Richard Holland wrote:
> BufferedReader br = new BufferedReader(new FileReader(args[0]));
> Namespace ns = RichObjectFactory.getDefaultNamespace();
> RichSequenceIterator iterator = RichSequence.IOTools.readFastaProtein(br,ns);

Thanks, Richard. However, now I get an error:
"BioException cannot be resolved to a type"

Below is the code for the method. What am I missing?

public void read(String filename) {
    try {
       System.out.println("Reading file: " + filename);
       BufferedReader br = new BufferedReader(new FileReader(filename));
			
       Namespace ns = RichObjectFactory.getDefaultNamespace();
       RichSequenceIterator iter = 
RichSequence.IOTools.readFastaProtein(br,ns);
    }
    catch (FileNotFoundException ex) {
       //can't find file specified by args[0]
       ex.printStackTrace();
    } catch (BioException ex) {
       //error parsing requested format
       ex.printStackTrace();
    }
}



More information about the Biojava-l mailing list