File tree 2 files changed +37
-2
lines changed
2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -385,3 +385,11 @@ def _check_field(
385
385
ArrayLikeSpec ("variant_t_value" )
386
386
)
387
387
"""T statistics for each beta."""
388
+ window_start , window_start_spec = SgkitVariables .register_variable (
389
+ ArrayLikeSpec ("window_start" , kind = "i" , ndim = 1 )
390
+ )
391
+ """The index values of window start positions along the ``variants`` dimension."""
392
+ window_stop , window_stop_spec = SgkitVariables .register_variable (
393
+ ArrayLikeSpec ("window_stop" , kind = "i" , ndim = 1 )
394
+ )
395
+ """The index values of window stop positions along the ``variants`` dimension."""
Original file line number Diff line number Diff line change @@ -17,8 +17,35 @@ def window(
17
17
step : int ,
18
18
merge : bool = True ,
19
19
) -> Dataset :
20
- """Add windowing information to a dataset."""
21
-
20
+ """Add fixed-size windowing information to a dataset.
21
+
22
+ Windows are defined over the ``variants`` dimension, and are
23
+ used by some downstream functions to calculate statistics for
24
+ each window.
25
+
26
+ Parameters
27
+ ----------
28
+ ds
29
+ Genotype call dataset.
30
+ size
31
+ The window size (number of variants).
32
+ step
33
+ The distance (number of variants) between start positions of windows.
34
+ merge
35
+ If True (the default), merge the input dataset and the computed
36
+ output variables into a single dataset, otherwise return only
37
+ the computed output variables.
38
+ See :ref:`dataset_merge` for more details.
39
+
40
+ Returns
41
+ -------
42
+ A dataset containing the following variables:
43
+
44
+ - :data:`sgkit.variables.window_start_spec` (windows):
45
+ The index values of window start positions.
46
+ - :data:`sgkit.variables.window_stop_spec` (windows):
47
+ The index values of window stop positions.
48
+ """
22
49
n_variants = ds .dims ["variants" ]
23
50
24
51
length = n_variants
You can’t perform that action at this time.
0 commit comments