biocore / gneiss

compositional data analysis toolbox
https://biocore.github.io/gneiss/
BSD 3-Clause "New" or "Revised" License
56 stars 28 forks source link

Better APIs for summarizing taxa #224

Open mortonjt opened 7 years ago

mortonjt commented 7 years ago

It would be great if a function like the following could exist

def summarize_me(balance_names, tree, feature_metadata):
   """ Returns a summary table, with metadata, annotated with numerator and denominator

   Parameters
   -----------
   balance_names : list, str
       List of names of balances
   tree : skbio.TreeNode
       Tree used for balance construction
   feature_metadata : pd.DataFrame
       Table of metadata annotations for features

   Returns
   --------
   pd.DataFrame
       Feature metadata table of selected components with a MultiIndex of the balance names,
       and a column specifying numerator and denominator
   """
   return obj