Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions for Pinto lab #18

Closed
2 tasks done
weiglszonja opened this issue Nov 22, 2023 · 0 comments
Closed
2 tasks done

Questions for Pinto lab #18

weiglszonja opened this issue Nov 22, 2023 · 0 comments

Comments

@weiglszonja
Copy link
Collaborator

weiglszonja commented Nov 22, 2023

Keep track final questions and missing metadata for the Pinto lab:

Subject metadata

On Q1, ear_tag_id is not necessary, but it might be nice to add zygosity. I’ll let the others pitch in on the the other questions.

Imaging session examples

imaging_folder_path imaging_type note
NCCR51_2023_04_07_no_task_dual_color_jrgeco_t_series-001 twophoton single plane, single color
NCCR32_2022_11_03_IntoTheVoid_t_series-005 twophoton dual plane, single color
NCCR32_2023_02_20_Into_the_void_t_series_baseline-000 twophoton single plane, single color
NCCR32_2023_02_20_Into_the_void_t_series_stim-000 twophoton single plane, single color, with stim
NCCR62_2023_07_06_IntoTheVoid_t_series_Dual_color-000 twophoton single plane, dual color
TS12_20220407_20hz_noteasy_1 widefield single plane, single color
DrChicken_20230419_20hz widefield single plane, single color

Behavior

ViRMEN_filename imaging_type has_eyetracking imaging_folder_path
NCCR51_TowersTaskSwitchEasy_Session_20230407_143948 widefield FALSE NCCR51_2023_04_07_no_task_dual_color_jrgeco_t_series-001
NCCR47_TowersTaskSwitchEasy_Session_20230522_105332 twophoton FALSE
TS12_TowersTaskSwitch_Session_20220407_150700 widefield FALSE TS12_20220407_20hz_noteasy_1
JsCheddarGeese_TowersTaskSwitchEasy_Session_20230522_151257 widefield TRUE
DrChicken_TowersTaskSwitchEasy_Session_20230419_105733 widefield TRUE DrChicken_20230419_20hz
Coriander_DelayedMatchToEvidence_Session_20230615_101750 not sure FALSE
  • We need at least one complete session for widefield and two photon where we have both the ViRMEN data and the eyetracking data with the synchronised timestamps to make sure the behavior times are set correctly

Currently we have an example for eyetracking and timestamps for a session where we have no imaging data (Cherry_20230801_30hz)

Theoretically "im_frame_timestamps" should match each eye tracking frame to the behavioral clock in seconds, and "behav_trial_by_im_frame" corresponds each frame to the trial the mouse is performing.
"position_by_im_frame" and "velocity_by_im_frame" find all the ViRMEN iterations corresponding to each eyetracking frame and store the average [x y theta] position/velocity by frame.

Unfortunately, there is no eyetracking data recorded for the sessions Chicken_TowersTaskSwitchEasy_Session_20230419_105733 (widefield), and eyetracking has not been set up with two-photon yet.
But I will ask Keith to share the wf data for this session Cherry_20230802 with its pose and sync data from eye tracking attached below. Thank you so much!

  • The folder is empty, sent the email to notify them about it.

ViRMEN

  • How to adjust trial times?

Re. Q3 – Since the behavioral and widefield data are collected on two separate computers at different sampling rate, syncing the two data streams involves a few steps of down sampling and aligning the speed of the two computer clocks. I went back and saved the final outputs of behavior-widefield time syncing under the session folder of a widefield recording as ‘wf_behav_sync.mat’. Within this .mat, you’ll find various conversions between widefield frames and virmen iterations that would allow you to sync behavioral data with widefield recordings. There are a few things worth some attention here: 1) im_frame_by_behav_iter stores 1-indexed widefield frames by virmen iteration. It typically starts with some -1s, this is because the acquisition of widefield frames is triggered by virmen, though on a separate computer, therefore there will always be a few virmen iterations without widefield frames. 2) In order to empirically compute the ratio between the speed of the two computer clocks, we need to end the widefield recording before the behavioral session (I can elaborate if the details are relevant). The field ‘behav_has_all_wf_frames’ indicates if the widefield session is entirely contained within the behavioral session and the field ‘last_behav_wf_frame’ indicate the last widefield frame within the behavioral session. In the case where the session is terminated in the correct order (widefield -> behavior), behave_has_all_wf_frames = 1 and last_behav_wf_frame will be the last widefield frame. If the session is terminated in the incorrect order (behavior -> widefield), behave_has_all_wf_frames = 0 and last_behav_wf_frame will be the last widefield frame before the behavioral session was terminated and all the subsequent widefield frames will have no corresponding behavioral data. 3) In the case where the session is terminated in the correct order, there will be virmen iterations not associated with any widefield frames at the end of the session. There is a bug in logging im_frame_by_behav_iter where all the virmen iterations after the widefield recording has been terminated are assigned to the last frame. We haven’t fixed this because it will involve repopulating all the already synced sessions. It is safe to assume only 12 of them actually took place during the exposure of the last widefield frame given the widefield and virmen sampling rates. In terms of aligning behavior with widefield recording and then partitioning everything down to trials, you could down sample behavioral data by virmen iteration to widefield frame rate and then partition to trials using behave_trial_by_im_frame.

Screenshot 2023-11-23 at 15 18 34
  • "start_time": denotes the start time of each trial in seconds relative to the global session start time

currently using the "StartOfTrial" column from .mat file

  • "stop_time": denoted the end time of each trial in seconds relative to the global session start time

currently using the "EndOfTrial" column from the .mat file

We received the synchronised timestamps to use for setting the behavior timestamps (sync_data.mat), this file contains an "im_frame_timestamps" that contains the timestamps for the eye tracking data that are relative to the imaging time.

  • Is it sufficient to shift the times of the trials by the aligned start time of the behavior?

We need an actual example of synchronised behavior timestamps where we have the matching imaging session, together with the ViRMEN output, this is the only way to make sure we are setting the timestamps correctly across behavior.

  • What is the reference frame for Position?

For the position, our convention across tasks and mazes is that position (0,0) is the start of the "sample" region (also referred to as the "cue" region) (note that this is not the position where the mouse starts each trial, which varies by maze and task).

  • One of the shared ViRMEN files an "optoVoltageOut" field "JsCheddarGeese_TowersTaskSwitchEasy_Session_20230522_151257" which ought to have a corresponding widefield imaging data (not shared with us), what is this data, should this be added to the NWB file?

Stimulation

We need to reconstruct the time series of stimulation, where the first dimension is frame time ("absoluteTime" from XML) and the second dimension is the number of cells that are being stimulated.

To reconstruct the order of stimulation from the mark points xml files, we need to make sure that we are processing the files correctly:

<PVMarkPointSeriesElements Category="multi_cell_stim_30_points" Name="SLM_30_pseudorandom_10" Iterations="1" IterationDelay="0.00" CalcFunctMap="False">
  <PVMarkPointElement Repetitions="5" UncagingLaser="Monaco" UncagingLaserPower="400" TriggerFrequency="None" TriggerSelection="None" TriggerCount="1" AsyncSyncFrequency="None" VoltageOutputCategoryName="None" VoltageRecCategoryName="None" parameterSet="CurrentSettings">
    <PVGalvoPointElement InitialDelay="15000" InterPointDelay="35" Duration="15" SpiralRevolutions="5" AllPointsAtOnce="True" Use3D="False" Points="Group 2" Indices="11-20">
      <Point Index="11" X="0.244959174484967" Y="0.129455213619052" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="12" X="0.263193759963008" Y="0.0824014245326254" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="13" X="0.558654481883044" Y="0.289053975670996" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="14" X="0.065312711682222" Y="0.444247719409258" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="15" X="0.829056084887867" Y="0.323306440818213" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="16" X="0.290936046110726" Y="0.614761678774383" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="17" X="0.219902083662898" Y="0.629668163399408" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="18" X="0.779489488393223" Y="0.777581052742591" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="19" X="0.22288540868105" Y="0.775867314033998" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="20" X="0.55324150127567" Y="0.726225678092943" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
    </PVGalvoPointElement>
  </PVMarkPointElement>
  <PVMarkPointElement Repetitions="5" UncagingLaser="Monaco" UncagingLaserPower="400" TriggerFrequency="None" TriggerSelection="None" TriggerCount="1" AsyncSyncFrequency="None" VoltageOutputCategoryName="None" VoltageRecCategoryName="None" parameterSet="CurrentSettings">
    <PVGalvoPointElement InitialDelay="3" InterPointDelay="35" Duration="15" SpiralRevolutions="5" AllPointsAtOnce="True" Use3D="False" Points="Group 3" Indices="21-30">
      <Point Index="21" X="0.640033747469953" Y="0.0614025480962288" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="22" X="0.171501640727355" Y="0.104856471848038" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="23" X="0.197842514511006" Y="0.171083853539225" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="24" X="0.557873666021733" Y="0.201207121040656" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="25" X="0.212477234654433" Y="0.425388481242167" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="26" X="0.333489496505596" Y="0.626025708108721" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="27" X="0.690932801161692" Y="0.664648713986135" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="28" X="0.723288999217156" Y="0.71065600700909" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="29" X="0.245011904906769" Y="0.807846286764258" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="30" X="0.38223065908971" Y="0.880054515143771" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
    </PVGalvoPointElement>
  </PVMarkPointElement>
  <PVMarkPointElement Repetitions="5" UncagingLaser="Monaco" UncagingLaserPower="400" TriggerFrequency="None" TriggerSelection="None" TriggerCount="1" AsyncSyncFrequency="None" VoltageOutputCategoryName="None" VoltageRecCategoryName="None" parameterSet="CurrentSettings">
    <PVGalvoPointElement InitialDelay="3" InterPointDelay="35" Duration="15" SpiralRevolutions="5" AllPointsAtOnce="True" Use3D="False" Points="Group 1" Indices="1-10">
      <Point Index="1" X="0.0683571651946306" Y="0.0765404684108739" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="2" X="0.102249060191222" Y="0.166825722550099" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="3" X="0.272195521877857" Y="0.255426084269439" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="4" X="0.456430474938853" Y="0.235232439755493" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="5" X="0.19082531222494" Y="0.509463082620459" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="6" X="0.766124354559356" Y="0.436106953520161" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="7" X="0.0850359175296207" Y="0.574455355585571" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="8" X="0.374361657682214" Y="0.785003873657909" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="9" X="0.147069202594338" Y="0.865054738234017" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
      <Point Index="10" X="0.855240795499256" Y="0.832339567691665" IsSpiral="True" SpiralWidth="0.0264456981664316" SpiralHeight="0.0264456981664316" SpiralSizeInMicrons="15" />
    </PVGalvoPointElement>
  </PVMarkPointElement>
- can we assume the order of stimulation in each xml follows the order of "PVGalvoPointElement" tags (in each element, there are 10 cells that are stimulated)?
- "InitialDelay" is not increasing (for the first 10 cells (group 1) it is "15000," then it is "3" (group 2), then it is "3" (group 3) 
- if 10 cells are stimulated at a time, then we can calculate the duration of each "round" and add it to the next group
<Sequence type="TSeries Timed Element" cycle="1" time="16:13:32.6879556" xYStageGridDefined="False" xYStageGridNumXPositions="0" xYStageGridNumYPositions="0" xYStageGridOverlapPercentage="10" xYStageGridXOverlap="10" xYStageGridYOverlap="10">
    <PVStateShard />
    <MarkPoints category="multi_cell_stim_30_points" name="SLM_30_pseudorandom_1" triggerModeOverride="PFI0" filename="NCCR32_2023_02_20_Into_the_void_t_series_stim-000_Cycle00001_MarkPoints.xml" />
    <Frame relativeTime="0" absoluteTime="43.2199999999721" index="1" parameterSet="CurrentSettings">

Metadata for ndx-holographic-stimulation

PatternedOptogeneticStimulusSite

  • excitation lambda (nm), effector, location, If known

SpatialLightModulator

  • model (name), resolution

LightSource (Laser properties)

  • stimulation wavelenght, filter, intensity, exposure_time, pulse_rate, if known
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant