aind-dynamic-foraging-basic-analysis 0.3.1__py3-none-any.whl → 0.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  """Init package"""
2
2
 
3
- __version__ = "0.3.1"
3
+ __version__ = "0.3.2"
4
4
 
5
5
  from .foraging_efficiency import compute_foraging_efficiency # noqa: F401
6
6
  from .plot.plot_foraging_session import plot_foraging_session # noqa: F401
@@ -14,7 +14,9 @@ from aind_dynamic_foraging_basic_analysis.plot.style import (
14
14
  )
15
15
 
16
16
 
17
- def plot_session_scroller(nwb, ax=None, plot_bouts=False): # noqa: C901 pragma: no cover
17
+ def plot_session_scroller( # noqa: C901 pragma: no cover
18
+ nwb, ax=None, plot_bouts=False, processing="bright"
19
+ ):
18
20
  """
19
21
  Creates an interactive plot of the session.
20
22
  Plots left/right licks/rewards, and go cues
@@ -77,14 +79,30 @@ def plot_session_scroller(nwb, ax=None, plot_bouts=False): # noqa: C901 pragma:
77
79
  "right_reward_top": 0.75,
78
80
  "go_cue_bottom": 0,
79
81
  "go_cue_top": 1,
80
- "G_1_preprocessed_bottom": 1,
81
- "G_1_preprocessed_top": 2,
82
- "G_2_preprocessed_bottom": 2,
83
- "G_2_preprocessed_top": 3,
84
- "R_1_preprocessed_bottom": 3,
85
- "R_1_preprocessed_top": 4,
86
- "R_2_preprocessed_bottom": 4,
87
- "R_2_preprocessed_top": 5,
82
+ "G_1_dff-bright_bottom": 1,
83
+ "G_1_dff-bright_top": 2,
84
+ "G_2_dff-bright_bottom": 2,
85
+ "G_2_dff-bright_top": 3,
86
+ "R_1_dff-bright_bottom": 3,
87
+ "R_1_dff-bright_top": 4,
88
+ "R_2_dff-bright_bottom": 4,
89
+ "R_2_dff-bright_top": 5,
90
+ "G_1_dff-poly_bottom": 1,
91
+ "G_1_dff-poly_top": 2,
92
+ "G_2_dff-poly_bottom": 2,
93
+ "G_2_dff-poly_top": 3,
94
+ "R_1_dff-poly_bottom": 3,
95
+ "R_1_dff-poly_top": 4,
96
+ "R_2_dff-poly_bottom": 4,
97
+ "R_2_dff-poly_top": 5,
98
+ "G_1_dff-exp_bottom": 1,
99
+ "G_1_dff-exp_top": 2,
100
+ "G_2_dff-exp_bottom": 2,
101
+ "G_2_dff-exp_top": 3,
102
+ "R_1_dff-exp_bottom": 3,
103
+ "R_1_dff-exp_top": 4,
104
+ "R_2_dff-exp_bottom": 4,
105
+ "R_2_dff-exp_top": 5,
88
106
  }
89
107
  yticks = [
90
108
  (params["left_lick_top"] - params["left_lick_bottom"]) / 2 + params["left_lick_bottom"],
@@ -99,24 +117,51 @@ def plot_session_scroller(nwb, ax=None, plot_bouts=False): # noqa: C901 pragma:
99
117
 
100
118
  if fip_df is not None:
101
119
  fip_channels = [
102
- "G_2_preprocessed",
103
- "G_1_preprocessed",
104
- "R_2_preprocessed",
105
- "R_1_preprocessed",
120
+ "G_2_dff-{}".format(processing),
121
+ "G_1_dff-{}".format(processing),
122
+ "R_2_dff-{}".format(processing),
123
+ "R_1_dff-{}".format(processing),
106
124
  ]
107
125
  present_channels = fip_df["event"].unique()
108
126
  for index, channel in enumerate(fip_channels):
109
127
  if channel in present_channels:
110
128
  yticks.append(
111
- (params[channel + "_top"] - params[channel + "_bottom"]) / 2
129
+ (params[channel + "_top"] - params[channel + "_bottom"]) * 1
112
130
  + params[channel + "_bottom"]
113
131
  )
114
132
  ylabels.append(channel)
115
133
  color = FIP_COLORS.get(channel, "k")
116
134
  ycolors.append(color)
117
135
  C = fip_df.query("event == @channel").copy()
118
- C["data"] = C["data"] - C["data"].min()
119
- C["data"] = C["data"].values / C["data"].max()
136
+ d_min = C["data"].min()
137
+ d_max = C["data"].max()
138
+ d_range = d_max - d_min
139
+ t1 = 0.25
140
+ t2 = 0.5
141
+ t3 = 0.75
142
+ p1 = d_min + t1 * d_range
143
+ p2 = d_min + t2 * d_range
144
+ p3 = d_min + t3 * d_range
145
+ yticks.append(
146
+ params[channel + "_bottom"]
147
+ + (params[channel + "_top"] - params[channel + "_bottom"]) * t1
148
+ )
149
+ yticks.append(
150
+ params[channel + "_bottom"]
151
+ + (params[channel + "_top"] - params[channel + "_bottom"]) * t2
152
+ )
153
+ yticks.append(
154
+ params[channel + "_bottom"]
155
+ + (params[channel + "_top"] - params[channel + "_bottom"]) * t3
156
+ )
157
+ ylabels.append(str(round(p1, 3)))
158
+ ylabels.append(str(round(p2, 3)))
159
+ ylabels.append(str(round(p3, 3)))
160
+ ycolors.append("darkgray")
161
+ ycolors.append("darkgray")
162
+ ycolors.append("darkgray")
163
+ C["data"] = C["data"] - d_min
164
+ C["data"] = C["data"].values / (d_max - d_min)
120
165
  C["data"] += params[channel + "_bottom"]
121
166
  ax.plot(C.timestamps.values, C.data.values, color)
122
167
  ax.axhline(params[channel + "_bottom"], color="k", linewidth=0.5, alpha=0.25)
@@ -226,6 +271,10 @@ def plot_session_scroller(nwb, ax=None, plot_bouts=False): # noqa: C901 pragma:
226
271
  ax.set_ylim(0, 5)
227
272
  ax.spines["top"].set_visible(False)
228
273
  ax.spines["right"].set_visible(False)
274
+ if fip_df is not None:
275
+ ax.set_title(nwb.session_id + ", FIP processing: {}".format(processing))
276
+ else:
277
+ ax.set_title(nwb.session_id)
229
278
  plt.tight_layout()
230
279
 
231
280
  def on_key_press(event):
@@ -16,17 +16,29 @@ PHOTOSTIM_EPOCH_MAPPING = {
16
16
  # Colorscheme for FIP channels
17
17
  FIP_COLORS = {
18
18
  "G_1": "g",
19
- "G_1_preprocessed": "g",
19
+ "G_1_dff-bright": "g",
20
+ "G_1_dff-exp": "g",
21
+ "G_1_dff-poly": "g",
20
22
  "G_2": "darkgreen",
21
- "G_2_preprocessed": "darkgreen",
23
+ "G_2_dff-bright": "darkgreen",
24
+ "G_2_dff-exp": "darkgreen",
25
+ "G_2_dff-poly": "darkgreen",
22
26
  "R_1": "r",
23
- "R_1_preprocessed": "r",
27
+ "R_1_dff-bright": "r",
28
+ "R_1_dff-exp": "r",
29
+ "R_1_dff-poly": "r",
24
30
  "R_2": "darkred",
25
- "R_2_preprocessed": "darkred",
31
+ "R_2_dff-bright": "darkred",
32
+ "R_2_dff-exp": "darkred",
33
+ "R_2_dff-poly": "darkred",
26
34
  "Iso_1": "gray",
27
- "Iso_1_preprocessed": "gray",
35
+ "Iso_1_dff-bright": "gray",
36
+ "Iso_1_dff-exp": "gray",
37
+ "Iso_1_dff-poly": "gray",
28
38
  "Iso_2": "k",
29
- "Iso_2_preprocessed": "k",
39
+ "Iso_2_dff-bright": "k",
40
+ "Iso_2_dff-exp": "k",
41
+ "Iso_2_dff-poly": "k",
30
42
  "goCue_start_time": "b",
31
43
  "left_lick_time": "m",
32
44
  "right_lick_time": "r",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aind-dynamic-foraging-basic-analysis
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Generated from aind-library-template
5
5
  Author: Allen Institute for Neural Dynamics
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- aind_dynamic_foraging_basic_analysis/__init__.py,sha256=UDmicN3j1fKmUzyDsV0LZQzRnicUWPjMyR4TqPAD7dk,194
1
+ aind_dynamic_foraging_basic_analysis/__init__.py,sha256=6BHc0q6Dvew_VVVzYJv9Xa8ZTRIPNQif1j8GGVII2c0,194
2
2
  aind_dynamic_foraging_basic_analysis/foraging_efficiency.py,sha256=9IhMqQo_aU_RFsDu8D2P3-Qu3J72bo7sASC3dkUQ2YE,8634
3
3
  aind_dynamic_foraging_basic_analysis/data_model/foraging_session.py,sha256=7PFHfEIXP3QcjFS9Fk88S7PzBBYnUYw81WBjjEu_UKo,3536
4
4
  aind_dynamic_foraging_basic_analysis/licks/annotation.py,sha256=HGK9t0WGPtkj8NzUR-4r2PeOIvtPE_5dfW_8i-6Zs0w,6019
@@ -6,10 +6,10 @@ aind_dynamic_foraging_basic_analysis/licks/lick_analysis.py,sha256=tgFqowzXHMRW2
6
6
  aind_dynamic_foraging_basic_analysis/plot/plot_fip.py,sha256=_KiEAonrsDrV-ReipDzKEPoKFTgV_E9IUCwVJTR5jac,8414
7
7
  aind_dynamic_foraging_basic_analysis/plot/plot_foraging_session.py,sha256=yfxqEu522DkBaD20R8BBBAmII4asu3mZ3psGUdUxqEQ,11534
8
8
  aind_dynamic_foraging_basic_analysis/plot/plot_foraging_session_plotly.py,sha256=wE-kl1W6KZjaMX08bjawWfSuse6KW6YNSxDbdph3XK0,6715
9
- aind_dynamic_foraging_basic_analysis/plot/plot_session_scroller.py,sha256=-0kRchOSbrmDBSHZvTmw5iDTiI-VdtY9Tt3ln3xQibQ,8565
10
- aind_dynamic_foraging_basic_analysis/plot/style.py,sha256=vmrUdlCWeTDH9XJJKz7UBTchKlIP_8lhagjtwjjBPEc,823
11
- aind_dynamic_foraging_basic_analysis-0.3.1.dist-info/LICENSE,sha256=U0Y7B3gZJHXpjJVLgTQjM8e_c8w4JJpLgGhIdsoFR1Y,1092
12
- aind_dynamic_foraging_basic_analysis-0.3.1.dist-info/METADATA,sha256=MtuiGy4GD31xf_C7q_RI6ur0J5E7lJOVFMm86A1gmlo,6737
13
- aind_dynamic_foraging_basic_analysis-0.3.1.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
14
- aind_dynamic_foraging_basic_analysis-0.3.1.dist-info/top_level.txt,sha256=gc5fvvd3cR7uvCHkTaSx-TcC4JmKMt9dBYMPncEO8VY,37
15
- aind_dynamic_foraging_basic_analysis-0.3.1.dist-info/RECORD,,
9
+ aind_dynamic_foraging_basic_analysis/plot/plot_session_scroller.py,sha256=GDPLIXl2y3JCvRwaiY2YFJXlubvgwzCwpPvjtd2_j-c,10430
10
+ aind_dynamic_foraging_basic_analysis/plot/style.py,sha256=VtGdmdxPEBt4dBrKRrYbscZE94-3wGfp564BphacF0I,1147
11
+ aind_dynamic_foraging_basic_analysis-0.3.2.dist-info/LICENSE,sha256=U0Y7B3gZJHXpjJVLgTQjM8e_c8w4JJpLgGhIdsoFR1Y,1092
12
+ aind_dynamic_foraging_basic_analysis-0.3.2.dist-info/METADATA,sha256=jNsT6dAvnUosSpVC_FaF0EqSiVwk8aDxTfdMadtJDLI,6737
13
+ aind_dynamic_foraging_basic_analysis-0.3.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
14
+ aind_dynamic_foraging_basic_analysis-0.3.2.dist-info/top_level.txt,sha256=gc5fvvd3cR7uvCHkTaSx-TcC4JmKMt9dBYMPncEO8VY,37
15
+ aind_dynamic_foraging_basic_analysis-0.3.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.2)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5