Skip to content

Calculate r LD coefficient #405

Closed as not planned
Closed as not planned

Description

@standard-aaron

This is just a suggestion that i would assume is easy to implement -- is it possible to include methods for rmatrix() in addition to r2matrix()?

(Why do I care about this? r rather than r2 is the relevant statistic if you are trying to calculate marginal effect sizes for a linked locus with multiple causal effects.)

--Aaron

Activity

  1. jeromekelleher commented on Nov 19, 2019

    @jeromekelleher
    Member

    Thanks for the suggestion @35ajstern. Presumably, this is np.sqrt(r2_matrix), so seems like it's hardly worth the API duplication? (Perhaps I'm missing something though?)

  2. standard-aaron commented on Nov 19, 2019

    @standard-aaron
    Author

    What if r is negative?

  3. standard-aaron commented on Nov 19, 2019

    @standard-aaron
    Author

    This is obviously easy enough to calculate directly from the genotype matrix, but i'm guessing you guys have some secret sauce for how to optimize this calculation using the treeSeq -- hence my suggestion

  4. jeromekelleher commented on Nov 19, 2019

    @jeromekelleher
    Member

    Ah yes, of course.

    Well, it's actually pretty involved coding the LD methods up at the moment, but we're hoping to get a more general framework in place soon (with @apragsdale), so we'll definitely include this when we do. Unfortunately, I don't think it'll happen before that unless you'd like to volunteer some time.

  5. changed the title [-]LdCalculator method[/-] [+]Calculate r LD coefficient[/+] on Nov 19, 2019
  6. standard-aaron commented on Nov 19, 2019

    @standard-aaron
    Author

    Sounds good -- might try to help with this if I have time soon. Feel free to close the issue!

  7. apragsdale commented on Nov 19, 2019

    @apragsdale
    Contributor

    Hi Aaron, Jerome - yes, I've been (slowly) plugging away locally on getting a more general framework for two locus statistics implemented, tested, and working, but it's not quite ready to send in a pull request I think (Jerome, unless you think it's helpful to have open pull request that are actively in development and a ways away from being integrated - not entirely sure what the preferred approach is for that).

    @35ajstern if you have some time soon and do want to help out, let's chat! I've also been a bit slow getting around to this, so more people working on it would be motivating..

  8. jeromekelleher commented on Nov 20, 2019

    @jeromekelleher
    Member

    two locus statistics implemented, tested, and working, but it's not quite ready to send in a pull request I think (Jerome, unless you think it's helpful to have open pull request that are actively in development and a ways away from being integrated - not entirely sure what the preferred approach is for that).

    It depends on when you'd like to get feedback basically @apragsdale --- feel free to open a PR whenever you like.

    Let's keep this issue open anyway, as a reminder that we want to implement r as well as r2.

  9. added
    C API
    enhancement
    Python API
    on Sep 29, 2020
  10. added
    future
    on Jun 10, 2025
  11. benjeffery commented on Jun 11, 2025

    @benjeffery
    Member

    Closing for inactivity and labelling "future", please re-open if you plan to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C APIPython APIenhancementfuturestatistics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions