mantispy.tl.rank_features#
- mantispy.tl.rank_features(adata, groupby, method='wilcoxon', key_added='rank_features', copy=False)#
Rank features by how well they separate each group, with the annotation attached.
Wraps
scanpy.tl.rank_genes_groups()and joins the parsedvarannotation onto the result, so each ranked feature carries its object, feature group and channel.- Parameters:
adata (
AnnData) – Object to rank.groupby (
str) –obscolumn defining the groups.method (
str(default:'wilcoxon')) – Passed to scanpy:"wilcoxon","t-test","logreg".key_added (
str(default:'rank_features')) – Name for the output table.copy (
bool(default:False)) – Return a modified copy instead of mutating in place.
- Return type:
- Returns:
None, or the modified copy. Writesuns["mantispy"][key_added]withgroup,feature,score,pvalue,qvalueand theobject,feature_groupandchannelthe feature belongs to.
Notes
scanpy’s
logfoldchangescolumn is dropped. Normalized morphology features are signed, so the ratio is often negative and its log is NaN or meaningless. Rank byscore.