Skip to content

Commit 455987b

Browse files
hyanwongjeromekelleher
authored andcommitted
Update docs/stats.md
Co-authored-by: Jerome Kelleher <[email protected]>
1 parent fbf85b7 commit 455987b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/stats.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,22 +124,22 @@ Markdown(
124124
#### Basic calling convention
125125

126126
```{code-cell} ipython3
127-
afs = ts.allele_frequency_spectrum()
128-
print(afs) # afs[1] gives number of singletons, afs[2] doubletons, etc
127+
pi = ts.diversity()
128+
print(pi) # Genetic diversity within the sample set
129129
```
130130

131131
#### Restrict to {ref}`sample sets<sec_stats_sample_sets>`
132132

133133
```{code-cell} ipython3
134-
pi = ts.diversity(sample_sets=ts.samples(population=0))
135-
print(pi) # Genetic diversity within population 0
134+
pi_0 = ts.diversity(sample_sets=ts.samples(population=0))
135+
print(pi_0) # Genetic diversity within population 0
136136
```
137137

138138
#### Summarise in genomic {ref}`windows<sec_stats_windows>`
139139

140140
```{code-cell} ipython3
141-
pi = ts.diversity(sample_sets=ts.samples(population=1), windows=[0, 400, 600, 1000])
142-
print(pi) # Genetic diversity within population 1 in three windows along the genome
141+
pi_window = ts.diversity(sample_sets=ts.samples(population=1), windows=[0, 400, 600, 1000])
142+
print(pi_window) # Genetic diversity within population 1 in three windows along the genome
143143
```
144144

145145
#### Compare {ref}`between<sec_stats_sample_sets_multi_way>` sample sets
@@ -238,7 +238,7 @@ the `node` statistics return one number **for each node** in the tree sequence (
238238
There can be a lot of nodes in the tree sequence, so beware.
239239

240240
Also remember that in a tree sequence the "sites" are usually just the **variant** sites,
241-
e.g., the sites of the SNPs. Although tree sequence may in principle have monomorphic
241+
e.g., the sites of the SNPs. Although the tree sequence may in principle have monomorphic
242242
sites, those produced by simulation usually don't.
243243

244244

0 commit comments

Comments
 (0)