Skip to content

Commit 2bbdd70

Browse files
gregorgorjancjeromekelleher
authored andcommitted
segregating_sites doc clarification
A proposal of improved doc for `segregating_sites()` based on discussion in #3154 @petrelharp how does this look?
1 parent c6b06b0 commit 2bbdd70

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

python/tskit/trees.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9349,11 +9349,17 @@ def segregating_sites(
93499349
What is computed depends on ``mode``. For a sample set ``A``, computes:
93509350
93519351
"site"
9352-
The sum over sites of the number of alleles found in ``A`` at each site
9353-
minus one, per unit of chromosome length.
9354-
If all sites have at most two alleles, this is the density of sites
9355-
that are polymorphic in ``A``. To get the **number** of segregating minor
9356-
alleles per window, pass ``span_normalise=False``.
9352+
The sum over sites of [the number of alleles found in ``A`` at each site
9353+
minus one], per unit of chromosome length.
9354+
If all sites have at most two alleles in ``A``,
9355+
this is the density of segregating/polymorphic sites in ``A``
9356+
(since the "minus one" reduces the sum for ancestral allele).
9357+
Hence, multiple mutations per site increase the
9358+
returned value, but only if they segregate in ``A``.
9359+
If an ancestral allele does not segregate in ``A``,
9360+
the "minus one" will reduce the sum for another allele.
9361+
To get the **number** of segregating alleles in ``A``,
9362+
use ``span_normalise=False``.
93579363
93589364
"branch"
93599365
The total length of all branches in the tree subtended by the samples in

0 commit comments

Comments
 (0)