limix.qc.indep_pairwise

limix.qc.indep_pairwise(X, window_size, step_size, threshold, verbose=True)[source]

Determine pair-wise independent variants.

Independent variants are defined via squared Pearson correlations between pairs of variants inside a sliding window.

Parameters
  • X (array_like) – Sample by variants matrix.

  • window_size (int) – Number of variants inside each window.

  • step_size (int) – Number of variants the sliding window skips.

  • threshold (float) – Squared Pearson correlation threshold for independence.

  • verbose (bool) – True for progress information; False otherwise.

Returns

ok – Boolean array defining independent variants

Return type

ndarray

Example

>>> from numpy.random import RandomState
>>> from limix.qc import indep_pairwise
>>>
>>> random = RandomState(0)
>>> X = random.randn(10, 20)
>>>
>>> indep_pairwise(X, 4, 2, 0.5, verbose=False)
array([ True,  True, False,  True,  True,  True,  True,  True,  True,
        True,  True,  True,  True,  True,  True,  True,  True,  True,
        True,  True])