Class MatrixWriter
- java.lang.Object
-
- ubic.gemma.core.datastructure.matrix.io.MatrixWriter
-
- All Implemented Interfaces:
BulkExpressionDataMatrixWriter
,ExpressionDataMatrixWriter
@ParametersAreNonnullByDefault public class MatrixWriter extends Object implements BulkExpressionDataMatrixWriter
WritesBulkExpressionDataMatrix
to various tabular formats.- Author:
- pavlidis
-
-
Constructor Summary
Constructors Constructor Description MatrixWriter(EntityUrlBuilder entityUrlBuilder, BuildInfo buildInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setAutoFlush(boolean autoFlush)
Flush every time a complete line is written.void
setScaleType(ScaleType scaleType)
Set the scale type to use when writing the matrix.int
write(BulkExpressionDataMatrix<?> matrix, Writer writer)
int
write(BulkExpressionDataMatrix<?> matrix, Map<CompositeSequence,Collection<Gene>> geneAnnotations, Writer writer)
int
writeJSON(Writer writer, BulkExpressionDataMatrix<?> matrix)
int
writeWithStringifiedGeneAnnotations(Writer writer, BulkExpressionDataMatrix<?> matrix, Map<CompositeSequence,String[]> geneAnnotations)
Alternate method that uses annotations in string form (e.g., read from another file).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.core.datastructure.matrix.io.BulkExpressionDataMatrixWriter
write, write, write
-
-
-
-
Constructor Detail
-
MatrixWriter
public MatrixWriter(EntityUrlBuilder entityUrlBuilder, BuildInfo buildInfo)
-
-
Method Detail
-
setAutoFlush
public void setAutoFlush(boolean autoFlush)
Flush every time a complete line is written.This is only applicable to the tabular output.
-
setScaleType
public void setScaleType(@Nullable ScaleType scaleType)
Description copied from interface:ExpressionDataMatrixWriter
Set the scale type to use when writing the matrix.When null, the original values must be used.
- Specified by:
setScaleType
in interfaceExpressionDataMatrixWriter
-
write
public int write(BulkExpressionDataMatrix<?> matrix, Writer writer) throws IOException
- Specified by:
write
in interfaceBulkExpressionDataMatrixWriter
- Throws:
IOException
-
write
public int write(BulkExpressionDataMatrix<?> matrix, @Nullable Map<CompositeSequence,Collection<Gene>> geneAnnotations, Writer writer) throws IOException
- Parameters:
writer
- the writer to usematrix
- the matrixgeneAnnotations
- Map of composite sequences to an array of delimited strings: [probe name,genes symbol, gene Name] -- these include the "|" to indicate multiple genes, and originate in the platform annotation files.- Throws:
IOException
- when the write failed
-
writeWithStringifiedGeneAnnotations
public int writeWithStringifiedGeneAnnotations(Writer writer, BulkExpressionDataMatrix<?> matrix, @Nullable Map<CompositeSequence,String[]> geneAnnotations) throws IOException
Alternate method that uses annotations in string form (e.g., read from another file).- Parameters:
geneAnnotations
- Map of composite sequences to an array of delimited strings: [probe name,genes symbol, gene Name] -- these include the "|" to indicate multiple genes, and originate in the platform annotation files.matrix
- the matrix to writewriter
- the writer to use- Throws:
IOException
- when the write failed- See Also:
ArrayDesignAnnotationServiceImpl.readAnnotationFile(ArrayDesign)
-
writeJSON
public int writeJSON(Writer writer, BulkExpressionDataMatrix<?> matrix) throws IOException
- Throws:
IOException
-
-