calour.plotting.plot_core_features

calour.plotting.plot_core_features(exp: calour.experiment.Experiment, field=None, steps=None, cutoff=2, frac=0.9, iterations=10, alpha=0.5, linewidth=0.7, ax=None)[source]

Plot the percentage of core features shared in increasing number of samples.

To see if there is a core feature set shared across most of the samples.

As an example of this type of plot, please see Fig 2C in Muegge, B. D. et al. Diet drives convergence in gut microbiome functions across mammalian phylogeny and within humans. Science 332, 970–974 (2011).

Warning

The samples should be normalized by rarefaction instead of other normalization methods. Otherwise, the samples with higher sequencing depth will artificially share more OTUs with each other.

Note

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

Parameters:
  • exp (Experiment) – Input experiment object.
  • field (str) – sample metadata field to group samples
  • steps (iterable of int) – the sizes of subsamples to compute the fraction of core features.
  • cutoff (numeric) – the feature is considered present in a sample only if its abundance is >= cutoff.
  • frac (numeric) – Must between 0 and 1. The feature would be considered as a core feature if it is present in fac faction of samples.
  • iterations (int) – repeat the subsampling multiple times and plot all the iterations
  • alpha (float) – the transparency (1 is most opaque and 0 is most transparent) to plot for each iteration.
  • linewidth (float) – the linewidth of the plotting lines for each iteration
  • ax (matplotlib.axes.Axes, optional) – Axes object to draw the plot onto, otherwise uses the current Axes.
Returns:

The Axes object containing the plot.

Return type:

matplotlib.axes.Axes