Skip to content

Commit

Permalink
accounts for edge case where distribution peak is located at the edge…
Browse files Browse the repository at this point in the history
…, causing one side to have too few unique values
  • Loading branch information
greggj2016 committed May 17, 2024
1 parent 99c8015 commit 84bc835
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions STAR_outliers_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,12 @@ def get_outlier_fit(x, x_spiked, name, pcutoff, spike_vals, prefix):
x_right = np.concatenate([right_half, right_mirror])
all_x_outliers, all_area_overlap = [], []
for x_side, side in [(x_left, "_left"), (x_right, "_right")]:
x_outliers, area_overlap = fit_tukey(x_side, mirrored_data, side, n_bins,
dist_type, (name + side), pcutoff,
spike_vals, prefix, yes_plot_x = False)
if len(np.unique(x_side)) > 5:
x_outliers, area_overlap = fit_tukey(x_side, mirrored_data, side, n_bins,
dist_type, (name + side), pcutoff,
spike_vals, prefix, yes_plot_x = False)
else:
x_outliers, area_overlap = [], 1
all_x_outliers.append(x_outliers)
all_area_overlap.append(area_overlap)

Expand Down

0 comments on commit 84bc835

Please sign in to comment.