How to make scanpy read gene names to plot instead of read sequences
1
0
Entering edit mode
16 months ago
shome ▴ 10

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 • 986 views
ADD COMMENT
2
Entering edit mode
16 months ago
LChart 3.9k

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.

ADD COMMENT
0
Entering edit mode

Thank you! It worked!

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2674 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6