Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Fix bug related to the indexes of responsive neurons
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraporta committed Feb 9, 2024
1 parent 9d0e749 commit c325659
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions rsp_vision/analysis/spatial_freq_temporal_freq.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,26 +428,26 @@ def find_significant_rois(
set: A set of ROIs that are significantly responsive based on the
specified criteria.
"""
sig_kw = set(
np.where(
p_values["Kruskal-Wallis test"]
< self.data.config["anova_threshold"]
)[0].tolist()
)
sig_magnitude = set(
np.where(
magnitude_over_medians.groupby("roi").magnitude.max()
> self.data.config["response_magnitude_threshold"]
)[0].tolist()
)
sig_kw_idx = np.where(
p_values["Kruskal-Wallis test"]
< self.data.config["anova_threshold"]
)[0].tolist()

sig_kw = set(self.data.idx_of_neurons[sig_kw_idx])

sig_magnitude_idx = np.where(
magnitude_over_medians.groupby("roi").magnitude.max()
> self.data.config["response_magnitude_threshold"]
)[0].tolist()

sig_magnitude = set(self.data.idx_of_neurons[sig_magnitude_idx])

if self.data.config["consider_only_positive"]:
sig_positive = set(
np.where(
p_values["Wilcoxon signed rank test"]
< self.data.config["only_positive_threshold"]
)[0].tolist()
)
sig_positive_idx = np.where(
p_values["Wilcoxon signed rank test"]
< self.data.config["only_positive_threshold"]
)[0].tolist()
sig_positive = set(self.data.idx_of_neurons[sig_positive_idx])
sig_kw = sig_kw & sig_positive

return sig_kw & sig_magnitude
Expand Down

0 comments on commit c325659

Please sign in to comment.