calour.amplicon_experiment.AmpliconExperiment.collapse_taxonomy

AmpliconExperiment.collapse_taxonomy(level='genus', inplace=False)[source]

Collapse all features sharing the same taxonomy up to level into a single feature

Sums abundances of all features sharing the same taxonomy up to level.

Parameters:
  • level (str or int, optional) – the level to bin the taxonmies. can be int (0=kingdom, 1=phylum,…6=species) or a string (‘kingdom’ or ‘k’ etc.)
  • inplace (bool, optional) – False (default) to create a copy True to Replace data in exp