Which values do you use to visualise gene expression?

I’m a bit confused about visualising the gene expression values after training a model.
The tutorial uses “raw” values(I guess these are log1p library size-normalised?) for dotplot:

sc.pl.dotplot(
    adata,
    markers,
    groupby='cell_type',
    dendrogram=True,
    color_map="Blues",
    swap_axes=True,
    use_raw=True,
    standard_scale="var",
)

But next paragraph says:

We can also visualize the scVI normalized gene expression values with the layer option.

:
sc.pl.heatmap(
    adata,
    markers,
    groupby='cell_type',
    layer="scvi_normalized",
    standard_scale="var",
    dendrogram=True,
)

So, which values do you use? Here’re plots I made for my dataset. The first one uses SCVI-decoded values, and the second - log1p library size-normalised.

As you can see, all cells in a group seem to express the markers when using SCVI-decoded values. That seems a bit meaningless coming from other tools (like SCT-normalised values in Seurat).

Would appreciate any help.

scvi_normalized values contain small non-zero values which make the dot size the same for all dots. You can use a cutoff of something like 0.1 and rerun it.
Gernerally, I prefer starting with log1p values for dotplots.
It might make sense to use the scvi_normalized values if you need a batch-corrected expression value (most of the times not essential).
As we show in the tutorial other visualizations like heatmaps don’t require a hard threshold at 0 and are preferable for usage with scvi_normalized values.

3 Likes

Thanks for the suggestion @cane11. I could not find the cutoff option you mention in the documentation. Could you please give an example of how to implement it?

@f6v, manually zeroing the values seems to work:
adata_scvi.layers['scvi_normalized'][adata_scvi.X.toarray()==0] = 0

1 Like

It’s an option in sc.pl.dotplot.
Expression_cutoff and set it to something like 0.1.

1 Like