calour.experiment.Experiment.diff_abundance_kw

Experiment.diff_abundance_kw(field, transform='rankdata', numperm=1000, alpha=0.1, fdr_method='dsfdr', random_seed=None)[source]

Test the differential expression between multiple sample groups using the Kruskal Wallis test. uses a permutation based fdr (dsfdr) for bacteria that have a significant difference.

Parameters:
  • exp (Experiment) –
  • field (str) – The field to test by
  • transform (str or None) – transformation to apply to the data before caluculating the statistic ‘rankdata’ : rank transfrom each OTU reads ‘log2data’ : calculate log2 for each OTU using minimal cutoff of 2 ‘normdata’ : normalize the data to constant sum per samples ‘binarydata’ : convert to binary absence/presence
  • alpha (float) – the desired FDR control level
  • numperm (int) – number of permutations to perform
  • random_seed (int or None (optional)) – int to set the numpy random seed to this number before running the random permutation test. None to not set the numpy random seed
Returns:

newexp – The experiment with only significant (FDR<=maxfval) difference, sorted according to difference

Return type:

Experiment