matrix2h5: Write Matrix to HDF5 file

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Function writes matrix object to an HDF5 file.

Usage

1
matrix2h5(matrix, h5file, name = "assay", overwrite = TRUE)

Arguments

matrix

matrix to be written to HDF5 file, row and column name slots need to be populated

h5file

character(1), path to the hdf5 destination file

name

The name of the dataset in the HDF5 file. The default is write the score matrix (e.g. z-score, logFC) to the 'assay' dataset, users could also write the adjusted p-value or FDR matrix to the 'padj' dataset by setting the name as 'padj'.

overwrite

TRUE or FALSE, whether to overwrite or append matrix to an existing 'h5file'

Value

HDF5 file containing exported matrix

Examples

1
2
3
4
mat <- matrix(rnorm(12), nrow=3, dimnames=list(
              paste0("r",1:3), paste0("c",1:4)))
h5file <- tempfile(fileext=".h5")
matrix2h5(matrix=mat, h5file=h5file, overwrite=TRUE)

signatureSearch documentation built on April 16, 2021, 6 p.m.