[Biojava-l] beginners bug fileToBiojava problem with msf format
Dan Bolser
dmb at mrc-dunn.cam.ac.uk
Wed Feb 4 09:43:02 EST 2004
I forgot the (probably) important
import java.io.*;
import java.util.*;
import org.biojava.bio.*;
import org.biojava.bio.dist.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.seq.io.*;
import org.biojava.bio.symbol.*;
On Wed, 4 Feb 2004, Dan Bolser wrote:
>
> 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...
>
>
> _______________________________________________
> Biojava-l mailing list - Biojava-l at biojava.org
> http://biojava.org/mailman/listinfo/biojava-l
>
More information about the Biojava-l
mailing list