Hi,
I generated two umaps using the same dataset but with one I first plotted background cells (in gray) before the cells of interest. The shapes of the two umaps are different.
The code for the regular umap:
sc.pp.highly_variable_genes(
adata0,
n_top_genes=2000,
subset=True,
layer="counts",
flavor="seurat_v3",
)
sc.tl.pca(adata0)
sc.pp.neighbors(adata0, n_pcs=30, n_neighbors=20)
sc.tl.umap(adata0, min_dist=0.3)
sc.pl.umap(
adata0,
color=["gse"],
frameon=False,
)
The code for the umap first plotting background cells before the cells of interest:
sc.pp.highly_variable_genes(
adata0,
n_top_genes=2000,
subset=True,
layer="counts",
flavor="seurat_v3",
)
sc.tl.pca(adata0)
sc.pp.neighbors(adata0, n_pcs=30, n_neighbors=20)
sc.tl.umap(adata0, min_dist=0.3)
adata = adata0[adata0.obs.clone != 'None']
ax=sc.pl.umap(adata0, show=False, frameon=False, size=5)
adata = adata0[adata0.obs.clone != 'None']
sc.pl.umap(
adata,
color=["clone"],
frameon=False,
size=5,
ax = ax,
)
The resulting umap for regular umap:
The resulting umap when background cells first plotted:
As you can see the two umaps have different shapes. Any ideas? Thanks.