Class FastaWriter<S extends Sequence<?>,​C extends Compound>


  • public class FastaWriter<S extends Sequence<?>,​C extends Compound>
    extends java.lang.Object
    The FastaWriter writes a collection of sequences to an outputStream. FastaWriterHelper should be used to write out sequences. Each sequence loaded from a fasta file retains the original Fasta header and that is used when writing to the stream. This behavior can be overwritten by implementing a custom FastaHeaderFormatInterface.
    Author:
    Scooter Willis
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getLineLength()  
      static void main​(java.lang.String[] args)  
      void process()  
      void setLineLength​(int lineLength)  
      void setLineSeparator​(java.lang.String lineSeparator)
      Allow an override of operating system line separator for programs that needs a specific CRLF or CR or LF option
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FastaWriter

        public FastaWriter​(java.io.OutputStream os,
                           java.util.Collection<S> sequences,
                           FastaHeaderFormatInterface<S,​C> headerFormat)
        Use default line length of 60
        Parameters:
        os -
        sequences -
        headerFormat -
      • FastaWriter

        public FastaWriter​(java.io.OutputStream os,
                           java.util.Collection<S> sequences,
                           FastaHeaderFormatInterface<S,​C> headerFormat,
                           int lineLength)
        Set custom lineLength
        Parameters:
        os -
        sequences -
        headerFormat -
        lineLength -
    • Method Detail

      • setLineSeparator

        public void setLineSeparator​(java.lang.String lineSeparator)
        Allow an override of operating system line separator for programs that needs a specific CRLF or CR or LF option
        Parameters:
        lineSeparator -
      • process

        public void process()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)
      • getLineLength

        public int getLineLength()
        Returns:
        the lineLength
      • setLineLength

        public void setLineLength​(int lineLength)
        Parameters:
        lineLength - the lineLength to set