[Biojava-l] Help

Geoff Purdy gpurdy@cogentneuroscience.com
Fri, 10 Aug 2001 11:07:40 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C121AE.32DBB450
Content-Type: text/plain;
	charset="iso-8859-1"

Ramana,
Your program runs without errors on my system.  Have you configured your
development environment as described in the BioJava "Getting Started"
document (  http://www.biojava.org/docs/started.html
<http://www.biojava.org/docs/started.html>  )?  Depending on the exact
nature of the error, you may also want to verify that the path to the file
is valid and that the sequence format is correct.
 
Hope this is helpful,
Geoff

-----Original Message-----
From: RAMANA [mailto:ramana@galainfotek.com]
Sent: Friday, August 10, 2001 3:58 AM
To: biojava-l@biojava.org
Subject: [Biojava-l] Help


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:
-------------------------
 


------_=_NextPart_001_01C121AE.32DBB450
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.50.4522.1800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=083295714-10082001>Ramana,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=083295714-10082001>Your 
program runs&nbsp;without errors on my system.&nbsp;&nbsp;Have you configured 
your&nbsp;development environment as described in the BioJava "Getting 
Started"&nbsp; document (&nbsp;<A 
href="http://www.biojava.org/docs/started.html">http://www.biojava.org/docs/started.html</A> 
)?&nbsp; Depending on the exact nature of the error, you may also want to verify 
that the path to the file is&nbsp;valid and that the sequence format is 
correct.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=083295714-10082001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=083295714-10082001>Hope 
this is helpful,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=083295714-10082001>Geoff</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> RAMANA 
  [mailto:ramana@galainfotek.com]<BR><B>Sent:</B> Friday, August 10, 2001 3:58 
  AM<BR><B>To:</B> biojava-l@biojava.org<BR><B>Subject:</B> [Biojava-l] 
  Help<BR><BR></FONT></DIV>
  <DIV><FONT face=Arial size=2>Hello This is ramana from 
  GalaInfotek,</FONT></DIV>
  <DIV><FONT face=Arial size=2>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.</FONT></DIV>
  <DIV><FONT face=Arial size=2>hoping that you would do the needy.</FONT></DIV>
  <DIV><FONT face=Arial size=2>Thanking you</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Ramana</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Programme</FONT></DIV>
  <DIV><FONT face=Arial size=2>---------------------</FONT></DIV>
  <DIV><FONT face=Arial size=2>import java.io.*;<BR>import 
  org.biojava.bio.symbol.*;<BR>import org.biojava.bio.seq.*;<BR>import 
  org.biojava.bio.seq.io.*;</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>public class GCContent {<BR>&nbsp;&nbsp;&nbsp; 
  public static void main(String[] 
  args)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throws 
  Exception<BR>&nbsp;&nbsp;&nbsp; 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (args.length != 
  1)<BR>&nbsp;&nbsp;&nbsp;&nbsp; throw new Exception("usage: java GCContent 
  filename.fa");<BR>&nbsp;String fileName = 
  args[0];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  System.out.println("FileName"+fileName);<BR>&nbsp;// Set up sequence 
  iterator</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp;BufferedReader br = new 
  BufferedReader(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  new FileReader(fileName));<BR>&nbsp;System.out.println("File 
  opened..............");<BR>&nbsp;SequenceIterator stream = 
  SeqIOTools.readFastaDNA(br);</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp;// Iterate over all sequences in the 
  stream</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp;while (stream.hasNext()) 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp; Sequence seq = 
  stream.nextSequence();<BR>&nbsp;&nbsp;&nbsp;&nbsp; int gc = 
  0;<BR>&nbsp;&nbsp;&nbsp;&nbsp; for (int pos = 1; pos &lt;= seq.length(); 
  ++pos) {<BR>&nbsp;&nbsp;Symbol sym = seq.symbolAt(pos);<BR>&nbsp;&nbsp;if (sym 
  == DNATools.g() || sym == DNATools.c())<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  ++gc;<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  System.out.println(seq.getName() + ": " + 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((gc * 100.0) / 
  seq.length()) +&nbsp; "%");<BR>&nbsp;}<BR>&nbsp;&nbsp;&nbsp; 
  }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>}<BR></FONT></DIV>
  <DIV><FONT face=Arial size=2>Runtime Error:</FONT></DIV>
  <DIV><FONT face=Arial size=2>-------------------------</FONT></DIV>
  <DIV><FONT face=Arial size=2>&nbsp;</DIV></BLOCKQUOTE></FONT></BODY></HTML>

------_=_NextPart_001_01C121AE.32DBB450--