Skip to content

Commit

Permalink
fix edge case for TST_grouped_benjamini_hochberg when nothing in grou…
Browse files Browse the repository at this point in the history
…p is significant
  • Loading branch information
Bribak committed Feb 26, 2024
1 parent 791175b commit 78a86f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion glycowork/glycan_data/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,10 @@ def TST_grouped_benjamini_hochberg(identifiers_grouped, p_values_grouped, alpha)
# Estimate π0 for the group within the Two-Stage method
pi0_estimate = pi0_tst(group_p_values, alpha)
if pi0_estimate == 1:
adjusted_p_values[group] = [1.0] * len(group_p_values)
group_adjusted_p_values = [1.0] * len(group_p_values)
for identifier, corrected_pval in zip(identifiers_grouped[group], group_adjusted_p_values):
adjusted_p_values[identifier] = corrected_pval
significance_dict[identifier] = False
continue
n = len(group_p_values)
sorted_indices = np.argsort(group_p_values)
Expand Down

0 comments on commit 78a86f6

Please sign in to comment.