Closed BrendonChau closed 6 months ago
Thanks, looks nice! Could you please add some unit tests?
Attention: 20 lines
in your changes are missing coverage. Please review.
Comparison is base (
918d294
) 85.78% compared to head (706c5ef
) 86.47%. Report is 4 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
src/simulation.jl | 91.26% | 20 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've implemented a method for simulating missing SNP data as well and put in some basic unit tests for checking that the proportions are correct.
Oh, one more thing. Could you please add the docs about the new functions? The sources are in Jupyter Notebooks in the docs directory.
I've implemented a way to simulate SNPs under assuming a AR1 LD structure with constant ρ
, to my knowledge, there is no scalable method for doing this for tens of thousands of SNPs. On my machine, simulating 100_000
SNPs from 500_000
subjects only takes a little over 4 minutes and can be done entirely in-memory. Being able to simulate SNPs with linkage disequilibrium is important for downstream methods development.
I also updated the docs to include examples, but there is some problems with the sections related to ADMIXTURE, could someone take a look?
Hi, @BrendonChau I will review it next week.
Implemented fast sampling for SNPs directly in the compressed format used by SnpArrays. This uses minimum allocations and should be useful for downstream simulations. Sampling is pretty fast, on my machine, it only takes around 90 seconds to simulate 100k SNPs from 500k subjects. Multithreading should be possible, but it's already fast enough for most use cases.