calour.filtering.filter_prevalence

calour.filtering.filter_prevalence(exp: calour.experiment.Experiment, fraction, cutoff=1, field=None, **kwargs)[source]

Filter features keeping only ones present in more than certain fraction of all samples.

This is a convenience function wrapping filter_by_data

Note

This function is also available as a class method Experiment.filter_prevalence()

Parameters:
  • exp (Experiment) – Input experiment object.
  • fraction (float) – Keep features present in more than fraction of samples
  • cutoff (float, optional) – The min abundance threshold to be called present in a sample
  • field (str or None, optional) – The column in the sample_metadata. If it is not None, the data set are divided into groups according to the sample metadata column. The features that has is_prevalent lower than the fraction in ALL sample groups will be filtered away. If it is None, the is_prevalent is computed over the whole data set.
Keyword Arguments:
 

negate (bool) – negate the predicate for selection

Returns:

with only features present in at least fraction of samples

Return type:

Experiment