question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace `inverse_additive_relationships` with `pedigree_inverse_relationship`

See original GitHub issue

Similar to #895, depends on #891

The inverse additive relationship matrix (ARM) is a sparse matrix which shouldn’t require the full (dense) kinship matrix to be calculated in advance. The inverse ARM can be calculated from the same subset of parental kinships used to calculate the inbreeding coefficient in #891 and this should result in a similar speed up as seen in that PR. Currently inverse_additive_relationships returns the inverse ARM as a dense matrix, but ideally this would (optionally?) be returned as a sparse matrix. How do others feel about picking up pydata/sparse as a dependency?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
timothymillarcommented, Aug 31, 2022

Thanks, that’s a useful reference. AFAICT the scipy.sparse array classes still have issues integrating with dask/xarray. I think it’s probably best to stick to dense arrays for now and revisit sparse encodings later if/when there’s a clear performance benefit.

1reaction
tomwhitecommented, Aug 31, 2022

I recall @tomwhite trying out sparse library options when he was working on scanpy: scverse/scanpy#921 (comment). He might have some thoughts?

My main thought is that it’s not always obvious how to best get chunking and sparsity to play well together.

As the referenced issue shows, there were some performance issues with pydata sparse, so I ended up writing my own wrapper class. However, since then sparse array classes (in contrast to sparse matrices) have been added to scipy, so I would suggest we use those (assuming everything is 2D).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setup up the inverse of additive relationship matrix in R
When doing the prediction of additive genetic values for pedigree members, we need the inverse of the so called numerator relationship ...
Read more >
Inversion of a part of the numerator relationship matrix ... - NCBI
We propose an algorithm that sets up the sparsity pattern of T -1 using pedigree information. This algorithm provides positions of the elements...
Read more >
relationshipAdditive: Additive relationship matrix and its inverse
relationshipAdditive creates additive relationship matrix, while inverseAdditive creates its inverse directly from a pedigree. kinship is another definition ...
Read more >
Inversion of a part of the numerator relationship matrix using ...
Our main objective was to propose and evaluate methodology that takes advantage of any potential sparsity in the inverse of A22 in order...
Read more >
Updating genetic relationship matrices and their inverses
Relationships among individuals are mod- elled via pedigree or genomic relationship matrices. (A or G, respectively). The inverse of these ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found