Skip to content

high memory consumption and nonetype error #341

@wangjiawen2013

Description

@wangjiawen2013

Hi,
I tried to export adata object to mtx format (matrix.mtx, genes.tsv, barcodes.tsv) using besca.export.X_to_mtx while finding that it took a lot o memory. Are there any ways to reduce the memory usage ?
image

Besides, sometimes the following error occured, how to keep avoid of it ?

In [28]: bc.export.X_to_mtx(adata)
writing out matrix.mtx ...
adata.X successfully written to matrix.mtx.
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[28], line 1
----> 1 bc.export.X_to_mtx(adata)

File ~/programs/miniconda3/envs/py311/lib/python3.11/site-packages/besca/export/_export.py:124, in X_to_mtx(adata, outpath, write_metadata, geneannotation, additional_geneannotation)
    122         fp.write(ENSEMBL + "\t" + symbol + "\t" + feature + "\n")
    123 else:
--> 124     for ENSEMBL, symbol in zip(genes_ENSEMBL, genes_SYMBOL):
    125         fp.write(ENSEMBL + "\t" + symbol + "\n")
    126 fp.close()

TypeError: 'NoneType' object is not iterable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions