Skip to content

Commit

Permalink
chunkwise_writing made simpler, old pipeline replica
Browse files Browse the repository at this point in the history
  • Loading branch information
Saiyam26 committed Sep 12, 2024
1 parent 8a19e0e commit fb361b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scalr/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,15 @@ def write_chunkwise_data(datapath: str,

for i, (start) in enumerate(range(0, len(sample_inds), sample_chunksize)):
data = read_data(datapath)
data = data[sample_inds[start:start + sample_chunksize]]

if feature_inds:
data = data[sample_inds[start:start + sample_chunksize],
feature_inds]
else:
data = data[sample_inds[start:start + sample_chunksize]]

if not isinstance(data, AnnData):
data = data.to_adata()
if feature_inds:
data = data[:, feature_inds]
data = data.to_memory()

# Transformation
Expand Down

0 comments on commit fb361b0

Please sign in to comment.