limix.qc.compute_maf¶
-
limix.qc.
compute_maf
(X)[source]¶ Compute minor allele frequencies.
It assumes that
X
encodes 0, 1, and 2 representing the number of alleles (or dosage), orNaN
to represent missing values.Parameters: X (array_like) – Genotype matrix. Returns: Minor allele frequencies. Return type: array_like Examples
>>> from numpy.random import RandomState >>> from limix.qc import compute_maf >>> >>> random = RandomState(0) >>> X = random.randint(0, 3, size=(100, 10)) >>> >>> print(compute_maf(X)) [0.49 0.49 0.445 0.495 0.5 0.45 0.48 0.48 0.47 0.435]