Skip to content

Commit

Permalink
Specify positions for branch LD matrix
Browse files Browse the repository at this point in the history
Introduces the ability to subset the branch LD matrix with genomic
positions. This is a little trickier than subsetting the LD matrix with
sites because positions can map to duplicate tree indices. We still only
allow unique, sorted positions as input. For instance, if we receive
`[0.1, 0.2, 0.3, 2.5, 2.8]` from a user, it may map to `[0, 0, 0, 2, 2]`.
To this end, I've repurposed the `check_sites` validation code and added
some logic for dealing with index repeats.

For now, until I devise some simple optimizations for matrix filling,
we're filling a square matrix entry by entry. If we are skipping trees
with our specified positions, we must iterate over the entire range
regardless because we're keeping a running sum of the statistic and we
need the intermediate state regardless of whether or not we're keeping
it.
  • Loading branch information
lkirk authored and mergify[bot] committed Jun 10, 2024
1 parent 0913965 commit 5d8471a
Showing 1 changed file with 297 additions and 99 deletions.
Loading

0 comments on commit 5d8471a

Please sign in to comment.