Skip to main content

A python script to convert large matrices stored as .h5 to .txt

Project description


It is pronounced 'kelvinny-pee'


Hi there! I've put together the following python script/package for some work stuff!


python 3.7

Installation instructions

# using pip
pip install kelvinnypy

# or using conda
conda install -c kt16 kelvinnypy

Main function (well, only function)


Together with another R function in zktuong/kelvinny (kelvinny::mtx_to_h5, or in a combined wrapper - kelvinny::mtx_to_h5totxt), this python script helps to parse large matrices in R to .h5 to .txt format. This packages are extremely light weight and should be relatively quick and easy to install and use. Have fun!


I've created this as an executable that you can use directly via the terminal/console

# bash
h5totxt counts.h5

# for help,
h5totxt -h

You can also download the file called and call it in terminal via python

# bash
python ./path/to/ counts.h5

Or use in R via reticulate

# R
# python
import kelvinnypy as kp
# or
kp.h5totxt("counts.h5", "new_counts.txt")


# R
kp <- import("kelvinnypy")

or even as a complete workflow with the the R function

# devtools::install_github('zktuong/kelvinny', dependencies = TRUE)
mat <- matrix(rexp(2e8, rate=.1), ncol=20000, dimnames = list(paste0("gene", 1:10000), paste0("cell", 1:20000)))
# [1] 10000 20000

# try this!
mtx_to_h5totxt(mat, "mat")

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for kelvinnypy, version 1.0.16
Filename, size File type Python version Upload date Hashes
Filename, size kelvinnypy-1.0.16-py3-none-any.whl (5.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size kelvinnypy-1.0.16.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page