Skip to content

Commit 31720a7

Browse files
authored
Merge pull request #313 from hyanwong/minor-basic-improvements
A few trivial improvements
2 parents 59abbd3 + 9bae97d commit 31720a7

5 files changed

Lines changed: 26 additions & 14 deletions

File tree

getting_started.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ of the chromosome, then throw some neutral mutations onto the resulting tree seq
4646
```{code-cell} ipython3
4747
import msprime
4848
49-
pop_size=10_000
49+
pop_size=5000
5050
seq_length=10_000_000
5151
5252
sweep_model = msprime.SweepGenicSelection(
@@ -167,9 +167,14 @@ using the {meth}`Tree.draw_svg` method.
167167
```{code-cell} ipython3
168168
swept_tree = ts.at(5_000_000) # or you can get e.g. the nth tree using ts.at_index(n)
169169
intvl = swept_tree.interval
170-
print(f"Tree number {swept_tree.index}, which runs from position {intvl.left} to {intvl.right}:")
171-
# Draw it at a wide size, to make room for all 40 tips
172-
swept_tree.draw_svg(size=(1000, 200))
170+
171+
swept_tree.draw_svg(
172+
size=(1000, 200), # Draw the tree at a wide size, to make room for all 40 tips
173+
title=f"Tree number {swept_tree.index}, which runs from position {intvl.left} to {intvl.right}:",
174+
y_axis=True,
175+
y_ticks=[0, 20, 40, 60, 80],
176+
node_labels={}
177+
)
173178
```
174179
:::{margin}
175180
The {ref}`visualization tutorial<sec_tskit_viz>` gives more drawing possibilities
@@ -193,8 +198,14 @@ more than one tree: either the entire tree sequence, or
193198

194199
```{code-cell} ipython3
195200
reduced_ts = ts.simplify([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) # simplify to the first 10 samples
196-
print("Genealogy of the first 10 samples for the first 5kb of the genome")
197-
reduced_ts.draw_svg(x_lim=(0, 5000))
201+
202+
reduced_ts.draw_svg(
203+
x_lim=(0, 10000),
204+
title="Genealogy of the first 10 samples for the first 10kb of the genome",
205+
y_axis=True,
206+
y_ticks=[0, 2000, 4000, 6000, 8000],
207+
node_labels = {u: u for u in reduced_ts.samples()},
208+
)
198209
```
199210

200211
These are much more standard-looking coalescent trees, with far longer branches higher

requirements-CI.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pygraphviz==1.13
1111
scikit-allel==1.3.13
1212
stdpopsim==0.3.0
1313
tqdm==4.66.3
14-
tskit==1.0.0
14+
tskit==1.0.3
1515
tskit_arg_visualizer==0.1.2
1616
tszip==0.3
1717
jsonschema==4.18.6 # Pinned due to 4.19 "AttributeError module jsonschema has no attribute _validators"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ pygraphviz
1010
scikit-allel>=1.3.9
1111
stdpopsim>=0.3
1212
tqdm
13-
tskit>=1.0.0
13+
tskit>=1.0.3
1414
tskit_arg_visualizer>=0.1.1
1515
tszip

terminology_and_concepts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ There is a subtle distinction between common ancestry and coalescence. In partic
436436

437437
The term Ancestral Recombination Graph (ARG), is commonly used to describe a genetic
438438
genealogy. In particular, many (but not all) authors use it to mean a genetic
439-
genealogy in which details of the position and potentially the timing of all
440-
recombination and common ancestor events are explicitly stored. For clarity
439+
genealogy which explictly records details of the position - and potentially the timing -
440+
of all recombination and common ancestor events. For clarity
441441
we refer to this sort of genetic genealogy as a "full ARG". Succinct tree sequences can
442442
represent many different sorts of ARGs, including "full ARGs", by incorporating extra
443443
non-coalescent nodes (see the {ref}`sec_args` tutorial). However, tree sequences are

what_is.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ The second tree shows the relationships between positions 367 and 600.
231231
Note that in the first tree, genome $\mathrm{e}$ (highlighted in red) is closest to
232232
$\mathrm{a}-\mathrm{d}$, whereas in the second tree $\mathrm{e}$ is closest to
233233
$\mathrm{f}-\mathrm{h}$. The third tree shows the relationships between positions
234-
600 and 900 (the end of the genome). In this case, an entire subtree (or "clade"),
234+
600 and the end of the genome. In this case, an entire subtree (or "clade"),
235235
composed of nodes $\mathrm{e}-\mathrm{h}$ has changed its relationship with the other six
236236
genomes. More specifically, the most recent common ancestor (MRCA) with any of these
237237
others has switched: in the third tree it is now above $\mathrm{i}$ and $\mathrm{j}$.
@@ -246,9 +246,10 @@ based on a network of *genetic ancestry*, in which
246246
(represented by red symbols below) has led
247247
to different regions of the chromosome having different histories. Another way of
248248
thinking about the tree sequence above is that it describes the full genetic genealogy
249-
of our 10 genomes. If we combine all the relationships encoded in the trees (you can
250-
loosely think of this as lying the trees on top of each other), the result is a network or
251-
_graph_ (hence the term "[ARG](https://doi.org/10.1371/journal.pgen.1011110)")
249+
of our 10 genomes. If we combine all the relationships encoded in the trees - you can
250+
loosely think of this as lying the trees on top of each other - the result is a network or
251+
[_graph_](https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)), hence the term
252+
"[ARG](https://doi.org/10.1371/journal.pgen.1011110)"
252253

253254
```{code-cell} ipython3
254255
:"tags": ["hide-input"]

0 commit comments

Comments
 (0)