shz9 / magenpy

Modeling and Analysis of (Statistical) Genetics data in python
https://shz9.github.io/magenpy/
MIT License
16 stars 5 forks source link

Make LD matrices triangular #5

Closed shz9 closed 5 months ago

shz9 commented 2 years ago

Currently, the interfaces for calculating and handling LD matrices stored in Zarr arrays assume that the matrices are square. This can be very expensive for extremely large matrices, when we scale to hundreds of thousands to millions of SNPs. As a way to reduce storage requirements, we can store only the upper triangular part of the matrix and reconstruct the lower triangular part on the fly when processing the data (perhaps with the help of scipy's csr_matrix?).

shz9 commented 5 months ago

Done in 0.1 release.