Hi I am relatively new to using scanpy and I was recently trying to figure out how to plot a UMAP for multiple .mtx files. I have been able to color specific genes and number the umap leiden cluster for a single .mtx but I am unable to overlay two .mtx files for a singular UMAP without getting a positional argument error. I have tried the following to concatenate my .mtx files as so:
adata_healthy_raw_rna = sc.read_10x_mtx(‘healthy_MTX/healthy_raw_rna’, var_names=‘gene_symbols’, cache=True)
adata_cll_rna_raw = sc.read_10x_mtx(‘cll_MTX/cll_rna_raw’,var_names=‘gene_symbols’, cache=True)
adataFiles = [adata_healthy_raw_rna, adata_cll_rna_raw ]
adata_concatenated = adataFiles .concatenate(adataFiles [1:], index_unique=None)
and after doing so tried plotting the UMAP as such:
sc.pl.umap(adata_concatenated, color=[adata_healthy_raw_rna, adata_cll_rna_raw )
However, I am getting this error:
/usr/local/lib/python3.7/dist-packages/anndata/_core/anndata.py:1785: FutureWarning: X.dtype being converted to np.float32 from float64. In the next version of anndata (0.9) conversion will not be automatic. Pass dtype explicitly to avoid this warning. Pass
AnnData(X, dtype=X.dtype, ...) to get the future behavour.
[AnnData(sparse.csr_matrix(a.shape), obs=a.obs) for a in all_adatas],
KeyError: “Could not find ‘umap’ or ‘X_umap’ in .obsm”
The data successfully concatenates the two .mtx files but how do I correctly plot a UMAP with a concatenated .mtx file such that I can differentiate the two files by color?