Coverage for ibllib/io/extractors/signatures.py: 0%

33 statements  

« prev     ^ index     » next       coverage.py v7.5.4, created at 2024-07-08 17:16 +0100

1# RAW DATA 

2RAW_BEHAVIOUR = [ 

3 ('_iblrig_ambientSensorData.raw', 'raw_behavior_data', True), 

4 ('_iblrig_encoderEvents.raw', 'raw_behavior_data', True), 

5 ('_iblrig_encoderPositions.raw', 'raw_behavior_data', True), 

6 ('_iblrig_encoderTrialInfo.raw', 'raw_behavior_data', True), 

7 ('_iblrig_micData.raw', 'raw_behavior_data', False), 

8 ('_iblrig_stimPositionScreen.raw', 'raw_behavior_data', False), 

9 ('_iblrig_syncSquareUpdate.raw', 'raw_behavior_data', False), 

10 ('_iblrig_taskData.raw', 'raw_behavior_data', True), 

11 ('_iblrig_taskSettings.raw', 'raw_behavior_data', True), 

12] 

13 

14RAW_PASSIVE = [ 

15 ('_iblrig_RFMapStim.raw', 'raw_passive_data', True), 

16 ('_iblrig_stimPositionScreen.raw', 'raw_passive_data', False), 

17 ('_iblrig_syncSquareUpdate.raw', 'raw_passive_data', False), 

18 ('_iblrig_taskSettings.raw', 'raw_passive_data', False), 

19 ('_iblrig_encoderEvents.raw', 'raw_passive_data', False), 

20 ('_iblrig_encoderPositions.raw', 'raw_passive_data', False), 

21 ('_iblrig_encoderTrialInfo.raw', 'raw_passive_data', False), 

22] 

23 

24# Data common to both 3A and 3B 

25RAW_EPHYS = [ 

26 ['ephysData.raw.ap', 'raw_ephys_data/XX', True], 

27 ['ephysData.raw.ch', 'raw_ephys_data/XX', True, ['ap', 'lf']], 

28 ['ephysData.raw.lf', 'raw_ephys_data/XX', True], 

29 ['ephysData.raw.meta', 'raw_ephys_data/XX', True, ['ap', 'lf']], 

30] 

31 

32# These are for both 3B probes but only main probe for 3A 

33RAW_EPHYS_EXTRA = [ 

34 ['ephysData.raw.sync', 'raw_ephys_data/XX', True], 

35 ['ephysData.raw.timestamps', 'raw_ephys_data/XX', True], 

36 ['ephysData.raw.wiring', 'raw_ephys_data/XX', False], 

37] 

38 

39# Only for 3B 

40RAW_EPHYS_NIDAQ = [ 

41 ('ephysData.raw.nidq', 'raw_ephys_data', True), 

42 ('ephysData.raw.meta', 'raw_ephys_data', True, ['nidq']), 

43 ('ephysData.raw.ch', 'raw_ephys_data', True, ['nidq']), 

44] 

45 

46 

47RAW_VIDEO = [ 

48 ('_iblrig_Camera.raw', 'raw_video_data', True, ['left', 'right', 'body']), 

49 ('_iblrig_Camera.timestamps', 'raw_video_data', True, ['left', 'right', 'body']), 

50 ('_iblrig_Camera.GPIO', 'raw_video_data', False, ['left', 'right', 'body']), 

51 ('_iblrig_Camera.frame_counter', 'raw_video_data', False, ['left', 'right', 'body']), 

52] 

53 

54# PROCESSED DATA 

55TRIALS = [ 

56 ('trials.choice', 'alf', True), 

57 ('trials.contrastLeft', 'alf', True), 

58 ('trials.contrastRight', 'alf', True), 

59 ('trials.feedbackType', 'alf', True), 

60 ('trials.feedback_times', 'alf', True), 

61 ('trials.firstMovement_times', 'alf', True), 

62 ('trials.goCueTrigger_times', 'alf', True), 

63 ('trials.goCue_times', 'alf', True), 

64 ('trials.intervals', 'alf', True), 

65 ('trials.intervals', 'alf', True), 

66 ('trials.probabilityLeft', 'alf', True), 

67 ('trials.response_times', 'alf', True), 

68 ('trials.rewardVolume', 'alf', True), 

69 ('trials.stimOff_times', 'alf', True), 

70 ('trials.stimOn_times', 'alf', True), 

71] 

72 

73WHEEL = [ 

74 ('wheel.position', 'alf', True), 

75 ('wheel.timestamps', 'alf', True), 

76 ('wheelMoves.intervals', 'alf', True), 

77 ('wheelMoves.peakAmplitude', 'alf', True), 

78] 

79 

80PASSIVE = [ 

81 ('_ibl_passiveGabor.table', 'alf', True), 

82 ('_ibl_passivePeriods.intervalsTable', 'alf', True), 

83 ('_ibl_passiveRFM.times', 'alf', True), 

84 ('_ibl_passiveStims.table', 'alf', True), 

85] 

86 

87 

88DLC = [ 

89 ('camera.dlc', 'alf', True, ['left', 'right', 'body']), 

90 ('camera.times', 'alf', True, ['left', 'right', 'body']), 

91 ('camera.ROIMotionEnergy', 'alf', False, ['left', 'right', 'body']), 

92 ('ROIMotionEnergy.position', 'alf', False, ['left', 'right', 'body']), 

93] 

94 

95VIDEO = [ 

96 ('camera.times', 'alf', True, ['left', 'right', 'body']), 

97] 

98 

99# Data common to both 3A and 3B 

100EPHYS = [ 

101 ['_spikeglx_sync.channels', 'raw_ephys_data/XX', True], 

102 ['_spikeglx_sync.polarities', 'raw_ephys_data/XX', True], 

103 ['_spikeglx_sync.times', 'raw_ephys_data/XX', True], 

104 ['_iblqc_ephysSpectralDensity.freqs', 'raw_ephys_data/XX', True, ['ap', 'lf']], 

105 ['_iblqc_ephysSpectralDensity.power', 'raw_ephys_data/XX', True, ['ap', 'lf']], 

106 ['_iblqc_ephysTimeRms.rms', 'raw_ephys_data/XX', True, ['ap', 'lf']], 

107 ['_iblqc_ephysTimeRms.timestamps', 'raw_ephys_data/XX', True, ['ap', 'lf']], 

108] 

109 

110# Only for 3B 

111EPHYS_NIDAQ = [ 

112 ('_spikeglx_sync.channels', 'raw_ephys_data', True), 

113 ('_spikeglx_sync.polarities', 'raw_ephys_data', True), 

114 ('_spikeglx_sync.times', 'raw_ephys_data', True), 

115] 

116 

117SPIKE_SORTING = [ 

118 ['_phy_spikes_subset.channels', 'alf/XX', False], 

119 ['_phy_spikes_subset.spikes', 'alf/XX', False], 

120 ['_phy_spikes_subset.waveforms', 'alf/XX', False], 

121 ['channels.brainLocationIds_ccf_2017', 'alf/XX', False], 

122 ['channels.mlapdv', 'alf/XX', False], 

123 ['channels.localCoordinates', 'alf/XX', True], 

124 ['channels.rawInd', 'alfa/XX', True], 

125 ['clusters.amps', 'alf/XX', True], 

126 ['clusters.brainLocationAcronyms_ccf_2017', 'alf/XX', False], 

127 ['clusters.brainLocationIds_ccf_2017', 'alf/XX', False], 

128 ['clusters.channels', 'alf/XX', True], 

129 ['clusters.depths', 'alf/XX', True], 

130 ['clusters.metrics', 'alf/XX', False], 

131 ['clusters.mlapdv', 'alf/XX', False], 

132 ['clusters.peakToTrough', 'alf/XX', True], 

133 ['clusters.uuids', 'alf/XX', True], 

134 ['clusters.waveforms', 'alf/XX', True], 

135 ['clusters.waveformsChannels', 'alf/XX', True], 

136 ['spikes.amps', 'alf/XX', True], 

137 ['spikes.clusters', 'alf/XX', True], 

138 ['spikes.depths', 'alf/XX', True], 

139 ['spikes.samples', 'alf/XX', True], 

140 ['spikes.templates', 'alf/XX', True], 

141 ['spikes.times', 'alf/XX', True], 

142 ['templates.amps', 'alf/XX', True], 

143 ['templates.waveforms', 'alf/XX', True], 

144 ['templates.waveformsChannels', 'alf/XX', True], 

145] 

146 

147 

148# RAW DATA TASKS 

149RAW_BEHAVIOUR_TASKS = ['TrainingRegisterRaw', 'EphysAudio'] 

150RAW_PASSIVE_TASKS = ['TrainingRegisterRaw'] 

151RAW_EPHYS_TASKS = ['EphysMtscomp'] 

152RAW_VIDEO_TASKS = ['TrainingRegisterRaw', 'EphysVideoCompress'] 

153 

154# PROCESSED DATA TASKS 

155PASSIVE_TASKS = ['EphysPassive'] 

156EPHYS_TASKS = ['EphysPulses', 'RawEphysQC'] 

157VIDEO_TASKS = ['EphysVideoCompress'] 

158TRIAL_TASKS = ['EphysTrials'] 

159WHEEL_TASKS = ['EphysTrials'] 

160SPIKE_SORTING_TASKS = ['SpikeSorting', 'EphysCellsQc'] 

161DLC_TASKS = ['EphysDLC'] 

162 

163# DATA REQUIRED FOR TASKS 

164EPHYSTRIALS = [('_iblrig_taskData.raw.*', 'raw_behavior_data', True), 

165 ('_iblrig_taskSettings.raw.*', 'raw_behavior_data', True), 

166 ('_spikeglx_sync.npy', 'raw_ephys_data*', True), 

167 ('_spikeglx_sync.polarities.npy', 'raw_ephys_data*', True), 

168 ('_spikeglx_sync.times.npy', 'raw_ephys_data*', True), 

169 ('_iblrig_encoderEvents.raw', 'raw_behavior_data', True), 

170 ('_iblrig_encoderPositions.raw', 'raw_behavior_data', True), 

171 ('*wiring.json', 'raw_ephys_data*', False), 

172 ('*.meta', 'raw_ephys_data*', True)] 

173 

174EPHYSPASSIVE = [('_iblrig_taskSettings.raw*', 'raw_behavior_data', True), 

175 ('_spikeglx_sync.channels.*', 'raw_ephys_data*', True), 

176 ('_spikeglx_sync.polarities.*', 'raw_ephys_data*', True), 

177 ('_spikeglx_sync.times.*', 'raw_ephys_data*', True), 

178 ('*.meta', 'raw_ephys_data*', True), 

179 ('_iblrig_RFMapStim.raw*', 'raw_passive_data', True)] 

180 

181RAWEPHYSQC = [('*.meta', 'raw_ephys_data/probe*', True), 

182 ('*.ch', 'raw_ephys_data/probe*', True), 

183 ('*.cbin', 'raw_ephys_data/probe*', True)] 

184 

185 

186def spike_sorting_signature(pname=None): 

187 pname = pname if pname is not None else "probe*" 

188 signature = [('*ap.meta', f'raw_ephys_data/{pname}', True), 

189 ('*ap.ch', f'raw_ephys_data/{pname}', True), 

190 ('*ap.cbin', f'raw_ephys_data/{pname}', True), 

191 ('_spikeglx_sync.channels.*', 'raw_ephys_data*', True), 

192 ('_spikeglx_sync.polarities.*', 'raw_ephys_data*', True), 

193 ('_spikeglx_sync.times.*', 'raw_ephys_data*', True), 

194 ('_iblrig_taskData.raw.*', 'raw_behavior_data', True), 

195 ('_iblrig_taskSettings.raw.*', 'raw_behavior_data', True) 

196 ] 

197 return signature 

198 

199 

200SPIKESORTING = [spike_sorting_signature()]