-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Description
MWE:
import stdpopsim
print("version:", stdpopsim.__version__)
homsap = stdpopsim.get_species("HomSap")
contig = homsap.get_contig("chr21", genetic_map="HapMapII_GRCh38")
print( # rate in first bin is NaN
"First 3 rates/positions of chr21:\n",
contig.recombination_map.rate[:3], "\n",
contig.recombination_map.position[:3], "\n",
)
print( # rate in last bin is 0.0
"Last 3 rate bins/positions of chr21:", "\n",
contig.recombination_map.rate[-3:], "\n",
contig.recombination_map.position[-3:], "\n",
)
engine = stdpopsim.get_engine("msprime")
demogr = stdpopsim.PiecewiseConstantSize(1000)
sample = {"pop_0": 1}
ts = engine.simulate(contig=contig, samples=sample, demographic_model=demogr)
print("First tree starts at:", ts.edges_left.min()) # left flank is missing
print("Last tree ends at:", ts.edges_right.max()) # ... but not on right flankthis is the output:
version: 0.3.0
First 3 rates/positions of chr21:
[ nan 1.796830e-09 1.819887e-08]
[ 0. 10326675. 10328257.]
Last 3 rate bins/positions of chr21:
[2.205359e-08 2.208893e-08 0.000000e+00]
[46677698. 46680243. 46709983.]
First tree starts at: 10326675.0
Last tree ends at: 46709983.0Seems like the last bin should have NaN, not zero, here?
Metadata
Metadata
Assignees
Labels
No labels