Class JsonMatrixWriter
java.lang.Object
ubic.gemma.core.datastructure.matrix.io.JsonMatrixWriter
- All Implemented Interfaces:
BulkExpressionDataMatrixWriter,ExpressionDataMatrixWriter<BulkExpressionDataMatrix<?>,BulkExpressionDataVector>
Writes a
BulkExpressionDataMatrix to a JSON format.- Author:
- paul
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAutoFlush(boolean autoFlush) Flush every time a complete line is written.voidsetScaleType(ScaleType scaleType) Set the scale type to use when writing the matrix.intwrite(BulkExpressionDataMatrix<?> matrix, Class<? extends BulkExpressionDataVector> vectorType, Writer writer) Write the matrix to the given writer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ubic.gemma.core.datastructure.matrix.io.ExpressionDataMatrixWriter
write
-
Constructor Details
-
JsonMatrixWriter
public JsonMatrixWriter()
-
-
Method Details
-
setAutoFlush
public void setAutoFlush(boolean autoFlush) Description copied from interface:ExpressionDataMatrixWriterFlush 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.
- Specified by:
setAutoFlushin interfaceExpressionDataMatrixWriter<BulkExpressionDataMatrix<?>,BulkExpressionDataVector>
-
setScaleType
Description copied from interface:ExpressionDataMatrixWriterSet the scale type to use when writing the matrix.When null, the original values must be used.
- Specified by:
setScaleTypein interfaceExpressionDataMatrixWriter<BulkExpressionDataMatrix<?>,BulkExpressionDataVector>
-
write
public int write(BulkExpressionDataMatrix<?> matrix, Class<? extends BulkExpressionDataVector> vectorType, Writer writer) throws IOException, UnsupportedOperationException Description copied from interface:ExpressionDataMatrixWriterWrite the matrix to the given writer.- Specified by:
writein interfaceExpressionDataMatrixWriter<BulkExpressionDataMatrix<?>,BulkExpressionDataVector> - Parameters:
vectorType- the type of vectors to write. This helps the writer determine how theQuantitationTypeof 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
-