[Biojava-l] Help

Matthew Pocock mrp@sanger.ac.uk
Tue, 14 Aug 2001 14:40:06 +0100


Could you send in the run-time error that you see (stack-trace and all)? 
Also, if the error happens for one file only, could you send us that file?

Thanks.

M

RAMANA wrote:

> Hello This is ramana from GalaInfotek,
> 
> please go through the programme, i am compiling th eprogram successfully 
> but i am getting a run time error, do if you can tell the reason for the 
> error this will of very great help for me.
> 
> hoping that you would do the needy.
> 
> Thanking you
> 
>  
> 
> Ramana
> 
>  
> 
> Programme
> 
> ---------------------
> 
> import java.io.*;
> import org.biojava.bio.symbol.*;
> import org.biojava.bio.seq.*;
> import org.biojava.bio.seq.io.*;
> 
>  
> 
> public class GCContent {
>     public static void main(String[] args)
>         throws Exception
>     {
>         if (args.length != 1)
>      throw new Exception("usage: java GCContent filename.fa");
>  String fileName = args[0];
>        System.out.println("FileName"+fileName);
>  // Set up sequence iterator
> 
>  
> 
>  BufferedReader br = new BufferedReader(
>            new FileReader(fileName));
>  System.out.println("File opened..............");
>  SequenceIterator stream = SeqIOTools.readFastaDNA(br);
> 
>  
> 
>  // Iterate over all sequences in the stream
> 
>  
> 
>  while (stream.hasNext()) {
>      Sequence seq = stream.nextSequence();
>      int gc = 0;
>      for (int pos = 1; pos <= seq.length(); ++pos) {
>   Symbol sym = seq.symbolAt(pos);
>   if (sym == DNATools.g() || sym == DNATools.c())
>       ++gc;
>      }
>      System.out.println(seq.getName() + ": " +
>           ((gc * 100.0) / seq.length()) +  "%");
>  }
>     }         
> }
> 
> Runtime Error:
> 
> -------------------------
> 
>