Class MatrixWriter
- java.lang.Object
-
- ubic.gemma.core.analysis.service.AbstractFileService<ExpressionDataMatrix<?>>
-
- ubic.gemma.core.datastructure.matrix.MatrixWriter
-
- All Implemented Interfaces:
FileService<ExpressionDataMatrix<?>>
,JsonFileService<ExpressionDataMatrix<?>>
,TsvFileService<ExpressionDataMatrix<?>>
@ParametersAreNonnullByDefault public class MatrixWriter extends AbstractFileService<ExpressionDataMatrix<?>>
- Author:
- pavlidis
-
-
Constructor Summary
Constructors Constructor Description MatrixWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
write(Writer writer, ExpressionDataMatrix<?> matrix, Map<CompositeSequence,Collection<Gene>> geneAnnotations, boolean writeHeader, boolean orderByDesign)
void
write(Writer writer, ExpressionDataMatrix<?> matrix, Map<CompositeSequence,Collection<Gene>> geneAnnotations, boolean writeHeader, boolean writeSequence, boolean writeGeneInfo, boolean orderByDesign)
void
writeJSON(Writer writer, ExpressionDataMatrix<?> matrix)
void
writeTsv(ExpressionDataMatrix<?> entity, Writer writer)
Write the given entity to tabular format.void
writeWithStringifiedGeneAnnotations(Writer writer, ExpressionDataMatrix<?> matrix, Map<CompositeSequence,String[]> geneAnnotations, boolean writeHeader)
Alternate method that uses annotations in string form (e.g., read from another file).void
writeWithStringifiedGeneAnnotations(Writer writer, ExpressionDataMatrix<?> matrix, Map<CompositeSequence,String[]> geneAnnotations, boolean writeHeader, boolean writeSequence, boolean writeGeneInfo, boolean orderByDesign)
-
Methods inherited from class ubic.gemma.core.analysis.service.AbstractFileService
escapeTsv, format, getSubDelimiter, getTsvFormatBuilder, write, write, writeJson
-
-
-
-
Method Detail
-
write
public void write(Writer writer, ExpressionDataMatrix<?> matrix, @Nullable Map<CompositeSequence,Collection<Gene>> geneAnnotations, boolean writeHeader, boolean orderByDesign) throws IOException
- Throws:
IOException
-
writeWithStringifiedGeneAnnotations
public void writeWithStringifiedGeneAnnotations(Writer writer, ExpressionDataMatrix<?> matrix, Map<CompositeSequence,String[]> geneAnnotations, boolean writeHeader) 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 writewriteHeader
- the writer headerwriter
- the writer to use- Throws:
IOException
- when the write failed- See Also:
ArrayDesignAnnotationServiceImpl.readAnnotationFileAsString(ArrayDesign)
-
writeWithStringifiedGeneAnnotations
public void writeWithStringifiedGeneAnnotations(Writer writer, ExpressionDataMatrix<?> matrix, @Nullable Map<CompositeSequence,String[]> geneAnnotations, boolean writeHeader, boolean writeSequence, boolean writeGeneInfo, boolean orderByDesign) throws IOException
- 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.writeHeader
- the writer headermatrix
- the matrixorderByDesign
- if true, the columns are in the order defined by ExpressionDataMatrixColumnSort.orderByExperimentalDesignwriteGeneInfo
- whether to write gene infowriter
- the writer to usewriteSequence
- whether to write sequence- Throws:
IOException
- when the write failed
-
write
public void write(Writer writer, ExpressionDataMatrix<?> matrix, @Nullable Map<CompositeSequence,Collection<Gene>> geneAnnotations, boolean writeHeader, boolean writeSequence, boolean writeGeneInfo, boolean orderByDesign) throws IOException
- Parameters:
orderByDesign
- if true, the columns are in the order defined by ExpressionDataMatrixColumnSort.orderByExperimentalDesignwriteSequence
- whether to write sequencewriter
- the writer to usewriteGeneInfo
- whether to write gene infomatrix
- the matrixwriteHeader
- the writer headergeneAnnotations
- 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
-
writeJSON
public void writeJSON(Writer writer, ExpressionDataMatrix<?> matrix) throws IOException
- Throws:
IOException
-
writeTsv
public void writeTsv(ExpressionDataMatrix<?> entity, Writer writer) throws IOException
Description copied from interface:TsvFileService
Write the given entity to tabular format.- Throws:
IOException
-
-