calour.filtering.
is_abundant
(data, axis, cutoff=0.01, strict=False, mean_or_sum='mean')[source]¶Check if the mean or sum abundance larger than cutoff.
Can be used to keep features with means at least “cutoff” in all samples
Parameters: |
|
---|---|
Returns: | bool array with True if mean >= cutoff. |
Return type: | np.ndarray |
Examples
>>> is_abundant(np.array([[0, 0, 1], [1, 1, 1]]), axis=1, cutoff=0.51).tolist()
[False, True]
>>> is_abundant(np.array([0, 0, 1, 1]), axis=0, cutoff=0.5)
True
>>> is_abundant(np.array([0, 0, 1, 1]), axis=0, cutoff=0.5, strict=True)
False
>>> is_abundant(np.array([[0, 1, 1]]), axis=1, cutoff=2, mean_or_sum='sum').tolist()
[True]
>>> is_abundant(np.array([0, 1, 1]), axis=0, cutoff=2, strict=True, mean_or_sum='sum')
False
>>> is_abundant(np.array([[0, 1, 1]]), axis=1, cutoff=2.01, mean_or_sum='sum').tolist()
[False]