Your question is unclear. If you want to store the matrix in a sparse format, that would be the one without any zeros. I am assuming that you already have a matrix in sparse (MatrixMarket) format, but want to convert it into dense format. You can clear this up by showing us the first line of your file:
head -1 matrix.mtx
You matrix is already sparse if the screen output is something like this:
%%MatrixMarket matrix coordinate integer general
If so, this thread explains the conversion. If you actually have a dense matrix (with lots of zeros) and want to convert it into sparse format, this thread will show you how. If needed, I have a custom python script for the
dense -> sparse task as well.
Hi, if using R, DropletUtils is what you need: https://www.bioconductor.org/packages/release/bioc/html/DropletUtils.html