sgkit.infer_call_ploidy#

sgkit.infer_call_ploidy(ds, *, call_genotype='call_genotype', call_genotype_fill='call_genotype_fill', merge=True)#

Infer the ploidy of each call genotype based on the number of fill (non-allele) values in each call genotype.

Parameters:
ds Dataset

Dataset containing genotype calls.

call_genotype Hashable (default: 'call_genotype')

Input variable name holding call_genotype as defined by sgkit.variables.call_genotype_spec. Must be present in ds.

call_genotype_fill Hashable (default: 'call_genotype_fill')

Input variable name holding call_genotype_fill as defined by sgkit.variables.call_genotype_fill_spec. If the variable is not present in ds, it will be computed assuming that allele values less than -1 are fill (non-allele) values in mixed ploidy datasets, or that no fill values are present in fixed ploidy datasets.

merge bool (default: True)

If True (the default), merge the input dataset and the computed output variables into a single dataset, otherwise return only the computed output variables. See Dataset merge behavior for more details.

Return type:

Dataset

Returns:

: A dataset containing sgkit.variables.call_ploidy_spec.