suite2p_trigger.py
deconvolution_suite2p(segmentation_ops, db)
¶
Performs deconvolution using the Suite2p package for single plane tiff files.
The code to run deconvolution separately can be found here .
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
segmentation_ops |
dict
|
options dictionary.
Requirements:
- baseline - how to compute baseline of each trace
- win_baseline - window for max filter in seconds
- sig_baseline - width of Gaussian filter in seconds
- fs - sampling rate per plane
- prctile_baseline - percentile of trace to use as baseline
if using |
required |
Returns:
| Type | Description |
|---|---|
np.ndarray
|
spks.npy: Updates the file with an array of deconvolved traces |
Source code in element_interface/suite2p_trigger.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |
motion_correction_suite2p(ops, db)
¶
Performs motion correction (i.e. registration) using the Suite2p package.
Example
ops = dict(suite2p.default_ops(), nonrigid=False, two_step_registration=False)
db = {'h5py': [], # single h5 file path 'h5py_key': 'data', 'look_one_level_down': False, # search for TIFFs in all subfolders 'data_path': ['/test_data'], # list of folders with tiffs 'subfolders': [], # choose subfolders of 'data_path' 'fast-disk': '/test_data' # string path for storing binary file}
ops.update(do_registration=1, roidetect=False, spikedetect=False)
motion_correction_ops = element_interface.suite2p_trigger.motion_correction_suite2p(ops, db)
motion_correction_ops.update(do_registration=0, roidetect=True, spikedetect=False)
segmentation_ops = element_interface.suite2p_trigger.segmentation_suite2p(motion_correction_ops, db)
segmentation_ops.update(do_registration=0, roidetect=False, spikedetect=True)
spikes = element_interface.suite2p_trigger.deconvolution_suite2p(segmentation_ops, db)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ops |
dict
|
ops dictionary can be obtained by using |
required |
db |
dict
|
dictionary that includes paths pointing towards the input data, and path to store outputs |
required |
Returns:
| Name | Type | Description |
|---|---|---|
motion_correction_ops |
dict
|
Dictionary that includes x and y shifts.
A subset of the ops dictionary returned from |
tuple
|
data.bin: Binary file of the data. If delete_bin is set to True (default False), the binary file is deleted after processing. |
|
tuple
|
ops.npy: Options dictionary. This file gets updated during the segmentation and deconvolution steps. |
Source code in element_interface/suite2p_trigger.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
segmentation_suite2p(motion_correction_ops, db)
¶
Performs cell segmentation (i.e. roi detection) using Suite2p package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
motion_correction_ops |
dict
|
options dictionary. Requirements: - x and y shifts - do_registration=0 - two_step_registration=False - roidetect=True - spikedetect=False |
required |
db |
dict
|
dictionary that includes paths pointing towards the input data, and path to store outputs |
required |
Returns:
| Name | Type | Description |
|---|---|---|
segmentation_ops |
dict
|
A subset of the ops dictionary returned from
|
tuple
|
data.bin: Binary file if the one created during motion correction is deleted. If delete_bin=True, the binary file is deleted after processing. |
|
tuple
|
ops.npy: Updated ops dictionary created by suite2p.run_s2p() |
|
tuple
|
F.npy: Array of fluorescence traces |
|
tuple
|
Fneu.npy: Array of neuropil fluorescence traces |
|
tuple
|
iscell.npy: Specifies whether a region of interest is a cell and the probability |
|
tuple
|
stat.npy: List of statistics computed for each cell |
|
tuple
|
spks.npy: Empty file. This file is updated with deconvolved traces during the deconvolution step. |
Source code in element_interface/suite2p_trigger.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |