Skip to content

Commit

Permalink
Merge branch 'main' into propagate_fovs
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-l-kong authored Feb 9, 2023
2 parents 5b7794b + 8d698a0 commit 0b37d7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ark/phenotyping/cluster_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,12 @@ def normalize_data(self):
"""
# only 99.9% normalize on the columns provided
cell_data_sub = self.cell_data[self.columns].copy()
cell_data_sub = cell_data_sub.div(cell_data_sub.quantile(0.999))

# compute the 99.9% normalization values, ignoring zeros
cell_norm_vals = cell_data_sub.replace(0, np.nan).quantile(q=0.999, axis=0)

# divide cell_data_sub by normalization values
cell_data_sub = cell_data_sub.div(cell_norm_vals)

# assign back to cell_data
self.cell_data[self.columns] = cell_data_sub
Expand Down

0 comments on commit 0b37d7b

Please sign in to comment.