There are cases where we would like to re-order the LD matrix by shuffling its rows and columns to align with some external requirements. This task is challenging to implement, because it will likely mess up with the LD boundaries and affect the sparsity structure of the original matrix.
As a starting point, we can limit ourselves to solutions that do not necessarily re-order the matrix itself, but affect the order in which we iterate over its rows/columns. This may require that instead of storing LD boundaries (start and end point for each row), we can store the indices of all neighboring SNPs whose LD is non-zero. This is similar to the sparse matrix formats implemented by scipy and other libraries.
Will keep this issue open to explore various ideas for how we can go about implementing this.
There are cases where we would like to re-order the LD matrix by shuffling its rows and columns to align with some external requirements. This task is challenging to implement, because it will likely mess up with the LD boundaries and affect the sparsity structure of the original matrix.
As a starting point, we can limit ourselves to solutions that do not necessarily re-order the matrix itself, but affect the order in which we iterate over its rows/columns. This may require that instead of storing LD boundaries (start and end point for each row), we can store the indices of all neighboring SNPs whose LD is non-zero. This is similar to the sparse matrix formats implemented by scipy and other libraries.
Will keep this issue open to explore various ideas for how we can go about implementing this.