Skip to content

Commit e88bde2

Browse files
hyanwongmergify[bot]
authored andcommitted
Shorter note about span normalise
Because msprime now tends to default to base pair units, I think we can shorten this comment
1 parent a971852 commit e88bde2

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

docs/_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ sphinx:
5252
tutorials: ["https://tskit.dev/tutorials/", null]
5353
stdpopsim: ["https://stdpopsim.readthedocs.io/en/stable", null]
5454
pyslim: ["https://tskit.dev/pyslim/docs/latest/", null]
55+
msprime: ["https://tskit.dev/msprime/docs/stable/", null]
5556
numpy: ["https://numpy.org/doc/stable/", null]
5657

5758
breathe_projects: {"tskit": "doxygen/xml"}

docs/stats.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -429,15 +429,13 @@ this case, computes a statistic with the pattern of genotypes at each site,
429429
and normalising would divide these statistics by the distance to the previous variant site
430430
(probably not what you want to do).
431431

432-
And, a final note about "span": in tree sequences produced by `msprime`
433-
coordinates along the sequence are **continuous**,
434-
so the "spans" used here may not correspond to distance along the genome in (say) base pairs.
435-
For instance, pairwise sequence divergence is usually a number between 0 and 1
436-
because it is the proportion of bases that differ;
437-
this will only be true if the `sequence_length`, and hence the "spans" are measured in base pairs
438-
(which you ensure in `msprime` by setting recombination and mutation rates equal to the values
439-
in units of crossovers and mutations per base pair, respectively).
440-
432+
:::{note}
433+
The resulting values are scaled "per unit of sequence length" - for instance, pairwise
434+
sequence divergence is measured in "differences per unit of sequence length". Functions
435+
such as {func}`msprime:msprime.sim_mutations` will by default add mutations in discrete
436+
coordinates, usually interpreted as base pairs, in which
437+
case span normalised statistics are in units of "per base pair".
438+
:::
441439

442440
(sec_stats_output_format)=
443441

0 commit comments

Comments
 (0)