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

Richard Holland holland at eaglegenomics.com
Wed Dec 16 16:38:15 UTC 2009


If that's a compile-time error, it's probably because you haven't got an 'import' statement for BioException, and/or you're compiling against an out-of-date version of BioJava (particularly if you're using Eclipse or some other IDE, check that your source dependencies for BioJava are the same version as the JAR dependencies). 

If that doesn't solve it, could you post the full error stack/console output?

cheers,
Richard

On 16 Dec 2009, at 15:00, Chris Cole wrote:

> 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();
>   }
> }

--
Richard Holland, BSc MBCS
Operations and Delivery Director, Eagle Genomics Ltd
T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com
http://www.eaglegenomics.com/





More information about the Biojava-l mailing list