[Biojava-dev] SeqIOTools problems

Kalle Näslund kalle.naslund at genpat.uu.se
Tue Apr 8 17:37:15 EDT 2003


Hi/Hello/Hej/Hola!

Seems i have some problems with SeqIOTools. After my last CVS uppdate ( 
havent done one in quite a while i must admit ) i am having problems 
using SeqIOTools, i get exceptions thrown when using
what have previously been working code. The problems seems to be related
to some larger changes in the class. and deprecation of some parts of 
the api.( but as i understand the general convetion, deprecated methods 
should still work )

So, the problems i get are when i use the following two methods togheter.

int guessFileType(java.io.File seqFile )
java.lang.Object fileToBiojava(int fileType, java.io.BufferedReader br)


What happens is that the first method, tries to guess the fileformat of 
the file, it then returns an integer representing the fileformat it 
think it is ( currently only based on filename ending ). But, this 
method isnt aware of the changes to the fileformat numbering scheme, so 
the number returned cant be used in the fileToBiojava( int fileType, 
java.io.BufferedReader br ) method call.

the new fileformat numbering has some high bits set, to indicate what 
alphabet it is, and then the lower bits for the actual fileformat. but 
the guessFileType method doesnt know it has to set some high bits to 
indicate what alphabet to use, so the fileToBiojava method fails.

now, guessFileType has been deprecated, so i dont know what the correct 
way to do is, perhaps just kill it off completely and replace it with 
some smarter type of fileformat identifying code ? ( automatic 
fileformat identificaton might be tricky and error prone, but its 
something thats usefull from time to time ) or just fix it.

i would think that fixing it, and renaming it to something like 
guessFileTypeByFileEnding or so, to more clearly show its limitations 
would be the best thing to do.

And there should perhaps be some simple javadoc documentation on how to 
use the new fileformat numbering ? eg that you need to combine an 
alphabet withan fileformat, before feeding it to fileToBiojava ?

anyway, live long and prosper
Kalle



More information about the biojava-dev mailing list