Skip to content

Commit 1815fce

Browse files
committed
Remove links to solved issues
1 parent 2ce0daf commit 1815fce

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

getting_started.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,11 @@ plt.show()
159159
It's obvious that there's something unusual about the trees in the middle of this
160160
chromosome, where the selective sweep occurred.
161161

162-
:::{margin} Comments needed
163-
If you have a need for efficient random access to trees like this, please comment on
164-
[this GitHub issue](https://github.com/tskit-dev/tskit/issues/684) to help us implement
165-
a solution.
166-
:::
167-
168-
Currently, it's not particularly efficient to pull out individual trees from the middle
169-
of a tree sequence, but it *can* be done, via the
170-
{meth}`TreeSequence.at` method. Here's the tree at location
171-
$5\ 000\ 000$ --- the position of the sweep --- drawn using the
172-
{meth}`Tree.draw_svg` method.
162+
Although tskit is designed so that is it rapid to pass through trees sequentially,
163+
it is also possible to pull out individual trees from the middle of a tree sequence
164+
via the {meth}`TreeSequence.at` method. Here's how you can use that to extract
165+
the tree at location $5\ 000\ 000$ --- the position of the sweep --- and draw it
166+
using the {meth}`Tree.draw_svg` method.
173167

174168
```{code-cell} ipython3
175169
swept_tree = ts.at(5_000_000) # or you can get e.g. the nth tree using ts.at_index(n)

tables_and_editing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,10 @@ print("Original ts has", ts.num_mutations, "mutations on", ts.num_trees, "trees"
738738
739739
tables = ts.dump_tables() # Copy the table collection associated with this tree sequence
740740
tables.mutations.clear() # Clear all mutations in the table collection copy
741-
v_iter = ts.variants() # Workaround until https://github.com/tskit-dev/tskit/issues/605 is solved
741+
variant = tskit.Variant(ts) # Reuse the same Variant object
742742
for tree in ts.trees():
743743
for site in tree.sites():
744-
variant = next(v_iter)
744+
variant.decode(site.id) # Efficient if ids are sequential
745745
anc_state, mutations = tree.map_mutations(variant.genotypes, variant.alleles)
746746
if len(mutations) < len(site.mutations):
747747
# Genotypes can be explained with a more parsimonious distribution of mutations

0 commit comments

Comments
 (0)