OSCR

Dynamic neuronal ensembles encode burst-suppression revealed by cortex-wide optical-electrical interfaces.

Code ↔ Paper

7 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

5 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 7 matches
  1. [1] § Methods › Prediction of neuronal calcium dynamics from multi-channel ECoG signals during burst-suppression and awake states › ECoG features extraction ↔ extra_utils_for_scaling_analysis/utils_ym.py, lines 122 to 151 · score 0.97 · spectral centroid, spectral entropy, crest factor, dominant frequency, zero crossings, waveform factor · block oscr:b:K83PAB99JH066-2 · Report a mismatch
  2. [2] § Methods › Prediction of neuronal calcium dynamics from multi-channel ECoG signals during burst-suppression and awake states › Calcium signal dimensionality reduction via shared variance component anal ↔ extra_utils_for_population_coding/dimred.py, lines 26 to 113 · score 0.92 · removed temporal alignment, Shared Variance Component, cross validation, Covariance matrices, Neuronal populations, subsets · block oscr:b:8JXF3ZYP9TGQ9-9 · Report a mismatch
  3. [3] § Methods › Prediction of neuronal calcium dynamics from multi-channel ECoG signals during burst-suppression and awake states › Prediction of SVCs from ECoG features using reduced rank regression (RRR) ↔ extra_utils_for_scaling_analysis/predict.py, lines 162 to 237 · score 0.78 · reduced rank regression, predicted neural activity, canonical, linear, covariance, behavioral · block oscr:b:58KRFEJRM48XS-0 · Report a mismatch
  4. [4] § Methods › Prediction of neuronal calcium dynamics from multi-channel ECoG signals during burst-suppression and awake states › Prediction of SVCs from ECoG features using reduced rank regression (RRR) ↔ extra_utils_for_scaling_analysis/utils_ym.py, lines 744 to 832 · score 0.78 · reduced rank regression, combined training, canonical, validation, zero, rastermap · block oscr:b:C2TCC3E4M331Q-J · Report a mismatch
  5. [5] § Methods › Prediction of neuronal calcium dynamics from multi-channel ECoG signals during burst-suppression and awake states › Calcium signal dimensionality reduction via shared variance component anal ↔ extra_utils_for_scaling_analysis/svca.py, lines 19 to 92 · score 0.70 · reliable variance, utilized, SVCA, subsets, checkerboard, shuffled · block oscr:b:B75026C6D4P8K-3 · Report a mismatch
  6. [6] § Methods › Transparent electrode array fabrication and characterization › Signal-to-Noise Ratio (SNR) calculation for ECoG signals ↔ extra_utils_for_scaling_analysis/utils_ym.py, lines 122 to 151 · score 0.55 · power spectral density, Welch, channel · block oscr:b:K83PAB99JH066-2 · Report a mismatch
  7. [7] § Results › Cross-modal signal prediction using shared variance components ↔ Predict_All.ipynb, lines 438 to 526 · score 0.50 · explainable variance, reliable variance, predicting, SVCs, mice · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 832 lines · 35 KB · GPL-3.0 · 3 matches

  1. """
  2. Some misc. utilities.
  3. """
  4. import numpy as np
  5. import matplotlib.pyplot as plt
  6. import os
  7. import numpy as np
  8. import pandas as pd
  9. from scipy import signal
  10. from scipy.stats import zscore
  11. from rastermap import Rastermap
  12. from scipy.stats import skew, kurtosis
  13. from scipy.signal import welch
  14. from tqdm import tqdm
  15. from scipy.signal import savgol_filter
  16. from PopulationCoding.predict import canonical_cov
  17. import logging
  18. DEFAULT_N_JOBS = 8
  19. def plot_neurons_behavior_ym(
  20. neurons, ECoG_fp, normalized_pupil_area, t, clim=[-0.3, 1.5], zspacing=10
  21. ):
  22. fig = plt.figure(figsize=(8, 6))
  23. #
  24. ax = plt.subplot(10, 1, (1, 5))
  25. ax.imshow(
  26. neurons.T, cmap="viridis", aspect="auto", clim=clim, interpolation="bicubic"
  27. )
  28. ax.set_xticks([])
  29. ax.set_ylabel("Neuron #")
  30. #
  31. ax = plt.subplot(10, 1, (6, 9))
  32. time_indices = np.linspace(0, len(t) - 1, ECoG_fp.shape[0])
  33. for i in range(ECoG_fp.shape[1]):
  34. ax.plot(time_indices,ECoG_fp[:, i] - zspacing * i, color="k")
  35. ax.set_xlim([0, len(t) - 1])
  36. ax.set_xticks([])
  37. ax.set_yticks([])
  38. ax.set_ylabel("ECoG")
  39. #
  40. ax = plt.subplot(10, 1, 10)
  41. ax.plot(t, normalized_pupil_area, color="k")
  42. ax.set_xlim([t[0], t[-1]])
  43. ax.set_yticks([])
  44. ax.set_ylabel("Normalized\npupil area")
  45. ax.set_xlabel("Time (sec)")
  46. return fig
  47. def bandstop_filter(data, order=3, fs=1000, stopbands=[[2, 3], [4, 6], [49, 51]]):
  48. if data.ndim == 1:
  49. data = np.expand_dims(data, axis=0)
  50. filtered_data = data.copy()
  51. for freq_stop in stopbands:
  52. b, a = signal.butter(order, [f / (fs / 2) for f in freq_stop], btype='bandstop')
  53. filtered_data = signal.filtfilt(b, a, filtered_data, axis=1)
  54. if data.shape[0] == 1:
  55. filtered_data = np.squeeze(filtered_data, axis=0)
  56. return filtered_data
  57. def preprocess_calcium_data(res_path, load_path, threshold=50):
  58. denoised_data = np.load(os.path.join(res_path, "neuron_denoised_records_whole_brain.npy"))
  59. position_x = pd.read_csv(os.path.join(load_path, "valid_neuron_x.csv"))
  60. position_y = pd.read_csv(os.path.join(load_path, "valid_neuron_y.csv"))
  61. denoised_data[denoised_data > threshold] = threshold
  62. neurons = zscore(denoised_data).T
  63. centers = np.hstack((position_x, position_y)).T
  64. return neurons, centers
  65. def preprocess_ecog_data(load_path, kbd1, evt06):
  66. fp_32chs = pd.read_csv(os.path.join(load_path, "ele_signal_burst_supp_fp01-fp32.csv")).values.T
  67. mean_across_channels = np.mean(fp_32chs, axis=0)
  68. fp_32chs_filtered = np.zeros_like(fp_32chs)
  69. for ch in range(fp_32chs.shape[0]):
  70. signal_without_mean = fp_32chs[ch] - mean_across_channels
  71. fp_32chs_filtered[ch] = bandstop_filter(signal_without_mean)
  72. #
  73. second_start_Ele = kbd1 - 120 # s
  74. second_stop_Ele = second_start_Ele + 900 # s
  75. fhz_Ele = 1000 # Hz
  76. t_idx_Ele = np.arange(int(fhz_Ele * second_start_Ele), int(fhz_Ele * second_stop_Ele))
  77. fp_32chs_example = zscore(fp_32chs_filtered.T[t_idx_Ele, :32])
  78. return fp_32chs_example
  79. def perform_rastermap_analysis(neurons, kbd1, evt06, perform_rastermap):
  80. second_start_Ca = kbd1 - evt06 - 120
  81. second_stop_Ca = second_start_Ca + 900
  82. fhz_Ca = 10
  83. t_idx_Ca = np.arange(int(fhz_Ca * second_start_Ca), int(fhz_Ca * second_stop_Ca))
  84. neurons_example = zscore(neurons[t_idx_Ca, :])
  85. neurons_example_sorted = None
  86. if perform_rastermap:
  87. model = Rastermap(n_PCs=32, n_clusters=8).fit(neurons_example.T)
  88. neurons_example_sorted = neurons_example[:, model.isort]
  89. return neurons_example, neurons_example_sorted
  90. def downsample_signal(fp_32chs_example, factor=100):
  91. fp_32chs_downsampled = fp_32chs_example.reshape(-1, factor, fp_32chs_example.shape[1]).mean(axis=1)
  92. assert fp_32chs_downsampled.shape[0] == 9000
  93. return fp_32chs_downsampled
  94. def extract_features(channel_data):
  95. mean = np.mean(channel_data)
  96. std_dev = np.std(channel_data)
  97. variance = np.var(channel_data)
  98. max_val = np.max(channel_data)
  99. min_val = np.min(channel_data)
  100. median = np.median(channel_data)
  101. ptp = np.ptp(channel_data)
  102. iqr = np.percentile(channel_data, 75) - np.percentile(channel_data, 25)
  103. energy = np.sum(channel_data ** 2) / len(channel_data)
  104. skewness = skew(channel_data)
  105. kurt = kurtosis(channel_data)
  106. rms = np.sqrt(np.mean(channel_data**2))
  107. waveform_factor = rms / np.mean(np.abs(channel_data))
  108. crest_factor = max_val / rms
  109. zero_crossings = np.where(np.diff(np.signbit(channel_data)))[0].size
  110. freqs, psd = welch(channel_data, fs=1000, nperseg=len(channel_data))
  111. dominant_freq = freqs[np.argmax(psd)]
  112. spectral_centroid = np.sum(freqs * psd) / np.sum(psd)
  113. spectral_entropy = -np.sum((psd/np.sum(psd)) * np.log2(psd/np.sum(psd)))
  114. bandwidth = np.sqrt(np.sum(psd * (freqs - spectral_centroid)**2) / np.sum(psd))
  115. features = [
  116. mean, std_dev, variance, max_val, min_val, median,
  117. ptp, iqr, energy, skewness, kurt, waveform_factor, crest_factor,
  118. zero_crossings, dominant_freq, spectral_centroid, spectral_entropy, bandwidth
  119. ]
  120. return features
  121. def extract_all_features(fp_32chs_example, num_windows, num_channels):
  122. features_per_channel = 18
  123. output_matrix = np.zeros((num_windows, num_channels * features_per_channel))
  124. for window_idx in tqdm(range(num_windows)):
  125. start_idx = window_idx * 100
  126. end_idx = start_idx + 100
  127. window_data = fp_32chs_example[start_idx:end_idx, :]
  128. feature_vector = []
  129. for channel_idx in range(num_channels):
  130. channel_data = window_data[:, channel_idx]
  131. features = extract_features(channel_data)
  132. feature_vector.extend(features)
  133. output_matrix[window_idx, :] = feature_vector
  134. return output_matrix
  135. def zscore_and_visualize_ecog_features(ECoG_Extracted_Features, output_directory, savefigs_1):
  136. ECoG_Extracted_Features = zscore(zscore(ECoG_Extracted_Features.T).T)
  137. if savefigs_1:
  138. model_ECoG = Rastermap(n_PCs=32, n_clusters=8).fit(ECoG_Extracted_Features.T)
  139. fig, axs = plt.subplots(2, 1, figsize=(12, 8))
  140. clim1 = [-0.3, 100]
  141. clim2 = [-0.3, 3]
  142. axs[0].imshow(
  143. ECoG_Extracted_Features[:, model_ECoG.isort].T, cmap="viridis", aspect="auto", clim=clim1, interpolation="bicubic"
  144. )
  145. axs[0].set_xticks([])
  146. axs[0].set_ylabel("Neuron #")
  147. axs[0].set_title('Original TrainX')
  148. axs[1].imshow(
  149. ECoG_Extracted_Features[:, model_ECoG.isort].T, cmap="viridis", aspect="auto", clim=clim2, interpolation="bicubic"
  150. )
  151. axs[1].set_xticks([])
  152. axs[1].set_ylabel("Neuron #")
  153. axs[1].set_title('Original TrainX')
  154. output_path_tif = os.path.join(output_directory, "fig6", "ECoG_Features.tif")
  155. output_path_png = os.path.join(output_directory, "fig6", "ECoG_Features.png")
  156. fig.savefig(output_path_tif, dpi=600, format='tif')
  157. fig.savefig(output_path_png, dpi=600, format='png')
  158. plt.close(fig)
  159. def get_list_shape(lst):
  160. if isinstance(lst, list):
  161. return (len(lst),) + get_list_shape(lst[0])
  162. else:
  163. return ()
  164. def plot_svc_time_series(neurons_example, ex_u, ex_v, ex_ntrain, ex_ntest, t_start, t_end, res_path, filename, n_nneur=-1):
  165. svc_indices = [0, 7, 15, 63, 255, 511] # SVC 1, 8, 16, 64, 256, 512
  166. plt.figure(figsize=(12, 18))
  167. for i, svc_index in enumerate(svc_indices):
  168. neurons_subset_train = neurons_example[t_start*10:t_end*10, ex_ntrain[n_nneur]]
  169. svc_time_series_train = np.dot(neurons_subset_train, ex_u[n_nneur][:, svc_index])
  170. neurons_subset_test = neurons_example[t_start*10:t_end*10, ex_ntest[n_nneur]]
  171. svc_time_series_test = np.dot(neurons_subset_test, ex_v[n_nneur][:, svc_index])
  172. correlation = np.corrcoef(svc_time_series_train, svc_time_series_test)[0, 1]
  173. plt.subplot(len(svc_indices), 1, i + 1)
  174. time_axis = np.arange(svc_time_series_train.shape[0])/10
  175. plt.plot(time_axis, svc_time_series_train, label=f'Training Set SVC {svc_index + 1}', color='blue')
  176. plt.plot(time_axis, svc_time_series_test, label=f'Testing Set SVC {svc_index + 1}', color='orange')
  177. plt.text(0.05, 0.95, f'Correlation: {correlation:.2f}', transform=plt.gca().transAxes,
  178. fontsize=10, verticalalignment='top', bbox=dict(facecolor='white', alpha=0.5))
  179. plt.xlabel('Time')
  180. plt.ylabel('SVC Value')
  181. plt.title(f'SVC {svc_index + 1} Time Series')
  182. plt.legend()
  183. plt.tight_layout()
  184. save_dir = os.path.join(res_path, "SVCA set1 and set2")
  185. os.makedirs(save_dir, exist_ok=True)
  186. output_path_png = os.path.join(save_dir, f"1_8_16_64_256_512_{filename}.png",)
  187. plt.savefig(output_path_png, format='png')
  188. plt.close()
  189. def compare_and_plot(model, trainX, testX, u_sub, v_sub, vp_train, vp_test, ll, kk, res_path, base_path, centers):
  190. dictpath = os.path.join(res_path, "predicted_neurons_versus_trainX_testX", base_path)
  191. os.makedirs(dictpath, exist_ok=True)
  192. plot_filename_png = f"neurons_l{ll}_k{kk}.png"
  193. plot_filepath_png = os.path.join(dictpath, plot_filename_png)
  194. plot_filename_tif = f"neurons_l{ll}_k{kk}.tif"
  195. plot_filepath_tif = os.path.join(dictpath, plot_filename_tif)
  196. trainX_approximation = vp_train.T @ u_sub.T
  197. testX_approximation = vp_test.T @ v_sub.T
  198. trainX_approximation = np.real(trainX_approximation)
  199. testX_approximation = np.real(testX_approximation)
  200. trainX_approximation = zscore(zscore(trainX_approximation.T).T)
  201. testX_approximation = zscore(zscore(testX_approximation.T).T)
  202. real = np.hstack((trainX, testX))
  203. predicted = np.hstack((trainX_approximation, testX_approximation))
  204. plot_neuron_correlation(real, predicted, centers, res_path, f"{base_path}l{ll}k{kk}")
  205. fig, axs = plt.subplots(2, 1, figsize=(12, 8))
  206. clim = [-0.3, 1.5]
  207. axs[0].imshow(
  208. real[:, model.isort].T, cmap="viridis", aspect="auto", clim=clim, interpolation="bicubic"
  209. )
  210. axs[0].set_xticks([])
  211. axs[0].set_ylabel("Neuron #")
  212. axs[0].set_title('Original')
  213. axs[1].imshow(
  214. predicted[:, model.isort].T, cmap="viridis", aspect="auto", clim=clim, interpolation="bicubic"
  215. )
  216. axs[1].set_xticks([])
  217. axs[1].set_ylabel("Neuron #")
  218. axs[1].set_title('Predicted')
  219. for ax in axs.flat:
  220. ax.set(xlabel='Time', ylabel='Neurons')
  221. plt.tight_layout()
  222. plt.savefig(plot_filepath_png)
  223. plt.savefig(plot_filepath_tif)
  224. plt.close(fig)
  225. print(f"Plot saved at {dictpath}")
  226. import pickle
  227. def plot_quantitative_statistics(correlations, res_path, suffix):
  228. sorted_indices = np.argsort(correlations)[::-1]
  229. top_1000_indices = sorted_indices[:1000]
  230. top_1000_correlations = [correlations[i] for i in top_1000_indices]
  231. all_average_correlation = np.mean(correlations)
  232. top_1000_average_correlation = np.mean(top_1000_correlations)
  233. all_std_error = np.std(correlations) / np.sqrt(len(correlations))* 1.96
  234. top_1000_std_error = np.std(top_1000_correlations) / np.sqrt(len(top_1000_correlations)) * 1.96
  235. # Prepare data to save
  236. data_to_save = {
  237. 'correlations':correlations,
  238. 'sorted_indices': sorted_indices,
  239. 'top_1000_indices': top_1000_indices,
  240. 'top_1000_correlations': top_1000_correlations,
  241. 'all_average_correlation': all_average_correlation,
  242. 'top_1000_average_correlation': top_1000_average_correlation,
  243. 'all_std_error': all_std_error,
  244. 'top_1000_std_error': top_1000_std_error
  245. }
  246. # Save variables to a file using pickle
  247. save_dir = os.path.join(res_path, "neuron_correlation_statistics")
  248. os.makedirs(save_dir, exist_ok=True)
  249. with open(os.path.join(save_dir, f"variables_{suffix}.pkl"), 'wb') as f:
  250. pickle.dump(data_to_save, f)
  251. # Plotting
  252. plt.figure(figsize=(8, 6))
  253. labels = ['All Neurons', 'Top 1000 Neurons']
  254. averages = [all_average_correlation, top_1000_average_correlation]
  255. errors = [all_std_error, top_1000_std_error]
  256. plt.bar(labels, averages, yerr=errors, color=['blue', 'green'], alpha=0.7, capsize=5)
  257. plt.ylabel('Average Pearson Correlation')
  258. plt.title('Comparison of Average Correlation with Error Bars')
  259. plt.savefig(os.path.join(save_dir, f"neuron_correlation_statistics_{suffix}.png"), dpi=300)
  260. plt.savefig(os.path.join(save_dir, f"neuron_correlation_statistics_{suffix}.pdf"))
  261. plt.close()
  262. def plot_neuron_correlation(real_activity, predicted_activity, centers, res_path, suffix):
  263. correlations = []
  264. for i in range(real_activity.shape[1]):
  265. if np.std(real_activity[:, i]) == 0 or np.std(predicted_activity[:, i]) == 0:
  266. correlations.append(0)
  267. else:
  268. corr = np.corrcoef(real_activity[:, i], predicted_activity[:, i])[0, 1]
  269. correlations.append(corr)
  270. correlations = np.nan_to_num(correlations, nan=0)
  271. correlations = np.maximum(correlations, 0)
  272. s = max(2, 100 / np.sqrt(centers.shape[1]))
  273. np.save(os.path.join(res_path, f'correlations_{suffix}.npy'), {
  274. 'correlations': correlations,
  275. })
  276. np.save(os.path.join(res_path, f'real_predicted_activity_centers_{suffix}.npy'), {
  277. 'real_activity': real_activity,
  278. 'predicted_activity': predicted_activity,
  279. 'centers': centers,
  280. })
  281. # Plotting scatter plots
  282. for vmax_value in [0.6, 1]:
  283. plt.figure(figsize=(10, 8))
  284. scatter = plt.scatter(
  285. centers[0, :],
  286. centers[1, :],
  287. c=correlations,
  288. cmap='Reds',
  289. s=10,
  290. alpha=correlations,
  291. edgecolors='none',
  292. vmin=0,
  293. vmax=vmax_value
  294. )
  295. cbar = plt.colorbar(scatter)
  296. cbar.set_label('Pearson Correlation')
  297. plt.xlabel('X Position')
  298. plt.ylabel('Y Position')
  299. plt.title(f'Neuron Activity Correlation ({suffix})')
  300. save_dir = os.path.join(res_path, "neuron_correlation_maps")
  301. os.makedirs(save_dir, exist_ok=True)
  302. plt.savefig(os.path.join(save_dir, f"neuron_correlation_{suffix}_{vmax_value}.png"), dpi=300)
  303. plt.savefig(os.path.join(save_dir, f"neuron_correlation_{suffix}_{vmax_value}.pdf"))
  304. plt.close()
  305. # Calculate distance from center
  306. center_point = np.mean(centers, axis=1)
  307. distances = np.linalg.norm(centers.T - center_point, axis=1)
  308. # Define a threshold to separate central and peripheral neurons
  309. threshold_distance = np.percentile(distances, 50) # Median distance as separation
  310. central_correlations = correlations[distances <= threshold_distance]
  311. peripheral_correlations = correlations[distances > threshold_distance]
  312. # Plot average correlation
  313. plt.figure()
  314. plt.bar(['Central', 'Peripheral'], [np.mean(central_correlations), np.mean(peripheral_correlations)])
  315. plt.ylabel('Average Pearson Correlation')
  316. plt.title('Average Correlation: Central vs Peripheral Neurons')
  317. plt.savefig(os.path.join(save_dir, f"average_correlation_central_vs_peripheral_{suffix}.png"), dpi=300)
  318. plt.savefig(os.path.join(save_dir, f"average_correlation_central_vs_peripheral_{suffix}.pdf"))
  319. plt.close()
  320. # Plot correlation vs distance
  321. plt.figure()
  322. plt.scatter(distances, correlations, c=correlations, cmap='Reds')
  323. plt.colorbar(label='Pearson Correlation')
  324. plt.xlabel('Distance from Center')
  325. plt.ylabel('Pearson Correlation')
  326. plt.title('Correlation vs Distance from Center')
  327. plt.savefig(os.path.join(save_dir, f"correlation_vs_distance_{suffix}.png"), dpi=300)
  328. plt.savefig(os.path.join(save_dir, f"correlation_vs_distance_{suffix}.pdf"))
  329. plt.close()
  330. plot_quantitative_statistics(correlations, res_path, suffix)
  331. # def plot_neuron_correlation(real_activity, predicted_activity, centers, res_path, suffix):
  332. # correlations = []
  333. # for i in range(real_activity.shape[1]):
  334. # if np.std(real_activity[:, i]) == 0 or np.std(predicted_activity[:, i]) == 0:
  335. # correlations.append(0)
  336. # else:
  337. # corr = np.corrcoef(real_activity[:, i], predicted_activity[:, i])[0, 1]
  338. # correlations.append(corr)
  339. # correlations = np.nan_to_num(correlations, nan=0)
  340. # correlations = np.maximum(correlations, 0)
  341. # s = max(2, 100 / np.sqrt(centers.shape[1]))
  342. # np.save(os.path.join(res_path, f'correlations_{suffix}.npy'), {
  343. # 'correlations': correlations,
  344. # })
  345. # np.save(os.path.join(res_path, f'real_predicted_activity_centers_{suffix}.npy'), {
  346. # 'real_activity': real_activity,
  347. # 'predicted_activity': predicted_activity,
  348. # 'centers': centers,
  349. # })
  350. # plt.figure(figsize=(10, 8))
  351. # scatter = plt.scatter(
  352. # centers[0, :],
  353. # centers[1, :],
  354. # c=correlations,
  355. # cmap='Reds',
  356. # s=10,
  357. # alpha=correlations,
  358. # edgecolors='none',
  359. # vmin=0,
  360. # vmax=0.6
  361. # )
  362. # cbar = plt.colorbar(scatter)
  363. # cbar.set_label('Pearson Correlation')
  364. # plt.xlabel('X Position')
  365. # plt.ylabel('Y Position')
  366. # plt.title(f'Neuron Activity Correlation ({suffix})')
  367. # save_dir = os.path.join(res_path, "neuron_correlation_maps")
  368. # os.makedirs(save_dir, exist_ok=True)
  369. # plt.savefig(os.path.join(save_dir, f"neuron_correlation_{suffix}_0.6.png"), dpi=300)
  370. # plt.savefig(os.path.join(save_dir, f"neuron_correlation_{suffix}_0.6.pdf"))
  371. # plt.close()
  372. # plt.figure(figsize=(10, 8))
  373. # scatter = plt.scatter(
  374. # centers[0, :],
  375. # centers[1, :],
  376. # c=correlations,
  377. # cmap='Reds',
  378. # s=10,
  379. # alpha=correlations,
  380. # edgecolors='none',
  381. # vmin=0,
  382. # vmax=1
  383. # )
  384. # cbar = plt.colorbar(scatter)
  385. # cbar.set_label('Pearson Correlation')
  386. # plt.xlabel('X Position')
  387. # plt.ylabel('Y Position')
  388. # plt.title(f'Neuron Activity Correlation ({suffix})')
  389. # save_dir = os.path.join(res_path, "neuron_correlation_maps")
  390. # os.makedirs(save_dir, exist_ok=True)
  391. # plt.savefig(os.path.join(save_dir, f"neuron_correlation_{suffix}_1.png"), dpi=300)
  392. # plt.savefig(os.path.join(save_dir, f"neuron_correlation_{suffix}_1.pdf"))
  393. # plt.close()
  394. # plot_quantitative_statistics(correlations, res_path, suffix)
  395. def reduced_rank_regressions_ym(ranks, ECoG_Extracted_Features, projs1, projs2, lams, res_path,
  396. ex_itrain, ex_itest, ex_u, ex_v, nsvc_predict, trainX, testX, centers):
  397. nrank1 = ranks[ranks <= ECoG_Extracted_Features.shape[1]]
  398. print("nrank1:", nrank1)
  399. n_nneurs = 0
  400. t_start_plot = 50
  401. t_end_plot = 400
  402. for l in tqdm(range(len(lams))): # try various regularization
  403. atrain, btrain, _, _ = canonical_cov(
  404. projs1[ex_itrain[n_nneurs], :], ECoG_Extracted_Features[ex_itrain[n_nneurs], :], lams[l], npc=max(nrank1)
  405. )
  406. atest, btest, _, _ = canonical_cov(
  407. projs2[ex_itrain[n_nneurs], :], ECoG_Extracted_Features[ex_itrain[n_nneurs], :], lams[l], npc=max(nrank1)
  408. )
  409. for k in tqdm(range(len(nrank1))): # try various ranks
  410. vp_train = (
  411. atrain[:, :nrank1[k]] @ btrain[:, :nrank1[k]].T @ ECoG_Extracted_Features.T
  412. )
  413. vp_test = atest[:, :nrank1[k]] @ btest[:, :nrank1[k]].T @ ECoG_Extracted_Features.T
  414. window_length = 51
  415. polyorder = 11
  416. vp_train_filtered = savgol_filter(vp_train.T, window_length=window_length, polyorder=polyorder, axis=0).T
  417. vp_test_filtered = savgol_filter(vp_test.T, window_length=window_length, polyorder=polyorder, axis=0).T
  418. vp_train = vp_train_filtered
  419. vp_test = vp_test_filtered
  420. print("vp_train:", vp_train.shape)
  421. print("vp_test:", vp_test.shape)
  422. print("projs1:", projs1.shape)
  423. print("projs2:", projs2.shape)
  424. plot_components = [0, 1, 2, 3, 4, 5, 6, 7, 15, 31, 63]
  425. def save_plots(proj, vp, filepath_suffix, filename_suffix):
  426. fig, axes = plt.subplots(len(plot_components), 1, figsize=(15, 25))
  427. for i, vec_idx in enumerate(plot_components):
  428. ax = axes[i]
  429. ax.plot(proj[t_start_plot*10:t_end_plot*10, vec_idx], color='b', alpha=0.5, label='real')
  430. ax.plot(vp.T[t_start_plot*10:t_end_plot*10, vec_idx], color='r', alpha=0.5, label='predicted')
  431. ax.set_title(f'SVC {vec_idx + 1}')
  432. ax.legend()
  433. ax.set_xlabel('time')
  434. ax.set_ylabel('SVCs')
  435. plt.tight_layout()
  436. filename_png = f"SVCs_l{l}_k{k}_nneur{n_nneurs}_{filename_suffix}.png"
  437. filename_pdf = f"SVCs_l{l}_k{k}_nneur{n_nneurs}_{filename_suffix}.pdf"
  438. directory_path = os.path.join(res_path, "predicted_SVCs", filepath_suffix)
  439. os.makedirs(directory_path, exist_ok=True)
  440. filepath_png = os.path.join(directory_path, filename_png)
  441. filepath_pdf = os.path.join(directory_path, filename_pdf)
  442. plt.savefig(filepath_png)
  443. plt.savefig(filepath_pdf, format='pdf')
  444. fig.clf()
  445. def center_data(data, axis=0):
  446. mean = np.mean(data, axis=axis, keepdims=True)
  447. centered_data = data - mean
  448. return centered_data
  449. vp_train_filtered=center_data(vp_train_filtered,axis=1)
  450. vp_test_filtered =center_data(vp_test_filtered, axis=1)
  451. # Save plots using the defined helper function
  452. save_plots(projs1, vp_train_filtered, "Train_And_Test", "projs_1")
  453. save_plots(projs1[ex_itrain[n_nneurs]], vp_train_filtered[:, ex_itrain[n_nneurs]], "Train_Only" , "projs_1")
  454. save_plots(projs1[ex_itest[n_nneurs]], vp_train_filtered[:, ex_itest[n_nneurs]], "Test_Only", "projs_1")
  455. save_plots(projs2, vp_test_filtered, "Train_And_Test", "projs_2")
  456. save_plots(projs2[ex_itrain[n_nneurs]], vp_test_filtered[:, ex_itrain[n_nneurs]], "Train_Only" , "projs_2")
  457. save_plots(projs2[ex_itest[n_nneurs]], vp_test_filtered[:, ex_itest[n_nneurs]], "Test_Only", "projs_2")
  458. u_sub = ex_u[n_nneurs][:, :nsvc_predict]
  459. v_sub = ex_v[n_nneurs][:, :nsvc_predict]
  460. model = Rastermap(n_PCs=32, n_clusters=8).fit(np.hstack((trainX, testX)).T)
  461. if (l==len(lams)-1) and (k==len(nrank1)-1):
  462. np.save(os.path.join(res_path, 'vp_train_test__projs1_2.npy'), {
  463. 'vp_train': vp_train,
  464. 'vp_test': vp_test,
  465. 'projs1': projs1,
  466. 'projs2':projs2
  467. })
  468. plot_burst=1
  469. KBD1=191.4
  470. burst_start=[241, 244.2, 247.3, 252.2, 255.5, 258.8, 265, 270, 279.1, 280, 286.9, 301.9, 311.8, 317.5, 323.4, 334.1, 338.7, 350.6, 368.5, 376.6]
  471. supp_start=[243.5, 246.1, 248.8, 254, 257.8, 260, 270, 275.4, 280, 283.4, 289.8, 304, 312.5, 318.5, 324.4, 334.5, 339.5, 351.4, 369.5, 377.7]
  472. burst_start = np.array(burst_start)
  473. supp_start = np.array(supp_start)
  474. burst_start=burst_start-KBD1+120
  475. supp_start=supp_start-KBD1+120
  476. sampling_rate = 10
  477. def calculate_intervals(start_times, end_times):
  478. return [
  479. (int(start * sampling_rate), int(end * sampling_rate))
  480. for start, end in zip(start_times, end_times)
  481. ]
  482. if plot_burst == 1:
  483. # Burst time intervals
  484. burst_intervals = calculate_intervals(burst_start, supp_start)
  485. selected_indices = np.concatenate([np.arange(start, end) for start, end in burst_intervals])
  486. else:
  487. # Supp time intervals, excluding the last-to-first transition
  488. supp_intervals = calculate_intervals(supp_start[:-1], burst_start[1:])
  489. selected_indices = np.concatenate([np.arange(start, end) for start, end in supp_intervals])
  490. # Function to slice data using indices
  491. def get_sliced_data(data, indices):
  492. return data[indices, :]
  493. # Plotting logic
  494. compare_and_plot(
  495. model,
  496. get_sliced_data(trainX, selected_indices),
  497. get_sliced_data(testX, selected_indices),
  498. u_sub,
  499. v_sub,
  500. vp_train[:, selected_indices],
  501. vp_test[:, selected_indices],
  502. l,
  503. k,
  504. res_path,
  505. "Train_And_Test",
  506. centers
  507. )
  508. # Filter the indices for test and train specifically within selected_indices
  509. selected_test_indices = ex_itest[n_nneurs][np.isin(ex_itest[n_nneurs], selected_indices)]
  510. selected_train_indices = ex_itrain[n_nneurs][np.isin(ex_itrain[n_nneurs], selected_indices)]
  511. compare_and_plot(
  512. model,
  513. trainX[selected_test_indices, :],
  514. testX[selected_test_indices, :],
  515. u_sub,
  516. v_sub,
  517. vp_train[:, selected_test_indices],
  518. vp_test[:, selected_test_indices],
  519. l,
  520. k,
  521. res_path,
  522. "Test_Only",
  523. centers
  524. )
  525. compare_and_plot(
  526. model,
  527. trainX[selected_train_indices, :],
  528. testX[selected_train_indices, :],
  529. u_sub,
  530. v_sub,
  531. vp_train[:, selected_train_indices],
  532. vp_test[:, selected_train_indices],
  533. l,
  534. k,
  535. res_path,
  536. "Train_Only",
  537. centers
  538. )
  539. break
  540. plot_ane=1
  541. if plot_ane:
  542. compare_and_plot(model, trainX[ex_itest[n_nneurs][(ex_itest[n_nneurs] >= 500) & (ex_itest[n_nneurs] <= 4000)], :],
  543. testX[ex_itest[n_nneurs][(ex_itest[n_nneurs] >= 500) & (ex_itest[n_nneurs] <= 4000)], :],
  544. u_sub, v_sub,
  545. vp_train[:, ex_itest[n_nneurs][(ex_itest[n_nneurs] >= 500) & (ex_itest[n_nneurs] <= 4000)]],
  546. vp_test[:, ex_itest[n_nneurs][(ex_itest[n_nneurs] >= 500) & (ex_itest[n_nneurs] <= 4000)]],
  547. l, k, res_path, "Test_Only", centers)
  548. break
  549. compare_and_plot(model, trainX[500:4000, :], testX[500:4000, :], u_sub, v_sub, vp_train[:, 500:4000], vp_test[:, 500:4000], l, k, res_path, "Train_And_Test", centers)
  550. compare_and_plot(model, trainX[ex_itrain[n_nneurs][(ex_itrain[n_nneurs] >= 500) & (ex_itrain[n_nneurs] <= 4000)], :],
  551. testX[ex_itrain[n_nneurs][(ex_itrain[n_nneurs] >= 500) & (ex_itrain[n_nneurs] <= 4000)], :],
  552. u_sub, v_sub,
  553. vp_train[:, ex_itrain[n_nneurs][(ex_itrain[n_nneurs] >= 500) & (ex_itrain[n_nneurs] <= 4000)]],
  554. vp_test[:, ex_itrain[n_nneurs][(ex_itrain[n_nneurs] >= 500) & (ex_itrain[n_nneurs] <= 4000)]],
  555. l, k, res_path, "Train_Only", centers)
  556. else:
  557. new_start1 = 0
  558. new_end1 = 500
  559. new_start2 = 4000
  560. new_end2 = 9000
  561. combined_slice = np.r_[new_start1:new_end1, new_start2:new_end2]
  562. compare_and_plot(model,
  563. trainX[combined_slice, :],
  564. testX[combined_slice, :],
  565. u_sub, v_sub,
  566. vp_train[:, combined_slice],
  567. vp_test[:, combined_slice],
  568. l, k, res_path,
  569. "Train_And_Test", centers)
  570. test_condition = ((ex_itest[n_nneurs] >= new_start1) & (ex_itest[n_nneurs] < new_end1)) | \
  571. ((ex_itest[n_nneurs] >= new_start2) & (ex_itest[n_nneurs] < new_end2))
  572. selected_test_indices = ex_itest[n_nneurs][test_condition]
  573. compare_and_plot(model,
  574. trainX[selected_test_indices, :],
  575. testX[selected_test_indices, :],
  576. u_sub, v_sub,
  577. vp_train[:, selected_test_indices],
  578. vp_test[:, selected_test_indices],
  579. l, k, res_path,
  580. "Test_Only", centers)
  581. break
  582. train_condition = ((ex_itrain[n_nneurs] >= new_start1) & (ex_itrain[n_nneurs] < new_end1)) | \
  583. ((ex_itrain[n_nneurs] >= new_start2) & (ex_itrain[n_nneurs] < new_end2))
  584. selected_train_indices = ex_itrain[n_nneurs][train_condition]
  585. compare_and_plot(model,
  586. trainX[selected_train_indices, :],
  587. testX[selected_train_indices, :],
  588. u_sub, v_sub,
  589. vp_train[:, selected_train_indices],
  590. vp_test[:, selected_train_indices],
  591. l, k, res_path,
  592. "Train_Only", centers)
  593. def center_data(data, axis=0):
  594. mean = np.mean(data, axis=axis, keepdims=True)
  595. centered_data = data - mean
  596. return centered_data
  597. def reduced_rank_regressions_ym_2(ranks, ECoG_Extracted_Features, projs1, projs2, lams, res_path,
  598. ex_itrain, ex_itest, ex_u, ex_v, nsvc_predict, trainX, testX, centers):
  599. nrank1 = ranks[ranks <= ECoG_Extracted_Features.shape[1]]
  600. print("nrank1:", nrank1)
  601. n_nneurs = 0
  602. t_start_plot = 50
  603. t_end_plot = 400
  604. for l in tqdm(range(len(lams))):
  605. vp_combined_train = np.zeros((projs1.shape[1], ECoG_Extracted_Features.shape[0]))
  606. vp_combined_test = np.zeros_like(vp_combined_train)
  607. # cross1: use ex_itrain as training set, use ex_itest as test set
  608. atrain_p1, btrain_p1, _, _ = canonical_cov(
  609. projs1[ex_itrain[n_nneurs], :], ECoG_Extracted_Features[ex_itrain[n_nneurs], :], lams[l], npc=max(nrank1)
  610. )
  611. atest_p1, btest_p1, _, _ = canonical_cov(
  612. projs2[ex_itrain[n_nneurs], :], ECoG_Extracted_Features[ex_itrain[n_nneurs], :], lams[l], npc=max(nrank1)
  613. )
  614. # cross2: use ex_itest as training set, use ex_itrain as test set
  615. atrain_p2, btrain_p2, _, _ = canonical_cov(
  616. projs1[ex_itest[n_nneurs], :], ECoG_Extracted_Features[ex_itest[n_nneurs], :], lams[l], npc=max(nrank1)
  617. )
  618. atest_p2, btest_p2, _, _ = canonical_cov(
  619. projs2[ex_itest[n_nneurs], :], ECoG_Extracted_Features[ex_itest[n_nneurs], :], lams[l], npc=max(nrank1)
  620. )
  621. for k in tqdm(range(len(nrank1))): # try various ranks
  622. vp_train_p1 = (
  623. atrain_p1[:, :nrank1[k]] @ btrain_p1[:, :nrank1[k]].T @ ECoG_Extracted_Features[ex_itest[n_nneurs]].T
  624. )
  625. vp_test_p1 = atest_p1[:, :nrank1[k]] @ btest_p1[:, :nrank1[k]].T @ ECoG_Extracted_Features[ex_itest[n_nneurs]].T
  626. vp_train_p1=center_data(vp_train_p1,axis=1)
  627. vp_test_p1 =center_data(vp_test_p1, axis=1)
  628. vp_combined_train[:, ex_itest[n_nneurs]] = zscore(vp_train_p1.T).T
  629. vp_combined_test[:, ex_itest[n_nneurs]] = zscore(vp_test_p1.T).T
  630. vp_train_p2 = (
  631. atrain_p2[:, :nrank1[k]] @ btrain_p2[:, :nrank1[k]].T @ ECoG_Extracted_Features[ex_itrain[n_nneurs]].T
  632. )
  633. vp_test_p2 = atest_p2[:, :nrank1[k]] @ btest_p2[:, :nrank1[k]].T @ ECoG_Extracted_Features[ex_itrain[n_nneurs]].T
  634. vp_train_p2=center_data(vp_train_p2,axis=1)
  635. vp_test_p2 =center_data(vp_test_p2, axis=1)
  636. vp_combined_train[:, ex_itrain[n_nneurs]] = zscore(vp_train_p2.T).T
  637. vp_combined_test[:, ex_itrain[n_nneurs]] = zscore(vp_test_p2.T).T
  638. # filter
  639. window_length = 51
  640. polyorder = 11
  641. vp_combined_train_filtered = savgol_filter(vp_combined_train.T, window_length, polyorder, axis=0).T
  642. vp_combined_test_filtered = savgol_filter(vp_combined_test.T, window_length, polyorder, axis=0).T
  643. # plot and save
  644. plot_components = [0, 1, 2, 3, 4, 5, 6, 7, 15, 31, 63]
  645. def save_plots(proj, vp, filepath_suffix, filename_suffix):
  646. fig, axes = plt.subplots(len(plot_components), 1, figsize=(15, 25))
  647. for i, vec_idx in enumerate(plot_components):
  648. ax = axes[i]
  649. ax.plot(proj[t_start_plot*10:t_end_plot*10, vec_idx], color='b', alpha=0.5, label='real')
  650. ax.plot(vp.T[t_start_plot*10:t_end_plot*10, vec_idx], color='r', alpha=0.5, label='predicted')
  651. ax.set_title(f'SVC {vec_idx + 1}')
  652. ax.legend()
  653. ax.set_xlabel('time')
  654. ax.set_ylabel('SVCs')
  655. plt.tight_layout()
  656. filename_png = f"SVCs_l{l}_k{k}_nneur{n_nneurs}_{filename_suffix}.png"
  657. filename_pdf = f"SVCs_l{l}_k{k}_nneur{n_nneurs}_{filename_suffix}.pdf"
  658. directory_path = os.path.join(res_path, "predicted_SVCs", filepath_suffix)
  659. os.makedirs(directory_path, exist_ok=True)
  660. filepath_png = os.path.join(directory_path, filename_png)
  661. filepath_pdf = os.path.join(directory_path, filename_pdf)
  662. plt.savefig(filepath_png)
  663. plt.savefig(filepath_pdf, format='pdf')
  664. fig.clf()
  665. save_plots(projs1, vp_combined_train_filtered, "2-fold cross validation", "projs_1")
  666. save_plots(projs2, vp_combined_test_filtered, "2-fold cross validation", "projs_2")
  667. u_sub = ex_u[n_nneurs][:, :nsvc_predict]
  668. v_sub = ex_v[n_nneurs][:, :nsvc_predict]
  669. model = Rastermap(n_PCs=32, n_clusters=8).fit(np.hstack((trainX, testX)).T)
  670. # test_indices = ex_itest[n_nneurs][(ex_itest[n_nneurs] >= 500) & (ex_itest[n_nneurs] <= 4000)]
  671. compare_and_plot(model, trainX[500:4000], testX[500:4000], u_sub, v_sub,
  672. vp_combined_train_filtered[:, 500:4000], vp_combined_test_filtered[:, 500:4000],
  673. l, k, res_path, "2-fold cross validation")

utils_ym.py at commit 30759da, under GPL-3.0 · at the source

Overview

Authors: Guihua Xiao1,2,3, Mo Yang4, Lingbo Li2,3, Xintong Yao4, Jingyu Xie2,3, Xinyue Wang4, Jinyu Zang4, Yan Zhao4, Tianyi Fang4, Shuying Wu4, Wandi Qi2, Shipeng Lin4, Wenxi Sun5, Ting Lei5, Bo Hong4,6, Jiamin Wu1,2,3,6, Qionghai Dai1,2,3,6, Xiaochuan Dai4
  1. Beijing National Research Center for Information Science and Technology, Tsinghua University, Beijing, China
  2. Department of Automation, Tsinghua University, Beijing, China
  3. Institute for Brain and Cognitive Sciences, Tsinghua University, Beijing, China
  4. School of Biomedical Engineering, Tsinghua University, Beijing, China
  5. Key Laboratory of Polymer Chemistry and Physics of Ministry of Education, School of Materials Science and Engineering, Peking University, Beijing, China
  6. IDG/McGovern Institute for Brain Research, Tsinghua University, Beijing, China
Journal: Nature communications, volume 17, issue 1, article 5872
Dates: received 26 July 2025; accepted 15 April 2026; published online 29 April 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41467-026-72454-0 · PMID 42056115 · PMCID PMC13333928 · OpenAlex W7158914550
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: extracellular electrophysiology (units, LFP) (modality), mouse (organism), systems (subfield)
Methods: Spectral & time-frequency, Preprocessing, Statistics, Machine learning, Connectivity, Complexity, Single-unit activity, calcium imaging, Smoothing, state filtering, decompositions, Physiology & signal measures
Keywords: Computational neuroscience, Cognitive neuroscience, Extracellular recording
MeSH: Cerebral Cortex*, Neurons*, Action Potentials, Animals, Calcium, Isoflurane, Mice, Mice, Inbred C57BL (* major topic)
Topic: Neural dynamics and brain function (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Natural Science Foundation of China (National Science Foundation of China) (62171254, 82151305); Beijing Nova Program (20230484252)
Citations: cited by 2 papers (Europe PMC); 70 references in the paper

Abstract

Burst suppression is widely observed across cortical regions during reversible or pathological unconsciousness, yet its neuronal organization remains incompletely understood. Here we present an integrated Cortex-wide Optical-electrical Dual-modal Explorer (CODE) system to examine neuronal dynamics during burst suppression under isoflurane anesthesia in the mouse. We identified distinct cortex-wide neuronal ensembles that alternately associate with burst or suppression events, exhibiting dynamic neuronal recruitment and reactivation during anesthesia. Burst events were marked by highly synchronized neuronal activity early in the burst phase with high functional connectivity, whereas suppression events displayed more asynchronous, temporally distributed activity with reduced connectivity. Transitions between these states involved sequential, directionally organized propagation across cortical regions. ECoG bursts propagated from bilateral sensory cortices to motor areas within tens of milliseconds with increasing synchrony with calcium activity. Furthermore, we established a robust metric linking ECoG and calcium signals, revealing state-dependent interpretability. These findings reveal the single-neuron-to-population architecture of burst suppression and illustrate how integrated optical–electrical measurements enable high-resolution, large-scale interrogation of cortical dynamics.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 7 matches between paragraphs and lines of code.

Zenodo 18295118

License: CC-BY-4.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (10 files), Matplotlib (9 files), pandas (9 files), SciPy (9 files), seaborn (9 files), h5py (5 files), NetworkX (4 files), Pillow (4 files), tifffile (4 files), OpenCV (2 files), scikit-learn (2 files)
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
10 files
At the source:

YangMoTsinghua/Predict_Calcium_From_ECoG

License: GPL-3.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 30759da57e27e02008b29f378ed0405ab04e8da7, 13 August 2025
Languages: Python (4), Jupyter (2)
Size: 15 files, 6 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file, 2 notebooks
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (6 files), SciPy (6 files), Matplotlib (4 files), pandas (2 files), scikit-learn (2 files), seaborn (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
9 files

IrisRegion/Burst_suppression_analysis_based_on_cortex-wide_neural_optoelectronic_interface

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 382be8ac1fa8e3a312618c2cf085321528d1183f, 26 September 2024
Languages: Jupyter (15)
Size: 17 files, 15 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, environment (requirements.txt), 15 notebooks
Not found: license file, CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (10 files), Matplotlib (9 files), pandas (9 files), SciPy (9 files), seaborn (9 files), h5py (5 files), NetworkX (4 files), Pillow (4 files), tifffile (4 files), OpenCV (2 files), scikit-learn (2 files)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
10 files

Code availability

All custom code used for data analysis is available at the following repositories: https://github.com/YangMoTsinghua/Predict_Calcium_From_ECoG, https://github.com/IrisRegion/Burst_suppression_analysis_based_on_cortex-wide_neural_optoelectronic_interface.git, and on Zenodo (10.5281/zenodo.18295118).

Reproduced under the paper's license (CC BY), from the paper cited above.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 3 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 26 scripts, each with its path and the digest of its content;
  • 7 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data availability

The calcium imaging raw data supporting the findings of this study exceed 100 TB in size. To facilitate access, representative demo data used for the analyses are available at 10.5281/zenodo.18295118. All processed data related to each mouse, including extracted neuronal traces and electrophysiological signals, are available at 10.5281/zenodo.18324142. The raw dataset is available from the corresponding authors without restriction. Source data are provided in this paper.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 18 authors, 3 keywords, 8 MeSH terms, 2 funders, 64 references.

Cite

This paper

Xiao, G., Yang, M., Li, L., Yao, X., Xie, J., Wang, X., Zang, J., Zhao, Y., Fang, T., Wu, S., Qi, W., Lin, S., Sun, W., Lei, T., Hong, B., Wu, J., Dai, Q., & Dai, X. (2026). Dynamic neuronal ensembles encode burst-suppression revealed by cortex-wide optical-electrical interfaces. Nature communications, 17(1), 5872. https://doi.org/10.1038/s41467-026-72454-0

BibTeX

@article{xiao2026dynamic,
author = {Xiao, Guihua and Yang, Mo and Li, Lingbo and Yao, Xintong and Xie, Jingyu and Wang, Xinyue and Zang, Jinyu and Zhao, Yan and Fang, Tianyi and Wu, Shuying and Qi, Wandi and Lin, Shipeng and Sun, Wenxi and Lei, Ting and Hong, Bo and Wu, Jiamin and Dai, Qionghai and Dai, Xiaochuan},
title = {{Dynamic neuronal ensembles encode burst-suppression revealed by cortex-wide optical-electrical interfaces}},
journal = {Nature communications},
year = {2026},
month = apr,
volume = {17},
number = {1},
pages = {5872},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-026-72454-0},
url = {https://doi.org/10.1038/s41467-026-72454-0},
pmid = {42056115},
pmcid = {PMC13333928}
}

RIS

TY - JOUR
AU - Xiao, Guihua
AU - Yang, Mo
AU - Li, Lingbo
AU - Yao, Xintong
AU - Xie, Jingyu
AU - Wang, Xinyue
AU - Zang, Jinyu
AU - Zhao, Yan
AU - Fang, Tianyi
AU - Wu, Shuying
AU - Qi, Wandi
AU - Lin, Shipeng
AU - Sun, Wenxi
AU - Lei, Ting
AU - Hong, Bo
AU - Wu, Jiamin
AU - Dai, Qionghai
AU - Dai, Xiaochuan
TI - Dynamic neuronal ensembles encode burst-suppression revealed by cortex-wide optical-electrical interfaces
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/04/29
VL - 17
IS - 1
SP - 5872
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-72454-0
UR - https://doi.org/10.1038/s41467-026-72454-0
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-72454-0",
"type": "article-journal",
"title": "Dynamic neuronal ensembles encode burst-suppression revealed by cortex-wide optical-electrical interfaces",
"container-title": "Nature communications",
"author": [
{
"family": "Xiao",
"given": "Guihua"
},
{
"family": "Yang",
"given": "Mo"
},
{
"family": "Li",
"given": "Lingbo"
},
{
"family": "Yao",
"given": "Xintong"
},
{
"family": "Xie",
"given": "Jingyu"
},
{
"family": "Wang",
"given": "Xinyue"
},
{
"family": "Zang",
"given": "Jinyu"
},
{
"family": "Zhao",
"given": "Yan"
},
{
"family": "Fang",
"given": "Tianyi"
},
{
"family": "Wu",
"given": "Shuying"
},
{
"family": "Qi",
"given": "Wandi"
},
{
"family": "Lin",
"given": "Shipeng"
},
{
"family": "Sun",
"given": "Wenxi"
},
{
"family": "Lei",
"given": "Ting"
},
{
"family": "Hong",
"given": "Bo"
},
{
"family": "Wu",
"given": "Jiamin"
},
{
"family": "Dai",
"given": "Qionghai"
},
{
"family": "Dai",
"given": "Xiaochuan"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "5872",
"DOI": "10.1038/s41467-026-72454-0",
"PMID": "42056115",
"PMCID": "PMC13333928",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-72454-0",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
29
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s41592-023-01838-7 [code]
Rapid detection of neurons in widefield calcium imaging datasets after training with synthetic data.
Journal: Nature methods
In common: tifffile, OpenCV, scikit-learn, 3 other tools, mouse, 4 references, 2 authors
[2] doi:10.1038/s41467-024-54346-3 [code]
Mesoscale neuronal granular trial variability in vivo illustrated by nonlinear recurrent network in silico.
Journal: Nature communications
In common: mouse, 6 references, 2 authors
[3] doi:10.1038/s41587-022-01450-8 [code]
Real-time denoising enables high-sensitivity fluorescence time-lapse imaging beyond the shot-noise limit.
Journal: Nature biotechnology
In common: tifffile, OpenCV, Matplotlib, 1 other tool, mouse, 2 references, 2 authors
[4] doi:10.1038/s41467-025-63823-2 [code]
Prominent involvement of acetylcholine dynamics in stable olfactory representation across the Drosophila brain.
Journal: Nature communications
In common: tifffile, scikit-learn, SciPy, 2 other tools, 2 references, 2 authors
[5] doi:10.1038/s41592-025-02886-x [code]
CELLECT: contrastive embedding learning for large-scale efficient cell tracking.
Journal: Nature methods
In common: tifffile, pandas, Matplotlib, 1 other tool, mouse, 2 references, 2 authors
[6] doi:10.1038/s41592-025-02698-z [code]
Physics-driven self-supervised learning for fast high-resolution robust 3D reconstruction of light-field microscopy.
Journal: Nature methods
In common: tifffile, h5py, Pillow, 1 other tool, mouse, 1 reference, 2 authors
[7] doi:10.1016/j.celrep.2022.111453 [code]
E-Cannula reveals anatomical diversity in sharp-wave ripples as a driver for the recruitment of distinct hippocampal assemblies.
Journal: Cell reports
In common: tifffile, OpenCV, h5py, 7 other tools, extracellular electrophysiology (units, LFP), systems, mouse, 2 references
[8] doi:10.7554/elife.109717 [code]
Retrosplenial cortex enables context-dependent goal-directed sensorimotor transformation.
Journal: eLife
In common: tifffile, OpenCV, h5py, 7 other tools, systems, mouse, 3 references
[9] doi:10.7554/elife.94167 [code]
Pan-cortical 2-photon mesoscopic imaging and neurobehavioral alignment in awake, behaving mice.
Journal: eLife
In common: tifffile, OpenCV, h5py, 7 other tools, mouse, 3 references
[10] doi:10.1038/s41467-024-48575-9 [code]
Zero-shot learning enables instant denoising and super-resolution in optical fluorescence microscopy.
Journal: Nature communications
In common: tifffile, OpenCV, SciPy, 1 other tool, mouse, 2 authors

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1038/s41467-026-72454-0.svg)](https://openscicode.org/badge/doi/10.1038/s41467-026-72454-0)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-72454-0.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41467-026-72454-0
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-72454-0"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-72454-0.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.