Interface ExpressionDataMatrixWriter<T extends ExpressionDataMatrix<?>,VT extends DataVector>

All Known Subinterfaces:
BulkExpressionDataMatrixWriter, SingleCellExpressionDataMatrixWriter
All Known Implementing Classes:
CellBrowserTabularMatrixWriter, JsonMatrixWriter, MatrixWriter, MexMatrixWriter, TabularMatrixWriter

public interface ExpressionDataMatrixWriter<T extends ExpressionDataMatrix<?>,VT extends DataVector>
Base interface for writing ExpressionDataMatrix.
Author:
poirigui
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setAutoFlush(boolean autoFlush)
    Flush every time a complete line is written.
    void
    Set the scale type to use when writing the matrix.
    default int
    write(T matrix, Class<? extends VT> vectorType, OutputStream stream)
    Write the matrix to the given output stream.
    int
    write(T matrix, Class<? extends VT> vectorType, Writer writer)
    Write the matrix to the given writer.
  • Method Details

    • setAutoFlush

      void setAutoFlush(boolean autoFlush)
      Flush every time a complete line is written.

      This is not very efficient, but it can be used to view the output of a matrix as it is being written.

    • setScaleType

      void setScaleType(@Nullable ScaleType scaleType)
      Set the scale type to use when writing the matrix.

      When null, the original values must be used.

    • write

      int write(T matrix, Class<? extends VT> vectorType, Writer writer) throws IOException, UnsupportedOperationException
      Write the matrix to the given writer.
      Parameters:
      vectorType - the type of vectors to write. This helps the writer determine how the QuantitationType of the matrix should be interpreted.
      Returns:
      the number of vectors written
      Throws:
      UnsupportedOperationException - if the matrix cannot be written to a text output (i.e. if this is a binary format).
      IOException
    • write

      default int write(T matrix, Class<? extends VT> vectorType, OutputStream stream) throws IOException
      Write the matrix to the given output stream.
      Returns:
      the number of vectors written
      Throws:
      IOException