Created
December 12, 2018 19:15
-
-
Save andrewkern/0469a438b9788803f0b8cbf062cd896c to your computer and use it in GitHub Desktop.
example of simulating single genotype matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import keras | |
import msprime | |
import matplotlib | |
import numpy as np | |
# generate tree sequence | |
ts=msprime.simulate( | |
Ne=0.5, | |
population_configurations=[ | |
msprime.PopulationConfiguration(sample_size=1000)], | |
mutation_rate=100, recombination_rate=100) | |
# get genotype matrix from tree sequence | |
x=ts.genotype_matrix() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment