Skip to content

Commit e07dde7

Browse files
timothymillartomwhite
authored andcommitted
Fixup getting_started docs to handle dask array
1 parent 364552a commit e07dde7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/getting_started.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ shows how it can be used in the context of doing something simple like counting
203203
204204
# Now the result is correct -- only the third sample is heterozygous so the count should be 1.
205205
# This how many sgkit functions handle missing data internally:
206-
sg.variant_stats(ds).variant_n_het.item(0)
206+
sg.variant_stats(ds).variant_n_het.values.item(0)
207207
208208
Windowing
209209
---------
@@ -320,8 +320,8 @@ Xarray and Pandas operations in a single pipeline:
320320
# for windows of size 20 variants
321321
(
322322
ds
323-
# Add call rate and other statistics
324-
.pipe(sg.variant_stats)
323+
# Add and compute call rate and other statistics
324+
.pipe(sg.variant_stats).compute()
325325
# Apply filter to include variants present across > 80% of samples
326326
.pipe(lambda ds: ds.sel(variants=ds.variant_call_rate > .8))
327327
# Create windows of size 20 variants

0 commit comments

Comments
 (0)