Closed ShouWenWang closed 3 weeks ago
This is resolved.
In case others want the solution:
from scipy.sparse import load_npz
mtx = load_npz("data_dir/1.npz")
Careful, this matrix comes in a special format. It's a sparse matrix in CSR format that contains three possible values: 0, 1 and -1. 0 has to be interpreted as NA, 1 has to be interpreted as "methylated" and -1 has to be interpreted as "unmethylated". Due to the sparse matrix format, 0 (NA) values are not explicitly stored and only "appear" once you convert to a dense format. To understand this format, you can read about the CSR sparse matrix format on wikipedia or check our paper.
At some point we also figured out how to load it into R, once I find this code snippet I'll put it here.