[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 without errors on my system. Have you configured
your development environment as described in the BioJava "Getting
Started" document ( <A
href="http://www.biojava.org/docs/started.html">http://www.biojava.org/docs/started.html</A>
)? 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.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=083295714-10082001></SPAN></FONT> </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> </DIV>
<DIV><FONT face=Arial size=2>Ramana</FONT></DIV>
<DIV> </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> </DIV>
<DIV><FONT face=Arial size=2>public class GCContent {<BR>
public static void main(String[]
args)<BR> throws
Exception<BR>
{<BR> if (args.length !=
1)<BR> throw new Exception("usage: java GCContent
filename.fa");<BR> String fileName =
args[0];<BR>
System.out.println("FileName"+fileName);<BR> // Set up sequence
iterator</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> BufferedReader br = new
BufferedReader(<BR>
new FileReader(fileName));<BR> System.out.println("File
opened..............");<BR> SequenceIterator stream =
SeqIOTools.readFastaDNA(br);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> // Iterate over all sequences in the
stream</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> while (stream.hasNext())
{<BR> Sequence seq =
stream.nextSequence();<BR> int gc =
0;<BR> for (int pos = 1; pos <= seq.length();
++pos) {<BR> Symbol sym = seq.symbolAt(pos);<BR> if (sym
== DNATools.g() || sym == DNATools.c())<BR>
++gc;<BR> }<BR>
System.out.println(seq.getName() + ": " +
<BR> ((gc * 100.0) /
seq.length()) + "%");<BR> }<BR>
} <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> </DIV></BLOCKQUOTE></FONT></BODY></HTML>
------_=_NextPart_001_01C121AE.32DBB450--