Class MexMatrixWriter
- java.lang.Object
-
- ubic.gemma.core.datastructure.matrix.io.MexMatrixWriter
-
- All Implemented Interfaces:
ExpressionDataMatrixWriter
,SingleCellExpressionDataMatrixWriter
public class MexMatrixWriter extends Object implements SingleCellExpressionDataMatrixWriter
WritesSingleCellExpressionDataMatrix
to the 10x MEX format.The data is written as a TAR archive containing the following entries for each bioassay:
{bioAssayName}/barcodes.tsv
,{bioAssayName}/features.tsv
,{bioAssayName}/matrix.mtx
. If using the directory output, individual files are compressed and will have a.gz
extension.- Author:
- poirigui
-
-
Constructor Summary
Constructors Constructor Description MexMatrixWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
write(Stream<SingleCellExpressionDataVector> vectors, int numVecs, Map<BioAssay,Long> nnzBySample, Map<CompositeSequence,Set<Gene>> cs2gene, Path outputDir)
Writes a stream of vectors to a directory.int
write(SingleCellExpressionDataMatrix<?> matrix, OutputStream stream)
int
write(SingleCellExpressionDataMatrix<?> matrix, Writer stream)
int
write(SingleCellExpressionDataMatrix<?> matrix, Map<CompositeSequence,Set<Gene>> cs2gene, OutputStream stream)
Write a MEX matrix as a TAR archive to the given output stream.int
write(SingleCellExpressionDataMatrix<?> matrix, Map<CompositeSequence,Set<Gene>> cs2gene, Path outputDir)
Write a matrix to a directory.-
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.ExpressionDataMatrixWriter
setScaleType
-
Methods inherited from interface ubic.gemma.core.datastructure.matrix.io.SingleCellExpressionDataMatrixWriter
write, write
-
-
-
-
Method Detail
-
write
public int write(SingleCellExpressionDataMatrix<?> matrix, Writer stream) throws IOException
- Specified by:
write
in interfaceSingleCellExpressionDataMatrixWriter
- Throws:
IOException
-
write
public int write(SingleCellExpressionDataMatrix<?> matrix, OutputStream stream) throws IOException
- Specified by:
write
in interfaceSingleCellExpressionDataMatrixWriter
- Throws:
IOException
-
write
public int write(SingleCellExpressionDataMatrix<?> matrix, @Nullable Map<CompositeSequence,Set<Gene>> cs2gene, OutputStream stream) throws IOException
Write a MEX matrix as a TAR archive to the given output stream.- Throws:
IOException
-
write
public int write(SingleCellExpressionDataMatrix<?> matrix, @Nullable Map<CompositeSequence,Set<Gene>> cs2gene, Path outputDir) throws IOException
Write a matrix to a directory.- Throws:
IOException
-
write
public int write(Stream<SingleCellExpressionDataVector> vectors, int numVecs, Map<BioAssay,Long> nnzBySample, @Nullable Map<CompositeSequence,Set<Gene>> cs2gene, Path outputDir) throws IOException
Writes a stream of vectors to a directory.- Parameters:
vectors
- a stream of vectorsnumVecs
- the total number of vectors to writennzBySample
- the number of non-zeroes by samplecs2gene
- a mapping of design elements to their corresponding gene(s)- Throws:
IOException
-
-