calour.util.compute_prevalence

calour.util.compute_prevalence(abundance)[source]

Return the prevalence at each abundance cutoffs.

Each sample that has the OTU above the cutoff (exclusive) will be counted.

Parameters:abundance (iterable of numeric) – The abundance of a species across samples.

Examples

>>> abund = [0, 0, 1, 2, 4]
>>> x, y = compute_prevalence(abund)
>>> x   
array([0, 1, 2, 4])
>>> y   
array([0.6, 0.4, 0.2, 0.])