calour.database.enrichment

calour.database.enrichment(exp: calour.experiment.Experiment, features, dbname, *args, **kwargs)[source]

Get the list of enriched annotation terms in features compared to all other features in exp.

Uses the database specific enrichment analysis method.

Note

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

Parameters:
  • exp (Experiment) – Input experiment object.
  • features (list of str) – The features to test for enrichment (compared to all other features in exp)
  • dbname (str) – the database to use for the annotation terms and enrichment analysis
  • *args (tuple) –
  • **kwargs (dict) – Additional database specific parameters (see per-database module documentation for .enrichment() method)
Returns:

  • pandas.DataFrame with info about significantly enriched terms. The columns include
    • ‘feature’ : the feature ID (str)
    • ’pval’ : the p-value for the enrichment (float)
    • ’odif’ : the effect size (float)
    • ’observed’ : the number of observations of this term in group1 (int)
    • ’expected’ : the expected (based on all features) number of observations of this term in group1 (float)
    • ’frac_group1’ : fraction of total terms in group 1 which are the specific term (float)
    • ’frac_group2’ : fraction of total terms in group 2 which are the specific term (float)
    • ’num_group1’ : number of total terms in group 1 which are the specific term (float)
    • ’num_group2’ : number of total terms in group 2 which are the specific term (float)
    • ’description’ : the term (str)
  • numpy.Array where rows are features (ordered like the dataframe), columns are terms, and value is score – for term in feature
  • pandas.DataFrame with info about the features used. columns
    • ‘group’ : int, the group (1/2) to which the feature belongs
    • ’sequence’: str