Skip to content

Commit ca35329

Browse files
committed
adding scaling back into cytovi
1 parent 962143a commit ca35329

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/methods/cytovi/script.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,25 @@
3838

3939
adata_to_correct = adata[:, markers_to_correct].copy()
4040

41+
print("Scaling data", flush=True)
42+
43+
# scale data. this will add a layer "scaled" to the anndata
44+
cytovi.scale(
45+
adata=adata_to_correct,
46+
transformed_layer_key="preprocessed",
47+
batch_key="batch_str",
48+
scaled_layer_key="scaled",
49+
inplace=True,
50+
)
51+
4152
print(
4253
f"Train CytoVI on {adata_to_correct.shape[0]} cells",
4354
flush=True,
4455
)
4556

4657
cytovi.CYTOVI.setup_anndata(
4758
adata_to_correct,
48-
layer="preprocessed",
59+
layer="scaled",
4960
batch_key="batch_str",
5061
sample_key="sample_key_str",
5162
)

0 commit comments

Comments
 (0)