netmap.downstream.edge_selection.chunked_argsort¶
- netmap.downstream.edge_selection.chunked_argsort(unsadata, layer_name='sorted', chunk_size=500, dtype=None)[source]¶
Compute
np.argsortonadata.Xin chunks to reduce peak memory usage.Processes
unsadata.Xrow-by-row in batches ofchunk_size, writing the sorted column-index order for each row into a pre-allocated layer. The integer dtype is chosen automatically to be as small as possible given the number of variables.- Parameters:
unsadata (anndata.AnnData) – AnnData object to process. Modified in-place by adding
layers[layer_name].layer_name (str) – Name of the new layer to create. Defaults to
'sorted'.chunk_size (int) – Number of rows (cells) to process per iteration. Defaults to 500.
dtype (numpy.dtype or None) – Integer dtype for the output array. If
None,uint16is used whenn_vars < 65535, otherwiseuint32.
- Returns:
None. Modifies
unsadatain-place by addinglayers[layer_name].