• Post Reply Bookmark Topic Watch Topic
  • New Topic

illegal character: \154  RSS feed

 
Gera Jellema
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
as with a lot of people I'm new to this programming. I try to run the next program I got from someone. But from the second "/**" I get "illegal character: \154" with almost every line, and sometimes even 4 or 5 of such errors. In total I get 100 of the same errors

import java.io.*;
import org.biojava.bio.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.seq.io.*;
import org.biojava.bio.symbol.*;
/**
�* <p>Program to six-frame translate a nucleotide sequence</p>
�*/
public class Hex {
� /**
�� * Call this to get usage info, program terminates after call.
�� */
� public static void help() {
��� System.out.println(
������� "usage: java utils.Hex <file> <format eg fasta> <dna|rna>");
��� System.exit( -1);
� }
� public static void main(String[] args) throws Exception{
��� if (args.length != 3) {
����� help();
��� }
��� BufferedReader br = null;
��� String format = args[1];
��� String alpha = args[2];
��� try {
����� br = new BufferedReader(new FileReader(args[0]));
����� SequenceIterator seqi =
��������� (SequenceIterator)SeqIOTools.fileToBiojava(format, alpha, br);
����� //for each sequence
����� while(seqi.hasNext()){
������� Sequence seq = seqi.nextSequence();
������� //for each frame
������� for (int i = 0; i < 3; i++) {
��������� SymbolList prot;
��������� Sequence trans;
��������� //take the reading frame
��������� SymbolList syms = seq.subList(
��������������� i+1,
��������������� seq.length() - (seq.length() - i)%3);

��������� //if it is DNA transcribe it to RNA
��������� if(syms.getAlphabet() == DNATools.getDNA()){
����������� syms = RNATools.transcribe(syms);
��������� }
��������� //output forward translation to STDOUT
��������� prot = RNATools.translate(syms);
��������� trans = SequenceTools.createSequence(prot, "",�seq.getName()+�"TranslationFrame: +"+i, Annotation.EMPTY_ANNOTATION);
��������� SeqIOTools.writeFasta(System.out, trans);
��������� //output reverse frame translation to STDOUT
��������� syms = RNATools.reverseComplement(syms);
��������� prot = RNATools.translate(syms);
��������� trans = SequenceTools.createSequence(prot, "", seq.getName() + "TranslationFrame: -" + i, Annotation.EMPTY_ANNOTATION);
��������� SeqIOTools.writeFasta(System.out, trans);
������� }
����� }
��� }
��� finally {
����� if(br != null){
������� br.close();
����� }
��� }
� }
}
These are just a few of these errors:
Hex.java:13: illegal character: \154
/**
^
Hex.java:16: illegal character: \154
public static void help() {
^
Hex.java:17: illegal character: \154
System.out.println(
^
Hex.java:17: illegal character: \154
System.out.println(
^
Hex.java:17: illegal character: \154
System.out.println(
^
Hex.java:18: illegal character: \154
"usage: java utils.Hex <file> <format eg fasta> <dna|rna>");
^
Hex.java:18: illegal character: \154
"usage: java utils.Hex <file> <format eg fasta> <dna|rna>");
^
Hex.java:18: illegal character: \154
"usage: java utils.Hex <file> <format eg fasta> <dna|rna>");
^
Thanks a lot
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gera,
You code looks ok to me. \154 comes out as a U on my Textpad.
Posting your code on this page has filtered these characters out.
What are you using to edit your program? I would use notepad or textpad (or even dos edit when I am desparate). Most other word processors will add formatting special characters (unless you save in text only format) that will not be correctly interpreted by the compiler.
Ed
[ March 08, 2004: Message edited by: Eddie Vanda ]
 
Gera Jellema
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm using kwrite because I'm working on a linux computer, so I think that should be ok.
Gera
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!