You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get the gene expression raw, log, scaled for just a couple of genes from the anndata object but i have tried doesnt seem to work. I just want a simple dataframe with the gene names as colum indexes and row info of the cells. this is waht i used to do in seurat. I am sure there is an easy way to do this in scanpy but just havent figure out.
If adata is your anndata object, you can get the expression data from adata.X. Depending on what you did to the object before, that will contain differently pre-processed data.
If you want it for "Gene A", then you can use adata[:,'Gene A'].Xto get the expression value of Gene A in all cells.
You can of course put that into a pandas dataframe via pd.DataFrame()
Hi! I hope you’ll enjoy using scanpy. Beginner questions like this are more suited for https://scanpy.discourse.group/ or stackoverflow so we still have some overview over this bug tracker.
Hi guys,
I am trying to get the gene expression raw, log, scaled for just a couple of genes from the anndata object but i have tried doesnt seem to work. I just want a simple dataframe with the gene names as colum indexes and row info of the cells. this is waht i used to do in seurat. I am sure there is an easy way to do this in scanpy but just havent figure out.
geneX_df=as.data.frame(as.matrix(GetAssayData(object = anndata, slot = "data")["geneX",]))
Thanks!
The text was updated successfully, but these errors were encountered: