Skip to content

Commit 7b046d7

Browse files
hyanwongbenjeffery
authored andcommitted
Docs: clarify alleles list with missing data
1 parent b8ef22d commit 7b046d7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tsinfer/formats.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,8 +1778,11 @@ def add_site(
17781778
that the input array is also of this type.
17791779
:param list(str) alleles: A list of strings defining the alleles at this
17801780
site. Only biallelic sites can currently be used for inference. Sites
1781-
with 3 or more alleles cannot have ``inference`` (below) set to ``True``.
1782-
If not specified or None, defaults to ["0", "1"].
1781+
with 3 or more non-missing alleles cannot have ``inference`` (below)
1782+
set to ``True``. If missing data is present in the ``genotypes`` array,
1783+
the stored list of alleles will be modified as necessary so that
1784+
``alleles[tskit.MISSING_DATA] == None``. If ``alleles`` is not specified
1785+
or None, a default of ["0", "1"] is used.
17831786
:param dict metadata: A JSON encodable dict-like object containing
17841787
metadata that is to be associated with this site.
17851788
:param float time: The time of occurence (pastwards) of the mutation to the
@@ -2073,6 +2076,9 @@ def variants(self, sites=None, recode_ancestral=None):
20732076
state will have a genotype of 0. If the ancestral state is unknown, the
20742077
original input order is kept.
20752078
2079+
If a variant contains missing data, it is guaranteed that the alleles
2080+
attribute for that variant satisfies ``alleles[tskit.MISSING_DATA] == None``.
2081+
20762082
:param array sites: A numpy array of ascending site ids for which to return
20772083
data. If None (default) return all sites.
20782084
:param bool recode_ancestral: If True, recode genotypes at sites where the

0 commit comments

Comments
 (0)