problem with importing mtx file in scanpy
1
0
Entering edit mode
4 months ago
QX • 0

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?

scanpy scRNAseq • 604 views
ADD COMMENT
0
Entering edit mode
4 months ago
ATpoint 82k

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.

ADD COMMENT
0
Entering edit mode

hey ATpoint,

Thank for your response, but I think it is actually the problem with anndata as I use exactly same mtx file and script, just re-run on a new conda environments.

I actually downgrade to anndata 0.8.0 and now it works. So I think it is the problem with lastest version!

ADD REPLY

Login before adding your answer.

Traffic: 3110 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6