calour.experiment.Experiment.filter_prevalence

Experiment.filter_prevalence(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

Parameters:
  • 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