cell2home.collapse_scores

cell2home.collapse_scores(mdata, var_to_bulk, score_key='cell_scores', collapse_key='collapsed')

Average out scores across unique combinations of categories from .var. Will be inserted into the input MuData object under a new key.

Input

mdataMuData

Needs to have an object under score_key to take and use.

var_to_bulklist of str

Column names in the object’s .var to use to compute the score averages. Each unique combination of values of the keys will be represented. Will be present as .var columns in the resulting object.

score_keystr, optional (default: "cell_scores")

The mdata field to use to retrieve the scores to average out.

collapse_keystr, optional (default: "collapsed")

The mdata field to store the averaged out scores into.