library(rhdf5) # Read entire expression data matrix into memory; see rhdf5 documentation # for other ways to do this (e.g. selecting specific cells/genes, etc.) read.hdf5 = function(file_path, group_name) { data_raw = h5read(file_path, group_name) data_adj = data.frame(data_raw$block0_values) row.names(data_adj) = data_raw$axis0 names(data_adj) = data_raw$axis1 data_adj } rpkm = read.hdf5('path/to/expr_data.hdf5', '/rpkm') # Values are gene expression in RPKM print(dim(rpkm))