A python script to convert large matrices stored as .h5 to .txt
It is pronounced 'kelvinny-pee'
Hi there! I've put together the following python script/package for some work stuff!
# 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 h5convert.py and call it in terminal via python
# bash python ./path/to/kelvinnypy.py counts.h5
Or use in R via reticulate
# R reticulate::repl_python()
# python import kelvinnypy as kp kp.h5totxt("counts.h5") # or kp.h5totxt("counts.h5", "new_counts.txt")
# R library(reticulate) kp <- import("kelvinnypy") kp$h5totxt("counts.h5")
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))) dim(mat) #  10000 20000 # try this! mtx_to_h5totxt(mat, "mat")
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|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 hashes|
|Filename, size kelvinnypy-1.0.16.tar.gz (2.7 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for kelvinnypy-1.0.16-py3-none-any.whl