problem with importing mtx file in scanpy
Hi All,
I try to import an mtx file (with features and barcode) as scanpy objects:
adata= sc.read_10x_mtx(data_dir, var_names='gene_symbols', cache=True)
however, an error occurs:
(path)/envs/sc/lib/python3.11/site-packages/anndata/_core/anndata.py:1908: UserWarning: Variable names are not unique. To make them unique, call `.var_names_make_unique`.
utils.warn_names_duplicates("var")
I used to use exactly the same script and it work before, until I run on a new (conda) envs and new version of scanpy. I try scanpy 1.9.6, 1.9.5, 1.9.4 already but it still run into the same problems.
Anyone have the same issue before?
• 2,745 views
•
link
1 answer
It tells you that you have duplicates in gene names, which is normal because gene names are a mess and there indeed are overlaps. My recommendation is to use either Ensembl gene ID (ENSG...) or geneID_geneName, like ENSG000(...)_Gapdh since this guarantees uniqueness.
• 0 views
•
link
Log in to answer this question.