Simulate genotypes for unit tests
See original GitHub issueI’m trying to simulate some genotype calls for unit tests using a simple model from msprime
. At @jeromekelleher’s suggestion, I tried this:
# Using 1.x code, not yet released
!pip install git+https://github.com/tskit-dev/msprime.git#egg=msprime
import msprime
model = msprime.Demography.island_model(2, migration_rate=1e-3, Ne=10**4)
samples = model.sample(10, 10) # 10 haploids from each pop
ts = msprime.simulate(
samples=samples,
demography=model, # what should this be?
mutation_rate=1e-8,
recombination_rate=1e-8
)
list(ts.variants())
[]
What is demography
supposed to be? I saw a “FIXME” for documenting it in simulate
but I wasn’t sure what to set it to if not the Demography
instance that comes back from island_model
.
Also, is this why I’m not getting any variants back out?
I am ultimately trying to simulate hardy weinberg equilibrium. I’d like to have some fraction of the variants be in or near perfect equilibrium and the remainder way out of it. If you get a chance, could I get an assist @jeromekelleher?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Simulating autosomal genotypes with realistic linkage ... - NCBI
Our method can simulate genetically homogeneous or stratified populations and can simulate case-parents studies, case-control studies, case-only ...
Read more >cophesim: A comprehensive phenotype simulator for testing ...
genotype data prepared with a genetic simulator. The output of cophesim can be used as a direct input for different genome wide.
Read more >a fast method for simulation of large scale case–control GWAS ...
A common method used by GWAS simulators is to proceed by adding phenotypes to a sample of genotype data that is either simulated...
Read more >A computer program to simulate multilocus genotype data with ...
This paper proposes a model and simulation method implemented in a computer program to flexibly simulate data displaying such patterns. The ...
Read more >MAPITR_TestData_Genotypes: MAPITR TestData Genotypes in ...
Description. A simulated dataset of genotypes for use in unit tests · Format. A data frame with 500 rows (individuals) and 750 variables...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yea, I don’t see why not
I think we can - closing.