Skip to content

Commit

Permalink
make sc columns categorical
Browse files Browse the repository at this point in the history
  • Loading branch information
szalata committed Oct 17, 2024
1 parent 214d513 commit 5400682
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/process_dataset/split_sc/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
filtered_sc_counts.uns.clear()
filtered_sc_counts.obsm.clear()
filtered_sc_counts.obsp.clear()
for col in filtered_sc_counts.obs.columns:
if col not in ["cell_count_by_well_celltype", "cell_count_by_plate_well", "obs_id"]:
filtered_sc_counts.obs[col] = filtered_sc_counts.obs[col].astype("category")

print(">> Save sc dataset into splits", flush=True)
filtered_sc_counts[filtered_sc_counts.obs["split"] == "train"].write_h5ad(par["sc_train_h5ad"], compression="gzip")
Expand Down

0 comments on commit 5400682

Please sign in to comment.