limix.qc.unique_variants

limix.qc.unique_variants(X)[source]

Filters out variants with the same genetic profile.

Parameters:X (ndarray) – (N, S) ndarray of genotype values for N individuals and S variants.
Returns:Genotype array with unique variants.
Return type:ndarray

Examples

>>> from numpy.random import RandomState
>>> from numpy import kron, ones, sort
>>> from limix.qc import unique_variants
>>> random = RandomState(1)
>>>
>>> N = 4
>>> X = kron(random.randn(N, 3) < 0, ones((1, 2)))
>>>
>>> print(X)
[[0. 0. 1. 1. 1. 1.]
 [1. 1. 0. 0. 1. 1.]
 [0. 0. 1. 1. 0. 0.]
 [1. 1. 0. 0. 1. 1.]]
>>>
>>> idx = unique_variants(X)
>>>
>>> print(X[:, sort(idx)])
[[0. 1. 1.]
 [1. 0. 1.]
 [0. 1. 0.]
 [1. 0. 1.]]