[Biojava-l] beginners bug fileToBiojava problem with msf format

Keith James kdj at sanger.ac.uk
Wed Feb 4 11:10:16 EST 2004

>>>>> "Dan" == Dan Bolser <dmb at mrc-dunn.cam.ac.uk> writes:


    Dan> Just for the record, I see two forms of the fileToBiojava
    Dan> function...

    Dan> fileToBiojava( int fileType, java.io.BufferedReader br );
    Dan> fileToBiojava( java.lang.String formatName, java.lang.String
    Dan> alphabetName, java.io.BufferedReader br );

Yep. One tries to guess the format from the strings passed as
arguments (e.g. you can use both 'protein' or 'aa' for the protein
alphabet) and then reads the file. Internally all it does is to call
the other method with the correct integer argument.

The methods in any class called FooTools or BarTools in biojava are
convenience methods, often built from other lower level API in

    Dan> I was using the second form which sould not have to guess the
    Dan> format (perhaps I misunderstand what you said
    Dan> above). Aditionaly, I explicitly pass an alphabet name... Why
    Dan> are formats linked to alphabets? "...  SeqIOConstants.UNKNOWN
    Dan> as the format identifier (which has no alphabet set...".

It's fine to use either. Formats are not linked to alphabets per
se. It is just convenient to have both pieces of information stored in
a single value (and int) for reading files. There are lots of possible
alphabets and file formats so it's handy to be able to calculate
identifiers for all possible current (and future) combinations.



- Keith James <kdj at sanger.ac.uk> Microarray Facility, Team 65 -
- The Wellcome Trust Sanger Institute, Hinxton, Cambridge, UK -

More information about the Biojava-l mailing list