public final class HDF5Utils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHUNK_INDEX_PATH_SUFFIX |
static java.lang.String |
INTERVAL_CONTIG_NAMES_SUB_PATH |
static java.lang.String |
INTERVAL_MATRIX_SUB_PATH |
static int |
MAX_NUMBER_OF_VALUES_PER_HDF5_MATRIX |
static java.lang.String |
NUMBER_OF_CHUNKS_SUB_PATH |
static java.lang.String |
NUMBER_OF_COLUMNS_SUB_PATH |
static java.lang.String |
NUMBER_OF_ROWS_SUB_PATH |
Modifier and Type | Method and Description |
---|---|
static double[][] |
readChunkedDoubleMatrix(org.broadinstitute.hdf5.HDF5File file,
java.lang.String path)
Reads a large matrix stored as a set of chunks (submatrices) using the sub-paths and conventions
used by
writeChunkedDoubleMatrix(org.broadinstitute.hdf5.HDF5File, java.lang.String, double[][], int) . |
static java.util.List<SimpleInterval> |
readIntervals(org.broadinstitute.hdf5.HDF5File file,
java.lang.String path)
Reads a list of intervals from an HDF5 file using the sub-paths and conventions used by
writeIntervals(org.broadinstitute.hdf5.HDF5File, java.lang.String, java.util.List<T>) . |
static void |
writeChunkedDoubleMatrix(org.broadinstitute.hdf5.HDF5File file,
java.lang.String path,
double[][] matrix,
int maxChunkSize)
Given a large matrix, chunks the matrix into equally sized subsets of rows
(plus a subset containing the remainder, if necessary) and writes these submatrices to indexed sub-paths
to avoid a hard limit in Java HDF5 on the number of elements in a matrix given by
MAX_NUM_VALUES_PER_HDF5_MATRIX . |
static <T extends SimpleInterval> |
writeIntervals(org.broadinstitute.hdf5.HDF5File file,
java.lang.String path,
java.util.List<T> intervals)
Given an HDF5 file and an HDF5 path, writes a list of intervals to hard-coded sub-paths.
|
public static final java.lang.String INTERVAL_CONTIG_NAMES_SUB_PATH
public static final java.lang.String INTERVAL_MATRIX_SUB_PATH
public static final int MAX_NUMBER_OF_VALUES_PER_HDF5_MATRIX
public static final java.lang.String NUMBER_OF_ROWS_SUB_PATH
public static final java.lang.String NUMBER_OF_COLUMNS_SUB_PATH
public static final java.lang.String NUMBER_OF_CHUNKS_SUB_PATH
public static final java.lang.String CHUNK_INDEX_PATH_SUFFIX
public static java.util.List<SimpleInterval> readIntervals(org.broadinstitute.hdf5.HDF5File file, java.lang.String path)
writeIntervals(org.broadinstitute.hdf5.HDF5File, java.lang.String, java.util.List<T>)
.public static <T extends SimpleInterval> void writeIntervals(org.broadinstitute.hdf5.HDF5File file, java.lang.String path, java.util.List<T> intervals)
public static double[][] readChunkedDoubleMatrix(org.broadinstitute.hdf5.HDF5File file, java.lang.String path)
writeChunkedDoubleMatrix(org.broadinstitute.hdf5.HDF5File, java.lang.String, double[][], int)
.public static void writeChunkedDoubleMatrix(org.broadinstitute.hdf5.HDF5File file, java.lang.String path, double[][] matrix, int maxChunkSize)
MAX_NUM_VALUES_PER_HDF5_MATRIX
. The number of chunks is determined by maxChunkSize
,
which should be set appropriately for the desired number of columns.maxChunkSize
- The maximum number of values in each chunk. Decreasing this number will reduce
heap usage when writing chunks, which requires subarrays to be copied.
However, since a single row is not allowed to be split across multiple chunks,
the number of columns must be less than the maximum number of values in each chunk.