Skip to content

Commit 0377363

Browse files
committed
Add missing API docs to Sphinx. Fixes sgkit-dev#212 (sgkit-dev#214)
1 parent 6b8d74a commit 0377363

File tree

4 files changed

+44
-21
lines changed

4 files changed

+44
-21
lines changed

docs/api.rst

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,32 @@ API reference
66

77
This page provides an auto-generated summary of sgkits's API.
88

9-
Top-level functions
10-
===================
9+
Creating a dataset
10+
==================
1111

1212
.. autosummary::
1313
:toctree: generated/
1414

1515
create_genotype_call_dataset
16+
create_genotype_dosage_dataset
17+
read_vcfzarr
18+
19+
Methods
20+
=======
21+
22+
.. autosummary::
23+
:toctree: generated/
24+
25+
count_call_alleles
26+
count_variant_alleles
1627
gwas_linear_regression
28+
hardy_weinberg_test
29+
regenie
30+
31+
Utilities
32+
=========
33+
34+
.. autosummary::
35+
:toctree: generated/
36+
37+
display_genotypes

sgkit/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def create_genotype_dosage_dataset(
9393
call_genotype_probability: Any,
9494
variant_id: Any = None,
9595
) -> xr.Dataset:
96-
"""Create a dataset of genotype calls.
96+
"""Create a dataset of genotype dosages.
9797
9898
Parameters
9999
----------

sgkit/stats/hwe.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def hardy_weinberg_test(
145145
Dataset
146146
Dataset containing (N = num variants):
147147
variant_hwe_p_value : (N,) ArrayLike
148-
P values from HWE test for each variant as float in [0, 1].
148+
P values from HWE test for each variant as float in [0, 1].
149149
150150
References
151151
----------
@@ -156,8 +156,9 @@ def hardy_weinberg_test(
156156
Raises
157157
------
158158
NotImplementedError
159-
* If ploidy of provided dataset != 2
160-
* If maximum number of alleles in provided dataset != 2
159+
If ploidy of provided dataset != 2
160+
NotImplementedError
161+
If maximum number of alleles in provided dataset != 2
161162
"""
162163
if ds.dims["ploidy"] != 2:
163164
raise NotImplementedError("HWE test only implemented for diploid genotypes")

sgkit/stats/regenie.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ def regenie(
736736
) -> Dataset:
737737
"""Regenie trait transformation.
738738
739-
[REGENIE](https://github.com/rgcgithub/regenie) is a whole-genome
739+
`REGENIE <https://github.com/rgcgithub/regenie>`_ is a whole-genome
740740
regression technique that produces trait estimates for association
741741
tests. These estimates are subtracted from trait values and
742742
sampling statistics (p-values, standard errors, etc.) are evaluated
@@ -790,14 +790,20 @@ def regenie(
790790
Dataset
791791
A dataset containing the following variables:
792792
- `base_prediction` (blocks, alphas, samples, outcomes): Stage 1
793-
predictions from ridge regression reduction .
793+
predictions from ridge regression reduction .
794794
- `meta_prediction` (samples, outcomes): Stage 2 predictions from
795-
the best meta estimator trained on the out-of-sample Stage 1
796-
predictions.
795+
the best meta estimator trained on the out-of-sample Stage 1
796+
predictions.
797797
- `loco_prediction` (contigs, samples, outcomes): LOCO predictions
798-
resulting from Stage 2 predictions ignoring effects for variant
799-
blocks on held out contigs. This will be absent if the
800-
data provided does not contain at least 2 contigs.
798+
resulting from Stage 2 predictions ignoring effects for variant
799+
blocks on held out contigs. This will be absent if the
800+
data provided does not contain at least 2 contigs.
801+
802+
Raises
803+
------
804+
ValueError
805+
If dosage, covariates, and trait arrays do not have the same number
806+
of samples.
801807
802808
Examples
803809
--------
@@ -824,15 +830,10 @@ def regenie(
824830
References
825831
----------
826832
[1] - Mbatchou, J., L. Barnard, J. Backman, and A. Marcketta. 2020.
827-
“Computationally Efficient Whole Genome Regression for Quantitative and Binary
828-
Traits.” bioRxiv. https://www.biorxiv.org/content/10.1101/2020.06.19.162354v2.abstract.
829-
[2] - https://glow.readthedocs.io/en/latest/tertiary/whole-genome-regression.html
833+
“Computationally Efficient Whole Genome Regression for Quantitative and Binary
834+
Traits.” bioRxiv. https://www.biorxiv.org/content/10.1101/2020.06.19.162354v2.abstract.
830835
831-
Raises
832-
------
833-
ValueError
834-
If dosage, covariates, and trait arrays do not have the same number
835-
of samples.
836+
[2] - https://glow.readthedocs.io/en/latest/tertiary/whole-genome-regression.html
836837
"""
837838
if isinstance(covariates, str):
838839
covariates = [covariates]

0 commit comments

Comments
 (0)