(SLiMSim::ExecuteContextFunction_initializeRecombinationRate): initializeRecombinationRate() requires ends to be in strictly ascending order."
when trying to set up the simulation below by using the example code in the manual to read in a recombination map from a file (attached). I'm confused because I've convinced myself the ends are in fact sorted in ascending order, e.g. when I run `any(ends != sort(ends))` the output is `F` as desired. Is there something simple I'm missing?
initialize() {
initializeTreeSeq();
initializeMutationRate(0);
initializeMutationType("m1", 0.5, "f", 0.0);
initializeGenomicElementType("g1", m1, 1.0);
// number of windows present in rec map
defineConstant("L", 23600);
initializeGenomicElement(g1, 0, L-1);
// read recombination map for hg1
lines = readFile("/Users/jeff/workspace/selection-against-introgression/datasets/human/Kong_etal_recmaps/hg1_recmap.txt");
rates = NULL;
ends = NULL;
for (line in lines)
{
components = strsplit(line, "\t");
ends = c(ends, asInteger(components[0]));
rates = c(rates, asFloat(components[1]));
}
ends = ends/10000;
ends = ends - min(ends) + 1;
ends = asInteger(c(ends[1:(size(ends)-1)] - 2, L-1));
rates = rates*0.01;
initializeRecombinationRate(rates, ends);
}
1 {
sim.addSubpop("p1", N);
}
2 late() {
sim.simulationFinished();
}