Hi,
I am trying to analyze data from this dataset GSE197215 The authors provided RDS Seurat objects that I sucessfully converted to h5ad.
I read in the files, and concatenated them into a single object:
adata_unstimulated = anndata.read_h5ad(unstimulated_file)
adata_mlsn = anndata.read_h5ad(mlsn_file)
adata_tcr = anndata.read_h5ad(tcr_file)
adata_cd19_3T3 = anndata.read_h5ad(cd19_3T3_file)
adata_unstimulated.obs["condition"] = "unstimulated"
adata_mlsn.obs["condition"] = "mesothelin_3T3"
adata_tcr.obs["condition"] = "CD3_CD28_beads"
adata_cd19_3T3.obs["condition"] = "CD19_3T3"
#concatenate the adata objects
adatas = {"unstimulated":adata_unstimulated,
"adata_mlsn": adata_mlsn,
"adata_tcr": adata_tcr,
"adata_cd19_3T3": adata_cd19_3T3}
adata = sc.concat(adatas, join="outer", label="set", index_unique="-")
# I was losing the var layer when concatenating the AnnData objects.
# grab all var DataFrames from our dictionary
# based on this post https://discourse.scverse.org/t/loosing-anndata-var-layer-when-using-sc-concat/1605/2
all_var = [x.var for x in adatas.values()]
# concatenate them
all_var = pd.concat(all_var, join="outer")
# remove duplicates
all_var = all_var[~all_var.index.duplicated()]
adata.var = all_var.loc[adata.var_names]
I recompute the PCA, UMAP, and perform Leiden clustering:
# Recompute PCA
adata = adata[:, ~np.isnan(adata.X).any(axis=0)]
sc.pp.pca(adata)
# Recompute UMAP
sc.pp.neighbors(adata)
sc.tl.umap(adata)
sc.tl.leiden(adata)
# Visualize UMAP with clusters or batch/condition labels
sc.pl.umap(adata, color=['set', 'leiden'])
I am interested in performing differential expression on my clusters:
sc.tl.rank_genes_groups(
adata, groupby="leiden", method="wilcoxon", key_added="dea_leiden"
)
sc.pl.rank_genes_groups_dotplot(
adata, groupby="leiden", standard_scale="var", n_genes=5, key="dea_leiden")
But the resulting plot shows numbers instead of genes. I don’t know if this is some artifact of my concatenation, conversion from seurat, or something else.
My adata.var_names is:
Index(['h-ABCF1', 'h-AC004585.1', 'h-AC012360.3', 'h-AC013264.1',
'h-AC027290.2', 'h-AC027644.3', 'h-AC074032.1', 'h-AC097376.2',
'h-ACAP2', 'h-ACAT2',
...
'h-ZNF512B', 'h-ZNF518A', 'h-ZNF605', 'h-ZNF638', 'h-ZNHIT6',
'h-ZRANB2', 'h-ZRSR2', 'h-ZUP1', 'h-ZWILCH', 'h-ZWINT'],
Any help would be appreciated.