Interface SequenceFormat

    • Method Detail

      • readSequence

        boolean readSequence​(java.io.BufferedReader reader,
                             SymbolTokenization symParser,
                             SeqIOListener listener)
                      throws BioException,
                             IllegalSymbolException,
                             java.io.IOException
        Read a sequence and pass data on to a SeqIOListener.
        Parameters:
        reader - The stream of data to parse.
        symParser - A SymbolParser defining a mapping from character data to Symbols.
        listener - A listener to notify when data is extracted from the stream.
        Returns:
        a boolean indicating whether or not the stream contains any more sequences.
        Throws:
        java.io.IOException - if an error occurs while reading from the stream.
        IllegalSymbolException - if it is not possible to translate character data from the stream into valid BioJava symbols.
        BioException - if there is an error in the format of the stream.
      • writeSequence

        void writeSequence​(Sequence seq,
                           java.io.PrintStream os)
                    throws java.io.IOException
        writeSequence writes a sequence to the specified PrintStream, using the default format.
        Parameters:
        seq - the sequence to write out.
        os - the printstream to write to.
        Throws:
        java.io.IOException
      • writeSequence

        void writeSequence​(Sequence seq,
                           java.lang.String format,
                           java.io.PrintStream os)
                    throws java.io.IOException
        Deprecated.
        use writeSequence(Sequence seq, PrintStream os)
        writeSequence writes a sequence to the specified PrintStream, using the specified format.
        Parameters:
        seq - a Sequence to write out.
        format - a String indicating which sub-format of those available from a particular SequenceFormat implemention to use when writing.
        os - a PrintStream object.
        Throws:
        java.io.IOException - if an error occurs.
      • getDefaultFormat

        java.lang.String getDefaultFormat()
        Deprecated.
        new implementations should only write a single format.
        getDefaultFormat returns the String identifier for the default sub-format written by a SequenceFormat implementation.
        Returns:
        a String.