Class PhredFormat

    • Method Detail

      • getLineWidth

        public int getLineWidth()
        Retrive the current line width.
        Returns:
        the line width
      • setLineWidth

        public void setLineWidth​(int width)
        Set the line width.

        When writing, the lines of sequence will never be longer than the line width.

        Parameters:
        width - the new line width
      • describeSequence

        protected String describeSequence​(Sequence seq)
        Return a suitable description line for a Sequence. If the sequence's annotation bundle contains PROPERTY_DESCRIPTIONLINE, this is used verbatim. Otherwise, the sequence's name is used.
      • writeSequence

        public void writeSequence​(Sequence seq,
                                  PrintStream os)
                           throws IOException
        This method will print symbols to the line width followed by a new line etc. NOTE that an integer symbol does not always correspond to one character therefore a line width of sixty will print sixty characters followed by a new line. Not necessarily sixty integers.
        Specified by:
        writeSequence in interface SequenceFormat
        Parameters:
        seq - the sequence to write out.
        os - the printstream to write to.
        Throws:
        IOException
      • writeSequence

        public void writeSequence​(Sequence seq,
                                  String format,
                                  PrintStream os)
                           throws IOException
        Deprecated.
        use writeSequence(Sequence seq, PrintStream os)
        writeSequence writes a sequence to the specified PrintStream, using the specified format.
        Specified by:
        writeSequence in interface SequenceFormat
        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:
        IOException - if an error occurs.
      • BadLineParsed

        public void BadLineParsed​(ParseErrorEvent theEvent)
        This method determines the behaviour when a bad line is processed. Some options are to log the error, throw an exception, ignore it completely, or pass the event through.

        This method should be overwritten when different behavior is desired.

        Specified by:
        BadLineParsed in interface ParseErrorListener
        Parameters:
        theEvent - The event that contains the bad line and token.
      • notifyParseErrorEvent

        protected void notifyParseErrorEvent​(ParseErrorEvent theEvent)
        Passes the event on to all the listeners registered for ParseErrorEvents.
        Parameters:
        theEvent - The event to be handed to the listeners.