Skip to content

Instantly share code, notes, and snippets.

@andrewkern
Created December 12, 2018 19:15
Show Gist options
  • Save andrewkern/0469a438b9788803f0b8cbf062cd896c to your computer and use it in GitHub Desktop.
Save andrewkern/0469a438b9788803f0b8cbf062cd896c to your computer and use it in GitHub Desktop.
example of simulating single genotype matrix
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