Skip to content

Commit

Permalink
Correct a few more typos
Browse files Browse the repository at this point in the history
And explain the posterior DF better
  • Loading branch information
hyanwong committed Nov 9, 2023
1 parent 358d314 commit 7af83a9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/historical_samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kernelspec:

# Historical (Ancient) Samples

Sometimes we wich to infer and date a genetic genealogy from
Sometimes you may wish to infer and date a genetic genealogy from
data which includes *historical samples*,
whose time is older that the current generation (i.e. sample nodes with
times > 0).
Expand All @@ -33,7 +33,7 @@ place any historical samples.
## The 2 step approach

Currently, the best way to date such tree sequences is
to carry out a two step process, in which inference and dating is first
to perform a two step process, in which inference and dating is first
performed on the modern samples in order to establish a timescale, followed by
adding the historical samples and re-inferring using the dated timescale as a
basis for site ages in the `tsinfer` algorithm. The re-inferred tree sequence
Expand Down
4 changes: 2 additions & 2 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ svg2 = tsdate.date(inferred, population_size=1000, mutation_rate=4e-6).draw_svg(
haps = "<br>".join(ts.haplotypes())
cen = 'style="text-align: center; padding: 0.5em 0"'
HTML(f"""<table>
<caption>An example of using `tsinfer` followed by `tsdate` on some DNA sequence data.
<caption style="padding: 0 4em">An example of using `tsinfer` followed by `tsdate` on some DNA sequence data.
You can see that tsdate sets a timescale and changes node times so that mutations (red crosses)
are more evenly distributed over edges of the genealogy. This results in more realistic local trees
(with coaleascences clustered, as expected from theory, at recent times)</caption>
(with coalescences clustered, as expected from theory, at recent times)</caption>
<t style=""><td {cen}><div style="font-size: 0.6em">{haps}</div></td><td></td><td {cen} width="300">{svg1}</td><td></td><td {cen} width="300">{svg2}</td></tr>
<tr style="font-size: 2em"><td {cen}">DNA sequence</td><td {cen}>→</td><td {cen}>tsinfer</td><td {cen}>→</td><td {cen}>tsdate</td></tr>
</table>"""
Expand Down
9 changes: 5 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ posteriors_df = pd.DataFrame(posteriors)
posteriors_df.head() # Show the dataframe
```

Since we are using a {ref}`sec_methods_discrete_time` method, each row of this
posterior dataframe corresponds to a set of probabilities for a given timeslice
(as specified in the `start_time` and `end_time` columns). Each column corresponds to
a node (the column header is the node ID in the returned tree sequence).
Since we are using a {ref}`sec_methods_discrete_time` method, each node
(numbered column of the dataframe) is associated with a vector of probabilities
that sum to one: each cell gives the probability that the time of the node
whose ID is given by the column header lies within the
timeslice specified by the `start_time` and `end_time` columns.

(sec_usage_popsize)=

Expand Down
7 changes: 4 additions & 3 deletions docs/variable_popsize.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ specified time intervals). This can them be used to create a prior, via the {fun
function (see {ref}`sec_priors`).

For example, the following code defines a population that is of effective size
1 million in the last 200 generations, only two hundred for a period of 10 generations 50,000 generations ago, then
of size 50,000 for all generations before that, exactly matching the simulated bottleneck
1 million in the last 50,000 generations, only two hundred for a period of 10 generations 50,000 generations ago, then
of size 10,000 for all generations before that, exactly matching the simulated bottleneck

```{code-cell} ipython3
popsize = tsdate.demography.PopulationSizeHistory(population_size=[1e6, 2e2, 1e4], time_breaks=[50_000, 50_010])
Expand All @@ -99,5 +99,6 @@ population size over time, by extimating the number of coalescence points in dif
intervals, and re-estimating the dates. However, this
approach has not been fully tested or documented.

If you are interested in doing this, see https://github.com/tskit-dev/tsdate/issues/237#issuecomment-1785655708
If you are interested in doing this, see
[GitHub issue #237](https://github.com/tskit-dev/tsdate/issues/237#issuecomment-1785655708)
for an example.

0 comments on commit 7af83a9

Please sign in to comment.