I am looking for the expression of 'NCAM1'. It works when I am plotting my data (umap, violin plot, matrix plot) but I cant find it in the adata.var and I am not able to subset adata for this particular gene while it is working with the other genes.
#what works:
marker_genes = ['NCAM1']
ax = sc.pl.violin(adata, marker_genes, groupby='timepoint')
# what doesnt work:
subset_NCAM = adata[:, 'NCAM1']
"None of [Index(['NCAM1'], dtype='object', name='index')] are in the [index]"
1.4.4
Hi @shendong124,
My guess is that 'NCAM1' is in your adata.raw.var_names but not in adata.var_names. Could it be that you have filtered your adata after assigning adata.raw? When you plot gene expression, adata.raw is used to plot expression values by default.
This was very helpful! thank you!