Skip to content

Commit 3f13cb6

Browse files
authoredFeb 14, 2025··
Do not remap indices (#86)
1 parent f8be7b9 commit 3f13cb6

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed
 

‎src/cellarr/queryutils_tiledb_frame.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -137,29 +137,29 @@ def subset_array(
137137
data = tiledb_obj.multi_index[row_subset, column_subset]
138138

139139
# Fallback just in case
140-
# shape = (
141-
# tiledb_obj.nonempty_domain()[0][1] + 1,
142-
# tiledb_obj.nonempty_domain()[1][1] + 1,
143-
# )
140+
shape = (
141+
tiledb_obj.nonempty_domain()[0][1] + 1,
142+
tiledb_obj.nonempty_domain()[1][1] + 1,
143+
)
144144

145-
# mat = sp.coo_matrix(
146-
# (data["data"], (data["cell_index"], data["gene_index"])),
147-
# shape=shape,
148-
# ).tocsr()
145+
mat = sp.coo_matrix(
146+
(data["data"], (data["cell_index"], data["gene_index"])),
147+
shape=shape,
148+
).tocsr()
149149

150-
# if row_subset is not None:
151-
# mat = mat[row_subset, :]
150+
if row_subset is not None:
151+
mat = mat[row_subset, :]
152152

153-
# if column_subset is not None:
154-
# mat = mat[:, column_subset]
153+
if column_subset is not None:
154+
mat = mat[:, column_subset]
155155

156-
_cell_rows, _ = _remap_index(data["cell_index"])
157-
_gene_cols, _ = _remap_index(data["gene_index"])
156+
# _cell_rows, _ = _remap_index(data["cell_index"])
157+
# _gene_cols, _ = _remap_index(data["gene_index"])
158158

159-
mat = sp.coo_matrix(
160-
(data["data"], (_cell_rows, _gene_cols)),
161-
shape=shape,
162-
)
159+
# mat = sp.coo_matrix(
160+
# (data["data"], (_cell_rows, _gene_cols)),
161+
# shape=shape,
162+
# )
163163

164164
return mat
165165

0 commit comments

Comments
 (0)
Please sign in to comment.