Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specify positions for branch LD matrix
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