This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to make scanpy read gene names to plot instead of read sequences

I am trying to read a CSV file containing processed counts using the following command :

adata = sc.read_csv('GSM4885427_E18_JS-8_processed_counts.csv')

It results in AnnData object with n_obs × n_vars = 31053 × 11392

adata.var_names_make_unique() 
adata.pl.highest_expr_genes(adata, n_top=20, )

This results in a figure like this:

enter image description here

What needs to be done so that it shows gene names instead of these read sequences?

single-cell scanpy scrna-seq

1 answer

At a glance it looks like the data you are reading has cells as columns and genes as rows, while scanpy expects to have cells as rows and genes as columns. You can call sc.read_csv().transpose() to swap them into the correct orientation.

Thank you! It worked!

I've moved LChart's comment to an answer. Please accept it to mark the post as solved.

Log in to answer this question.