edu.mssm.crover.imports
Interface SequenceReaderFactory

All Known Implementing Classes:
SequenceReaderFactoryImpl

public interface SequenceReaderFactory

Gives access to specialized Sequence readers. This interface allows to read sequences from an InputStream.


Method Summary
 ReaderType[] getSupportedTypes()
          Returns the ReaderTypes supported by this factory implementation.
 ReaderType guessReaderType(String filename)
          Return a ReaderType supported by this factory that is guessed to be able to handle a file named filename.
 AnnotatedBioSequence[] readSequences(InputStream seqstream, ReaderType type)
           
 

Method Detail

getSupportedTypes

ReaderType[] getSupportedTypes()
Returns the ReaderTypes supported by this factory implementation. The calls to readSequences should use one of the type returned by this method or the UnregisteredReaderTypeException is likely to be raised.


readSequences

AnnotatedBioSequence[] readSequences(InputStream seqstream,
                                     ReaderType type)
                                     throws UnregisteredReaderTypeException,
                                            UnsupportedFileFormatException,
                                            SyntaxErrorException
Throws:
UnregisteredReaderTypeException
UnsupportedFileFormatException
SyntaxErrorException

guessReaderType

ReaderType guessReaderType(String filename)
Return a ReaderType supported by this factory that is guessed to be able to handle a file named filename. Only the filename is used to guess: we are relying on the common pratice to name files with an extension that is indicative of the file format. There is no garantee of course that the guess will be correct, ie that the SequenceReader associated with the ReaderType will correctly parse the InputStream sent to it latter. Also, the application can override the guess (to leave to the user the final word) and provide readSequences() with another supported ReaderType.
The default readerType returned (when no sensible match can be determined) is left to the discretion of the implementation.



Copyright © 2004 Weill Cornell Medical College. All Rights Reserved.