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
{{ message }}
Repository navigation
Highlighting key genes in matrixplot/heatmap #1235
Is there way to highlight key genes in the sc.pl.heatmap or sc.pl.matrixplot instead of producing overlapping tick labels when plotting a huge number of genes say 1000? Could we obtain the axes and set tick labels to invisible for specific index?
I understand one way is to expand the figure size but what if only genes of interest could be highlighted alongside showing there are more genes expressed in a particular group.
In R, complexheatmap tool there is this function anno_mark() for this purpose. So looking for something similar.
Thanks
I just made an update in the PR #1210 that will solve the issue. Now you can do:
adata=sc.datasets.pbmc68k_reduced()
# make a heatmap with all the 765 genes in the dataset, highlight each 50th geneax_dict=sc.pl.heatmap(adata, adata.var_names, groupby='louvain', show=False, show_gene_labels=True, figsize=(7,4))
ax_dict['heatmap_ax'].set_xticks(range(len(adata.var_names))[::50])
ax_dict['heatmap_ax'].set_xticklabels(adata.var_names[::50])
Activity
fidelram commentedon May 20, 2020
In principle you can get the 'ax' and set the new labels. But there is a problem with this that I need to fix first.
Properly return axes for heatmap and trackplots (related to #1235)
fidelram commentedon Jun 25, 2020
I just made an update in the PR #1210 that will solve the issue. Now you can do: