[Biojava-l] newbie vowes pleas help me!
Sigmund, Ralf
Ralf.Sigmund@MPIHAN.MPG.de
Thu, 3 Aug 2000 21:19:04 +0200
newbie vowes:
i am trying to run the tutorial example GCContent.java
using win 2k, jdk 1.3 and having a directory c:\biotest like this:
Directory of C:\biotest
03.08.2000 19:13 <DIR> .
03.08.2000 19:13 <DIR> ..
01.08.2000 08:42 536.372 biojava.jar
03.08.2000 18:09 356 ClassName.java
03.08.2000 18:09 279 filesystem.attributes
03.08.2000 18:10 1.267 GCContent.java
15.06.2000 14:53 145.710 xml.jar
5 File(s) 683.984 bytes
2 Dir(s) 407.945.216 bytes free
,
the command :
c:\jdk1.3\bin\javac.exe -classpath c:/biotest/biojava.jar;c:/biotest/xml.jar
c:/biotest/GCContent.java
results in the following errors:
----------------------------------------------------------------------------
-----------
----------------------------------------------------------------------------
-------
c:/biotest/GCContent.java:16: cannot resolve symbol
symbol : variable DNATools
location: class GCContent
Alphabet dna = DNATools.getDNA();
^
c:/biotest/GCContent.java:20: cannot resolve symbol
symbol : class SequenceFactory
location: class GCContent
SequenceFactory fact = new SimpleSequenceFactory();
^
c:/biotest/GCContent.java:20: cannot resolve symbol
symbol : class SimpleSequenceFactory
location: class GCContent
SequenceFactory fact = new SimpleSequenceFactory();
^
c:/biotest/GCContent.java:29: cannot resolve symbol
symbol : class Sequence
location: class GCContent
Sequence seq = stream.nextSequence();
^
c:/biotest/GCContent.java:33: cannot resolve symbol
symbol : variable DNATools
location: class GCContent
if (sym == DNATools.g() || sym == DNATools.c())
^
c:/biotest/GCContent.java:33: cannot resolve symbol
symbol : variable DNATools
location: class GCContent
if (sym == DNATools.g() || sym == DNATools.c())
^
6 errors
--------------------------------------------------
the source again:
_______________________________
import java.io.*;
import org.biojava.bio.symbol.*;
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];
// Set up stream reader
Alphabet dna = DNATools.getDNA();
SymbolParser dnaParser = dna.getParser("token");
BufferedReader br = new BufferedReader(
new FileReader(fileName));
SequenceFactory fact = new SimpleSequenceFactory();
StreamReader stream = new StreamReader(br,
new FastaFormat(),
dnaParser,
fact);
// 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()) +
"%");
}
}
}
--------------------------------------------------------
I would be grateful for any hints!
Thanxx Ralf
Ralf Sigmund