STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
179 stars 59 forks source link

read_gef() with bin_size = 1 fails #254

Closed LeonieKuechenhoff closed 3 months ago

LeonieKuechenhoff commented 3 months ago

When I try to read in my gef file with a bin size of 1, I get the following error message:

[2024-03-19 11:12:23][Stereo][2860691][MainThread][22949910382400][reader][1070][INFO]: read_gef begin ...

Traceback (most recent call last) in read_gef(file_path, bin_type, bin_size, is_sparse, gene_list, region, gene_name_index) 1223 cell_names = gef.get_cell_names() 1224 cell_num = gef.get_cell_num() -> 1225 gene_names, gene_id = gef.get_gene_names() 1226 gene_num = gef.get_gene_num() 1227 data.position = np.array(list( 1228 (zip(np.right_shift(cell_names, 32), np.bitwise_and(cell_names, 0xffffffff))))).astype('uint32')

File gefpy/bgef_reader_cy.pyx:87, in gefpy.bgef_reader_cy.BgefR.get_gene_names()

File stringsource:61, in vector.to_py.pyx_convert_vector_to_py_std_3a3a_string()

File stringsource:38, in string.to_py.pyx_convert_PyUnicode_string_to_py_stdin_string()

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

I have no problems reading in the file with any other bin size. Thanks for your help.

tanliwei-coder commented 3 months ago

Upgrade gefpy(1.1.3) to latest to clear this error.