Hi I found this function in Scanpy search. I wonder how I can an example to use this function? My motivation is posted in my last post: how can I get a subset of adata by getting cells in which CD8A gene expression is detectable? Many thx!
This function gets a dataframe whose index is the
var_names from the
AnnData object. It’s mainly a helper function for use in plotting.
You could call:
sc.get.var_df(adata, ["ensembl_id"], obsm_keys=[("PCs", 0))]) to get the ensembl ids and loading in the first principal component for each gene.
sc.get.obs_df(adata, "CD8A") is probably closer to what you want, or even just
adata[adata[:, "CD8A"].X > cutoff].