Skip to content

Commit

Permalink
bug fix ccf nan size
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhou committed Oct 25, 2023
1 parent 0ba7fbb commit 3603a6d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/pages/1_CCF_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ def _get_min_max():
return np.percentile(x_gamma_all, 5), np.percentile(x_gamma_all, 95)

def _size_mapping(x):
x = x / np.quantile(x, 0.95)
x = x / np.quantile(x[~np.isnan(x)], 0.95)
x_gamma = x**size_gamma
min_x, max_x = _get_min_max()
return size_range[0] + x_gamma / (max_x - min_x) * (size_range[1] - size_range[0])
sizes = size_range[0] + x_gamma / (max_x - min_x) * (size_range[1] - size_range[0])
sizes[np.isnan(sizes)] = 0
return sizes

def _smooth_heatmap(data, sigma):
'''https://stackoverflow.com/questions/18697532/gaussian-filtering-a-image-with-nan-in-python/36307291#36307291'''
Expand Down

0 comments on commit 3603a6d

Please sign in to comment.