[Biojava-l] beginners bug fileToBiojava problem with msf format
Dan Bolser
dmb at mrc-dunn.cam.ac.uk
Wed Feb 4 08:18:31 EST 2004
Hello, I am a new user to biojava (and almost new to java).
The following code works fine reading a 'FASTA' format file,
but causes an error reading 'MSF' format...
-----
String file = args[0];
String format = args[1];
String alphabet = args[2];
BufferedReader br = new BufferedReader(new FileReader(file));
SequenceIterator seqi = null;
Alignment align = null;
if ( format != "MSF" && format != "msf" ){
seqi =
(SequenceIterator)SeqIOTools.fileToBiojava( format, alphabet, br );
}
else{
align =
(Alignment)SeqIOTools.fileToBiojava( format, alphabet, br );
}
----
Error...
---
Exception in thread "main" java.lang.IllegalArgumentException: No alphabet
was set in the identifier
at
org.biojava.bio.seq.io.SeqIOTools.fileToBiojava(SeqIOTools.java:801)
at
org.biojava.bio.seq.io.SeqIOTools.fileToBiojava(SeqIOTools.java:787)
at
ReadAlignMakeDistribution.main(ReadAlignMakeDistribution.java:60)
---
Line 60 corresponds to the "align = ..." line above.
Like I said, works fine as...
java prog.java fa.fasta fasta PROTEIN
but
java prog.java msf.msf msf PROTEIN
Gives above error... Just as I thought I was begining to understand :.(
I will look at details for Alignment objects...
More information about the Biojava-l
mailing list