Skip to content

finite num_loci argument produces breakpoints not lying between recombination map positions #549

Description

@petrelharp

If I wanted to simulate a region of five bases and equal recombination fractions, I could do this:

r = msprime.RecombinationMap(positions=[0,1,2,3,4],rates=[1.0, 1.0, 1.0, 1.0, 0.0],num_loci=4)
ts = msprime.simulate(100, recombination_map=r)
print(list(ts.breakpoints()))
# [0, 1.0, 2.0, 3.0, 4.0]

and I'd get recombination breakpoints occurring at the positions passed to the RecombinationMap, as expected. However, if recombination rates are not equal in the four regions, unexpected things happen, for instance:

r = msprime.RecombinationMap(positions=[0,1,2,3,4],rates=[100.0, 0.0, 1.0, 1.0, 0.0],num_loci=4)
ts = msprime.simulate(100, recombination_map=r)
print(list(ts.breakpoints()))
# [0, 0.255, 0.51, 0.765, 4.0]

This is strange because (a) all the breakpoints actually occur in the first interval, and (b) there are three non-endpoint breakpoints, just as above, even though one of the interval's rates was 0.0, meaning it should have acted like it had only 3 loci.

I suppose that num_loci works by dividing up the chromosome into segments with equal recombination rates. This means that you can't use this feature to simulate discrete recombination with unequal rates, I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions