OSCR

Network based statistics associates increased connectivity to REM sleep disorder and hallucinations in early DLB.

Code ↔ Paper

1 match 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.

The 1 match
  1. [1] § Methods › EEG data acquisition and preprocessing ↔ examples_paper/preprocessing_info.py, lines 132–206 · score 0.69 · independent component, bad channels, MNE, Preprocessing, ICA, EEG

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 547 lines · 27 KB · BSD-3-Clause · 1 match

  1. # -*- coding: utf-8 -*-
  2. """
  3. Preprocessing routine
  4. =====================
  5. Preprocessing includes:\n
  6. * Selection of proper time-interval
  7. * Band pass filtering in [2, 50]Hz
  8. * Mark bad segments
  9. * Bad channels interpolation
  10. * Independent component analysis
  11. * Additional automatic removal of bad segments
  12. """
  13. import mne
  14. import pandas as pd
  15. import os.path as op
  16. from os import makedirs
  17. import numpy as np
  18. from mne_bids import BIDSPath, read_raw_bids
  19. from autoreject import get_rejection_threshold
  20. def preprocessing(data_root, datatype, subject, session, task, suffix, data_path):
  21. bids_path = BIDSPath(subject=subject, task=task, suffix=suffix, session=session,
  22. datatype=datatype, root=data_root)
  23. elec_path = BIDSPath(subject=subject, task=task, suffix='electrodes', session=session,
  24. datatype=datatype, root=data_root)
  25. # Load data for one subject and remove unused channels
  26. extra_params = {'preload': True}
  27. raw = read_raw_bids(bids_path=bids_path, extra_params=extra_params, verbose=False)
  28. raw.drop_channels(['TP9', 'TP10', 'FT9', 'FT10', 'X', 'Y', 'Z'])
  29. elec_df = pd.read_csv(elec_path, sep='\t', header=0, index_col=None)
  30. ch_names = elec_df['name'].tolist()[:-3]
  31. ch_coords = (np.array([[0, -1, 0], [1, 0, 0], [0, 0, 1]]).dot(
  32. (elec_df[['x', 'y', 'z']].to_numpy(dtype=float)[:-3, :]*10**(-3)).T)).T
  33. ch_pos = dict(zip(ch_names, ch_coords))
  34. # Define EEG channel montage
  35. montage = mne.channels.make_dig_montage(ch_pos, coord_frame='head')
  36. raw.set_montage(montage)
  37. ch_type = {}
  38. for ch_name in raw.info['ch_names']:
  39. if ch_name == 'VEOG':
  40. ch_type[ch_name] = 'eog'
  41. elif ch_name == 'X':
  42. ch_type[ch_name] = 'misc'
  43. elif ch_name == 'Y':
  44. ch_type[ch_name] = 'misc'
  45. elif ch_name == 'Z':
  46. ch_type[ch_name] = 'misc'
  47. else:
  48. ch_type[ch_name] = 'eeg'
  49. raw.set_channel_types(ch_type)
  50. # Extract time-intervals corresponding to eye-closed (EC) and task conditions
  51. tmin_EC = None
  52. tmin_task1 = None
  53. for ann in raw.annotations:
  54. if ('Eyes Closed' in ann['description']) & (tmin_EC is None):
  55. tmin_EC = ann['onset']
  56. elif ('Eyes Closed' in ann['description']) & (tmin_EC is not None):
  57. tmax_EC = ann['onset']
  58. elif ('Tone' in ann['description']) & (tmin_task1 is None):
  59. tmin_task1 = ann['onset']
  60. tmax_task1 = tmin_task1
  61. elif ('Tone' in ann['description']) & (tmin_task1 is not None):
  62. if ann['onset'] - tmax_task1 < 6:
  63. tmax_task1 = ann['onset']
  64. # Manual selection for two subjects
  65. if subject == '033':
  66. tmin_EC = 402
  67. tmax_EC = 460
  68. if subject == '019':
  69. tmin_EC = 355
  70. tmax_EC = 414
  71. raw_EC = raw.copy().crop(tmin=tmin_EC, tmax=tmax_EC)
  72. raw_task = raw.copy().crop(tmin=tmin_task1, tmax=tmax_task1)
  73. # Band-pass filter between 2 and 50 hz
  74. raw_EC.filter(2, 50, method='fir', fir_design='firwin', filter_length='auto',
  75. fir_window='hamming', picks='all')
  76. raw_task.filter(2, 50, method='fir', fir_design='firwin', filter_length='auto',
  77. fir_window='hamming', picks='all')
  78. raw_EC = raw_EC.pick_types(eeg=True, exclude=raw_EC.info['bads'])
  79. raw_task = raw_task.pick_types(eeg=True, exclude=raw_task.info['bads'])
  80. # Visually inspect data and mark bad channels
  81. duration = 1
  82. overlap = 0
  83. eve_EC = mne.make_fixed_length_events(raw_EC, id=1, start=0, stop=None, duration=duration,
  84. first_samp=False, overlap=overlap)
  85. eve_EC[:, 0] = raw_EC.first_samp + eve_EC[:, 0]
  86. eve_task = mne.make_fixed_length_events(raw_task, id=1, start=0, stop=None, duration=duration,
  87. first_samp=False, overlap=overlap)
  88. eve_task[:, 0] = raw_task.first_samp + eve_task[:, 0]
  89. epo_EC = mne.Epochs(raw_EC, eve_EC, preload=True, baseline=None, tmin=0, tmax=duration,
  90. proj=False, reject=None, flat=None, detrend=None, reject_by_annotation=False)
  91. epo_task = mne.Epochs(raw_task, eve_task, preload=True, baseline=None, tmin=0,
  92. tmax=duration, proj=False, reject=None, flat=None,
  93. detrend=None, reject_by_annotation=True)
  94. if subject in drop_idxs['ses'+session]['EC'].keys():
  95. drop_idx = drop_idxs['ses'+session]['EC'][subject]
  96. else:
  97. drop_idx = []
  98. epo_EC.drop(drop_idx)
  99. data_epo_EC = epo_EC.get_data()
  100. data_raw_EC = np.zeros((data_epo_EC.shape[1], data_epo_EC.shape[0]*data_epo_EC.shape[2]))
  101. for i_ch in range(data_epo_EC.shape[1]):
  102. data_raw_EC[i_ch, :] = np.reshape(data_epo_EC[:, i_ch, :].squeeze(),
  103. (1, data_epo_EC.shape[0]*data_epo_EC.shape[2]))
  104. raw_EC = mne.io.RawArray(data_raw_EC, raw_EC.info)
  105. if subject in drop_idxs['ses'+session]['task'].keys():
  106. drop_idx = drop_idxs['ses'+session]['task'][subject]
  107. else:
  108. drop_idx = []
  109. epo_task.drop(drop_idx)
  110. data_epo_task = epo_task.get_data()
  111. data_raw_task = np.zeros((data_epo_task.shape[1], data_epo_task.shape[0]*data_epo_task.shape[2]))
  112. for i_ch in range(data_epo_task.shape[1]):
  113. data_raw_task[i_ch, :] = np.reshape(data_epo_task[:, i_ch, :].squeeze(),
  114. (1, data_epo_task.shape[0]*data_epo_task.shape[2]))
  115. raw_task = mne.io.RawArray(data_raw_task, raw_task.info)
  116. # Manually mark bad channels
  117. raw_EC.info['bads'] = bad_chs['ses'+session]['EC'][subject]
  118. raw_task.info['bads'] = bad_chs['ses'+session]['task'][subject]
  119. raw_EC.annotations.delete(np.arange(len(raw_EC.annotations)))
  120. raw_task.annotations.delete(np.arange(len(raw_task.annotations)))
  121. # Interpolate bad channels
  122. raw_EC.interpolate_bads()
  123. raw_task.interpolate_bads()
  124. # Rereferencing
  125. raw_EC.set_eeg_reference(ref_channels='average', ch_type='eeg')
  126. raw_task.set_eeg_reference(ref_channels='average', ch_type='eeg')
  127. # Independent component analysis (ICA) of EC
  128. ica = mne.preprocessing.ICA(n_components=0.99, method='picard', random_state=42)
  129. picks = mne.pick_types(raw_EC.info, meg=False, eeg=True, eog=True, stim=False, exclude='bads')
  130. ica.fit(raw_EC, picks=picks)
  131. ica.exclude = bad_ICA_EC['ses'+session][subject]
  132. ica.apply(raw_EC)
  133. # ICA of task
  134. ica = mne.preprocessing.ICA(n_components=0.99, method='picard', random_state=42)
  135. picks = mne.pick_types(raw_task.info, meg=False, eeg=True, eog=True, stim=False, exclude='bads')
  136. ica.fit(raw_task, picks=picks)
  137. ica.exclude = bad_ICA_task['ses'+session][subject]
  138. ica.apply(raw_task)
  139. # Automatically reject bad epochs
  140. duration = 1
  141. overlap = 0
  142. eve_EC = mne.make_fixed_length_events(raw_EC, id=1, start=0, stop=None, duration=duration,
  143. first_samp=False, overlap=overlap)
  144. eve_EC[:, 0] = raw_EC.first_samp + eve_EC[:, 0]
  145. eve_task = mne.make_fixed_length_events(raw_task, id=1, start=0, stop=None, duration=duration,
  146. first_samp=False, overlap=overlap)
  147. eve_task[:, 0] = raw_task.first_samp + eve_task[:, 0]
  148. epo_EC = mne.Epochs(raw_EC, eve_EC, preload=True, baseline=None, tmin=0, tmax=duration,
  149. proj=False, reject=None, flat=None, detrend=None, reject_by_annotation=False)
  150. epo_task = mne.Epochs(raw_task, eve_task, preload=True, baseline=None, tmin=0,
  151. tmax=duration, proj=False, reject=None, flat=None, detrend=None,
  152. reject_by_annotation=True)
  153. reject_EC = get_rejection_threshold(epo_EC, ch_types='eeg')
  154. epo_EC_clean = epo_EC.drop_bad(reject=reject_EC)
  155. data_EC_clean = epo_EC_clean.get_data()
  156. reject_task = get_rejection_threshold(epo_task, ch_types='eeg')
  157. epo_task_clean = epo_task.drop_bad(reject=reject_task)
  158. data_task_clean = epo_task_clean.get_data()
  159. data_raw_EC = np.zeros((data_EC_clean.shape[1], data_EC_clean.shape[0]*data_EC_clean.shape[2]))
  160. for i_ch in range(data_EC_clean.shape[1]):
  161. data_raw_EC[i_ch, :] = np.reshape(data_EC_clean[:, i_ch, :].squeeze(),
  162. (1, data_EC_clean.shape[0]*data_EC_clean.shape[2]))
  163. data_raw_task = np.zeros((data_task_clean.shape[1], data_task_clean.shape[0]*data_task_clean.shape[2]))
  164. for i_ch in range(data_task_clean.shape[1]):
  165. data_raw_task[i_ch, :] = np.reshape(data_task_clean[:, i_ch, :].squeeze(),
  166. (1, data_task_clean.shape[0]*data_task_clean.shape[2]))
  167. raw_EC = mne.io.RawArray(data_raw_EC, raw_EC.info)
  168. raw_task = mne.io.RawArray(data_raw_task, raw_task.info)
  169. # Saving EC and task preprocessed data
  170. f_path = op.join(data_path, 'preproc_files', 'sub'+subject, 'ses'+session)
  171. if not op.isdir(f_path):
  172. makedirs(f_path)
  173. f_name_EC = op.join(f_path, 'sub-'+subject+'_ses-'+session+'_task-eyeclose_raw.fif')
  174. f_name_task = op.join(f_path, 'sub-'+subject+'_ses-'+session+'_task-memory_raw.fif')
  175. raw_EC.save(f_name_EC, overwrite=True)
  176. raw_task.save(f_name_task, overwrite=True)
  177. return
  178. drop_idxs = {'ses01': {'EC': {'003': [39],
  179. '031': [0],
  180. '032': [0, 1, 2, 32, 33, 56],
  181. '036': [2, 3, 4],
  182. '038': [33, 34],
  183. '041': [0, 1],
  184. '046': [21, 24]},
  185. 'task': {'031': [0, 1, 2, 3, 24],
  186. '034': [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 95, 96, 97,
  187. 98, 99, 100, 101],
  188. '036': [0, 1],
  189. '038': [21, 22, 60, 61, 78, 79, 111, 112],
  190. '041': [0],
  191. '046': [6, 7, 8, 9, 10, 21, 22, 27, 28, 32, 45, 51, 58, 59,
  192. 60, 62, 63, 70, 71, 72,
  193. 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
  194. 87, 88, 89, 90, 92, 94,
  195. 95, 96, 97, 108, 114, 115],
  196. '047': [0, 1, 2, 3, 4, 5, 6, 88, 89, 90, 91, 92, 93, 94, 95,
  197. 96, 97, 98, 99, 100,
  198. 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  199. 112, 113, 114, 115]}},
  200. 'ses02': {'EC': {},
  201. 'task': {'013': [47, 48, 49],
  202. '016': [23, 24, 27, 28, 33, 34, 35, 59, 60, 61]}}
  203. }
  204. bad_chs = {'ses02': {'EC': {'001': [],
  205. '002': [],
  206. '004': ['T8', 'Cz'],
  207. '006': ['AF7'],
  208. '007': [],
  209. '008': ['CP2'],
  210. '009': ['CP2', 'CP1'],
  211. '010': ['CP2'],
  212. '011': [],
  213. '012': [],
  214. '013': ['CP2', 'CP1'],
  215. '014': ['Cz'],
  216. '015': [],
  217. '016': ['Pz', 'POz'],
  218. '017': [],
  219. '018': [],
  220. '019': [],
  221. '020': ['CP2', 'CP1'],
  222. '021': [],
  223. '022': [],
  224. '023': ['CP2', 'CP1'],
  225. '024': ['T8', 'CP2', 'CP1'],
  226. '025': [],
  227. '026': [],
  228. '027': ['Cz']},
  229. 'task': {'001': ['T8', 'FT7', 'F4'],
  230. '002': [],
  231. '004': ['T8', 'Cz'],
  232. '005': [],
  233. '006': [],
  234. '007': [],
  235. '008': ['CP2'],
  236. '009': ['CP2', 'CP1'],
  237. '010': ['CP2'],
  238. '011': [],
  239. '012': [],
  240. '013': ['CP2', 'CP1'],
  241. '014': ['Cz'],
  242. '015': [],
  243. '016': ['Pz', 'POz'],
  244. '017': [],
  245. '018': [],
  246. '019': [],
  247. '020': ['CP2', 'CP1'],
  248. '021': [],
  249. '022': [],
  250. '023': ['CP2', 'CP1'],
  251. '024': ['T8', 'CP2', 'CP1'],
  252. '025': [],
  253. '026': [],
  254. '027': ['Cz']}},
  255. 'ses01': {'EC': {'001': ['TP7', 'FT8'],
  256. '002': ['P7', 'TP7'],
  257. '003': [],
  258. '004': ['FCz', 'Cz'],
  259. '005': [],
  260. '006': ['CP2', 'CP1'],
  261. '007': ['FT7', 'T7'],
  262. '008': [],
  263. '009': [],
  264. '010': [],
  265. '011': [],
  266. '012': [],
  267. '013': ['F2'],
  268. '014': ['AF8', 'F6', 'F8'],
  269. '015': [],
  270. '016': ['Cz'],
  271. '017': [],
  272. '018': [],
  273. '019': [],
  274. '020': [],
  275. '021': ['F1', 'Cz'],
  276. '022': ['F1'],
  277. '023': [],
  278. '024': ['T8', 'CP1', 'CP2'],
  279. '025': [],
  280. '026': ['T7'],
  281. '027': [],
  282. '028': [],
  283. '029': [],
  284. '030': ['CP1'],
  285. '031': [],
  286. '032': [],
  287. '033': [],
  288. '034': ['T8', 'T7'],
  289. '035': ['F1'],
  290. '036': ['F8'],
  291. '037': ['CP5', 'CP6'],
  292. '038': [],
  293. '039': [],
  294. '040': ['Cz', 'C2', 'FCz'],
  295. '041': [],
  296. '042': [],
  297. '043': [],
  298. '044': [],
  299. '045': [],
  300. '046': [],
  301. '047': [],
  302. '048': ['P6'],
  303. '049': [],
  304. '050': []},
  305. 'task': {'001': ['TP7', 'FT8', 'T8'],
  306. '002': ['P7', 'TP7'],
  307. '003': [],
  308. '004': ['FCz', 'Cz', 'T7'],
  309. '005': [],
  310. '006': ['CP2', 'CP1'],
  311. '007': ['FT7', 'T7'],
  312. '008': [],
  313. '009': [],
  314. '010': [],
  315. '011': [],
  316. '012': [],
  317. '013': [],
  318. '014': [],
  319. '015': [],
  320. '016': ['Cz'],
  321. '017': [],
  322. '018': [],
  323. '019': [],
  324. '020': ['F5'],
  325. '021': ['F1', 'Cz'],
  326. '022': ['F1'],
  327. '023': [],
  328. '024': ['CP1', 'CP2'],
  329. '025': [],
  330. '026': [],
  331. '027': [],
  332. '028': [],
  333. '029': [],
  334. '030': ['CP1', 'FC6', 'FT8'],
  335. '031': [],
  336. '032': ['AF7'],
  337. '033': [],
  338. '034': ['T8', 'T7'],
  339. '035': ['F1'],
  340. '036': [],
  341. '037': ['CP6'],
  342. '038': [],
  343. '039': [],
  344. '040': ['Cz', 'C2', 'FCz'],
  345. '041': [],
  346. '042': [],
  347. '043': [],
  348. '044': [],
  349. '045': [],
  350. '046': [],
  351. '047': [],
  352. '048': ['P6'],
  353. '049': [],
  354. '050': []}}}
  355. bad_ICA_EC = {'ses01': {'001': [2, 5, 6, 7, 9, 19, 20, 21],
  356. '002': [1, 4, 10, 12, 14, 16, 20, 21, 24, 28, 30, 32, 33, 37, 40],
  357. '003': [0, 16, 24, 25, 27, 36, 37],
  358. '004': [0, 9, 14, 16, 17, 19, 28, 29],
  359. '005': [],
  360. '006': [15, 16, 18, 19, 21, 26, 27, 28, 29, 31, 32],
  361. '007': [3, 4, 15, 16, 19, 21, 24, 30],
  362. '008': [7],
  363. '009': [0, 11, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27],
  364. '010': [0, 11, 13, 16, 17, 20, 21, 23, 25],
  365. '011': [22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
  366. '012': [26, 27, 28, 33, 34, 35, 37, 38, 38, 40],
  367. '013': [1, 2, 8, 13, 18, 19, 24, 25, 33],
  368. '014': [3, 5, 17, 21, 27, 28, 31, 33, 34],
  369. '015': [16, 17, 18, 19, 20, 23, 25, 26],
  370. '016': [13, 14, 18, 24],
  371. '017': [6, 8, 9, 11, 12, 13, 14, 15, 16, 17],
  372. '018': [],
  373. '019': [11, 16, 17, 18, 20, 22, 23, 24, 25, 30],
  374. '020': [17, 20, 22, 24, 25, 27, 28, 29, 30, 31, 32, 33],
  375. '021': [3, 10, 11, 14, 15, 17],
  376. '022': [9, 15, 16, 21, 28],
  377. '023': [4, 5, 6, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27],
  378. '024': [4, 6, 12, 14, 15, 16, 19, 21, 22, 23, 29],
  379. '025': [13, 21, 22, 24],
  380. '026': [0, 7],
  381. '027': [12, 15, 17, 25],
  382. '028': [0, 2, 28],
  383. '029': [0, 4, 6, 8, 13, 16, 26, 31],
  384. '030': [0, 1, 2, 3, 5, 6, 10, 11, 14, 15, 16, 17, 21, 23, 30, 31],
  385. '031': [4, 15, 18, 28, 31, 32, 33],
  386. '032': [0, 16, 19, 20, 22, 23, 24, 26, 27, 28, 29, 30, 31, 34],
  387. '033': [0, 1, 4, 11, 26, 32, 34, 37],
  388. '034': [3, 15, 28],
  389. '035': [7, 10],
  390. '036': [0, 1, 2, 3, 4, 16, 25, 33, 36, 37],
  391. '037': [0, 1, 3, 4, 5, 6, 10, 12, 20, 30, 43],
  392. '038': [0, 1, 6, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
  393. 24, 26, 27, 28],
  394. '039': [4, 10, 18, 19],
  395. '040': [0, 4, 9, 15, 19, 29],
  396. '041': [6, 9, 10, 12, 15, 16],
  397. '042': [1, 3, 21, 25, 31, 37],
  398. '043': [0, 6, 35],
  399. '044': [0, 4, 35],
  400. '045': [0, 1, 3, 4, 11, 12, 14, 15, 16, 17],
  401. '046': [0, 1, 2, 3, 4, 5, 6, 8, 11, 12, 13, 15, 16, 18, 20, 22, 23],
  402. '047': [4, 15, 16, 17, 24, 25, 26, 29, 30, 31, 32, 34],
  403. '048': [0, 1, 2, 3, 18, 27, 28, 35, 36, 37, 38, 39],
  404. '049': [0, 1],
  405. '050': [0, 2, 14, 15, 31, 34, 36]},
  406. 'ses02': {'001': [5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 23, 24, 25, 26, 31,
  407. 34],
  408. '002': [0, 20, 22, 24, 35, 38, 39],
  409. '004': [14, 19, 20, 21, 22],
  410. '006': [0, 5, 16, 18, 21, 22, 23],
  411. '007': [4, 7, 14, 16],
  412. '008': [2, 10],
  413. '009': [0, 5, 6, 12, 14, 21, 23, 24, 25, 26],
  414. '010': [0, 8, 12, 13, 17, 19, 21, 23, 24, 25, 26],
  415. '011': [10, 12, 17, 18, 19, 24, 25, 27, 32, 34, 41],
  416. '012': [0, 2, 31, 33, 34, 35],
  417. '013': [19, 20, 21, 26],
  418. '014': [0, 5, 18, 20, 23, 24, 26, 28, 29, 33],
  419. '015': [1, 14, 18, 20, 21, 23, 24, 25, 26, 28],
  420. '016': [14, 15, 18, 19, 24, 25],
  421. '017': [8, 9, 11, 14, 15, 18, 19, 22, 26, 27],
  422. '018': [6, 10, 21, 22, 25, 27, 28, 38],
  423. '019': [0, 7, 15, 18, 19, 20, 21, 23, 25, 26, 27],
  424. '020': [1, 5, 13, 17, 18, 23, 24, 25, 26, 27, 30, 31, 33],
  425. '021': [12, 14, 15, 16, 19, 20, 21, 22, 23, 25, 26],
  426. '022': [0, 2, 8, 12, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28],
  427. '023': [13, 14, 16, 21, 23, 24, 25, 26, 27, 28],
  428. '024': [7, 10, 20, 21, 22, 23, 24, 27],
  429. '025': [10, 11, 13, 17, 18, 20, 21, 22, 23],
  430. '026': [5, 12, 14, 19, 22, 26],
  431. '027': [13, 14, 19, 20, 21]},
  432. }
  433. bad_ICA_task = {'ses01': {'001': [0, 2, 3, 4, 9, 12, 20, 27, 28],
  434. '002': [1, 2, 5, 6, 27, 34, 38, 40, 41, 42],
  435. '003': [0, 1, 11, 12, 14, 15],
  436. '004': [3, 11, 12, 13, 20, 23, 25, 26, 27],
  437. '005': [],
  438. '006': [0, 12, 13, 14, 16, 17, 18, 20, 21, 22],
  439. '007': [2, 5, 11, 12, 13, 17, 18, 19, 21],
  440. '008': [0, 5, 8, 26, 27, 31],
  441. '009': [0, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25],
  442. '010': [0, 5, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23],
  443. '011': [0, 8, 9, 11, 13, 15, 16, 20, 21, 22, 25, 26, 28, 29],
  444. '012': [0, 11, 12, 16, 18, 20, 22, 23, 24, 25, 29, 30],
  445. '013': [0, 4, 6, 11, 13, 14, 15, 16, 17, 24, 25, 29, 32],
  446. '014': [0, 5, 12, 19, 20, 22, 23, 24, 26, 30, 31, 33],
  447. '015': [0, 12, 13, 14, 16, 18, 19, 20, 21, 22, 23],
  448. '016': [0, 9, 11, 12, 16, 17, 19, 23],
  449. '017': [0, 6, 9, 10, 11, 13, 14, 15, 18, 21, 22, 24, 25, 26, 27, 28],
  450. '018': [],
  451. '019': [0, 3, 9, 13, 14, 15, 18, 19, 23, 24, 25, 26],
  452. '020': [0, 5, 9, 11, 12, 13, 14, 15, 18, 20, 21, 22, 23, 24, 25, 27,
  453. 28, 29, 30, 31, 33],
  454. '021': [0, 7, 8, 10, 11, 12, 15, 16],
  455. '022': [0, 2, 4, 6, 7, 8, 11, 12, 15, 17, 23, 25],
  456. '023': [0, 4, 5, 6, 7, 8, 10, 11, 12, 13],
  457. '024': [0, 1, 5, 6, 8, 9, 10, 12, 13, 14, 15, 16],
  458. '025': [20, 26],
  459. '026': [0],
  460. '027': [0, 12, 13, 23, 28, 30],
  461. '028': [0, 1, 2, 6, 7, 11, 13, 14, 15, 16, 18, 20, 23, 26],
  462. '029': [0, 1, 4, 5, 9, 10, 12, 14, 15],
  463. '030': [0, 1, 2, 5, 7, 9, 10, 11, 12, 13, 16, 19, 20, 22, 23, 24, 25],
  464. '031': [0, 11, 12, 17, 20],
  465. '032': [0, 1, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 20, 27],
  466. '033': [0, 1, 5, 6, 7, 8, 9, 10, 12, 14, 16],
  467. '034': [0, 1, 4, 5, 6, 11, 13, 14, 18, 19, 20, 21, 22, 23, 28],
  468. '035': [0, 7],
  469. '036': [0, 1, 2, 3, 4, 8, 30, 31, 32],
  470. '037': [0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17],
  471. '038': [0, 1, 3, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
  472. '039': [0, 1, 3, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
  473. '040': [0, 1, 2, 7, 11, 12, 13, 15, 16, 17, 18, 22, 25, 26, 27],
  474. '041': [0, 7, 11, 12, 15, 16, 19, 22, 25, 26, 27],
  475. '042': [0, 4, 6, 11, 16, 20, 21, 22, 29],
  476. '043': [0, 1, 5, 7, 9],
  477. '044': [0, 1, 4, 12, 14, 19],
  478. '045': [0, 2, 3, 7, 9, 12, 14, 19],
  479. '046': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18,
  480. 19, 20, 22, 23, 25, 26, 30],
  481. '047': [0, 1, 4, 8, 13, 36, 39],
  482. '048': [0, 2, 3, 7, 8, 10, 12, 18, 19, 20, 21, 22, 23, 24, 26, 30, 31],
  483. '049': [0, 1, 2, 3, 10, 12],
  484. '050': [0, 1, 2, 3, 8, 12, 14, 15]},
  485. 'ses02': {'001': [0, 1, 2, 3, 5, 7, 11, 12, 13, 14, 15, 19, 20, 21, 22, 25, 26],
  486. '002': [0, 4, 6, 11, 12, 13, 20, 21, 24, 25, 28, 33, 35, 37, 38],
  487. '004': [1, 11, 13, 14, 21, 23],
  488. '006': [0, 5, 10, 13, 14, 17, 18, 19, 23, 24],
  489. '007': [0, 1, 3, 8, 9, 11, 25, 31, 36],
  490. '008': [0, 4, 13, 22],
  491. '009': [0, 10, 12, 14, 15, 16, 17, 18],
  492. '010': [0, 9, 10, 13, 14, 15, 16, 19, 20, 21, 22],
  493. '011': [3, 4, 5, 6, 9, 10, 12, 13, 14, 15, 16, 21, 23, 26],
  494. '012': [1, 6, 15, 19, 21, 23, 25, 31, 36],
  495. '013': [2, 3, 5, 9, 11, 12, 13, 15, 16, 18, 19, 20, 22, 23, 28, 29, 30],
  496. '014': [0, 1, 2, 11, 13, 14, 17, 19, 20, 21, 22, 24, 25],
  497. '015': [0, 6, 9, 13, 14, 15, 16, 17, 18],
  498. '016': [0, 2, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19],
  499. '017': [0, 5, 7, 8, 9, 12, 13, 14, 15, 16, 17, 19, 20, 21, 24, 26],
  500. '018': [2, 17, 26, 29, 30, 33, 35, 36, 37, 39, 40],
  501. '019': [8, 12, 15, 16, 18, 21, 22, 23, 25, 26],
  502. '020': [0, 7, 13, 14, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32],
  503. '021': [0, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16],
  504. '022': [0, 1, 2, 4, 5, 7, 9, 10, 13, 14, 15, 17, 18, 20, 21, 22, 23],
  505. '023': [0, 2, 3, 9, 10, 11, 12],
  506. '024': [0, 1, 3, 9, 10, 11, 12, 13],
  507. '025': [0, 10, 14, 16, 17, 18, 19],
  508. '026': [0, 3, 5, 6, 17],
  509. '027': [1, 4, 14, 16, 17, 18, 19, 20, 21, 22, 23]},
  510. }

preprocessing_info.py at commit 8ba204a, under BSD-3-Clause · at the source

Overview

Authors: Laura Carini1, Sara Sommariva1, Francesco Famà2,3, Laura Giorgetti2, Pietro Mattioli2,3, Beatrice Orso2, Raffaele Mancini2, Matteo Pardini2,4, Michele Piana1,5, Dario Arnaldi2,3
ORCID iDs: Laura Carini
  1. Department of Mathematics (DIMA), University of Genoa, Genoa, Italy
  2. Department of Neuroscience, Rehabilitation, Ophthalmology, Genetics, Maternal and Child Health (DINOGMI), University of Genoa, Genoa, Italy
  3. Clinical Neurophysiology Unit, IRCCS Azienda Ospedaliera Metropolitana, Genoa, Italy
  4. Clinical Neurology Unit, IRCCS Azienda Ospedaliera Metropolitana, Genoa, Italy
  5. Life Science Computational Laboratory (LISCOMP), IRCCS Azienda Ospedaliera Metropolitana, Genoa, Italy
Journal: NPJ Parkinson's disease, volume 12, issue 1, article 227
Dates: received 23 February 2025; accepted 15 May 2026; published online 8 June 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41531-026-01412-w · PMID 42259833 · PMCID PMC13586286 · OpenAlex W7163870285
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism), Alzheimer's / dementia (population), Parkinson's (population), sleep disorders (population)
Methods: Statistics, Smoothing, state filtering, decompositions, Preprocessing, Spectral & time-frequency, Connectivity, Graphs, Physiology & signal measures
Keywords: Dementia, Parkinson's disease, Network models, Predictive markers
Topic: Functional Brain Connectivity Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Ministero della Salute (DHEAL-COM - CUP: D33C22001980001, Bando ricerca finalizzata RF-2021-12374240); European Union - NextGenerationEU and the Ministry of University and Research (MUR) (project MNESYS - PE0000006, RAISE - Robotics and AI for Socioeconomic Empowerment - ECS00000035)
Citations: not cited yet (Europe PMC); 50 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repository

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

elisabettavallarino/transfreq

License: BSD-3-Clause
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 8ba204a13ee75c54fc587da793c0a9fd2706d7cc, 21 June 2022
Languages: Python (15)
Size: 35 files, 15 scripts
Software Heritage: archived
Found in: the text, “Individual and standard frequency bands”
Holds: README, license file, environment (requirements.txt, setup.cfg, setup.py, examples_paper/requirements.txt), documentation
Not found: CITATION.cff, tests, continuous integration
Tools: NumPy (8 files), Matplotlib (4 files), MNE-Python (4 files), pandas (2 files), autoreject (1 file), MNE-BIDS (1 file), scikit-learn (1 file), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
17 files

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:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 15 scripts, each with its path and the digest of its content;
  • 1 match 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

No dataset and no data link were found in the paper.

Data availability statement

The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

  • it says that the data are available on request

Read it in the paper: doi.org/10.1038/s41531-026-01412-w.

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, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 10 authors, 4 keywords, 2 funders, 46 references.

Cite

This paper

Carini, L., Sommariva, S., Famà, F., Giorgetti, L., Mattioli, P., Orso, B., Mancini, R., Pardini, M., Piana, M., & Arnaldi, D. (2026). Network based statistics associates increased connectivity to REM sleep disorder and hallucinations in early DLB. NPJ Parkinson's disease, 12(1), 227. https://doi.org/10.1038/s41531-026-01412-w

BibTeX

@article{carini2026network,
author = {Carini, Laura and Sommariva, Sara and Famà, Francesco and Giorgetti, Laura and Mattioli, Pietro and Orso, Beatrice and Mancini, Raffaele and Pardini, Matteo and Piana, Michele and Arnaldi, Dario},
title = {{Network based statistics associates increased connectivity to REM sleep disorder and hallucinations in early DLB}},
journal = {NPJ Parkinson's disease},
year = {2026},
month = jun,
volume = {12},
number = {1},
pages = {227},
publisher = {Nature Publishing Group},
issn = {2373-8057},
doi = {10.1038/s41531-026-01412-w},
url = {https://doi.org/10.1038/s41531-026-01412-w},
pmid = {42259833},
pmcid = {PMC13586286}
}

RIS

TY - JOUR
AU - Carini, Laura
AU - Sommariva, Sara
AU - Famà, Francesco
AU - Giorgetti, Laura
AU - Mattioli, Pietro
AU - Orso, Beatrice
AU - Mancini, Raffaele
AU - Pardini, Matteo
AU - Piana, Michele
AU - Arnaldi, Dario
TI - Network based statistics associates increased connectivity to REM sleep disorder and hallucinations in early DLB
T2 - NPJ Parkinson's disease
J2 - NPJ Parkinsons Dis
PY - 2026
DA - 2026/06/08
VL - 12
IS - 1
SP - 227
SN - 2373-8057
PB - Nature Publishing Group
DO - 10.1038/s41531-026-01412-w
UR - https://doi.org/10.1038/s41531-026-01412-w
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41531-026-01412-w",
"type": "article-journal",
"title": "Network based statistics associates increased connectivity to REM sleep disorder and hallucinations in early DLB",
"container-title": "NPJ Parkinson's disease",
"author": [
{
"family": "Carini",
"given": "Laura"
},
{
"family": "Sommariva",
"given": "Sara"
},
{
"family": "Famà",
"given": "Francesco"
},
{
"family": "Giorgetti",
"given": "Laura"
},
{
"family": "Mattioli",
"given": "Pietro"
},
{
"family": "Orso",
"given": "Beatrice"
},
{
"family": "Mancini",
"given": "Raffaele"
},
{
"family": "Pardini",
"given": "Matteo"
},
{
"family": "Piana",
"given": "Michele"
},
{
"family": "Arnaldi",
"given": "Dario"
}
],
"container-title-short": "NPJ Parkinsons Dis",
"volume": "12",
"issue": "1",
"page": "227",
"DOI": "10.1038/s41531-026-01412-w",
"PMID": "42259833",
"PMCID": "PMC13586286",
"ISSN": "2373-8057",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41531-026-01412-w",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
8
]
]
}
}

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.7554/elife.100605 [code]
Age-related changes in ‘cortical’ 1/f dynamics are linked to cardiac activity
Journal: n/a
In common: autoreject, MNE-BIDS, MNE-Python, 5 other tools, 1 reference
[2] doi:10.1093/nc/niag029 [code]
A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.
Journal: Neuroscience of consciousness
In common: autoreject, MNE-BIDS, MNE-Python, 5 other tools, 1 reference
[3] doi:10.1162/imag.a.1245 [code]
Towards precision EEG connectomics: Evaluating the benefits of dense sampling.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: autoreject, MNE-Python, pandas, 3 other tools, 3 references
[4] doi:10.1038/s41467-026-74824-0 [code]
Learning regularities in noise engages both neural predictive activity and representational changes.
Journal: Nature communications
In common: autoreject, MNE-BIDS, MNE-Python, 5 other tools
[5] doi:10.1038/s41597-026-07350-9 [code]
An open multi-center MEG-EEG dataset for studying conscious visual perception.
Journal: Scientific data
In common: autoreject, MNE-BIDS, MNE-Python, 5 other tools
[6] doi:10.1038/s41597-026-07377-y [code]
An open-access multi-site fMRI dataset for investigating conscious visual perception.
Journal: Scientific data
In common: autoreject, MNE-BIDS, MNE-Python, 5 other tools
[7] doi:10.1371/journal.pone.0351872 [code]
Decoding visual object recognition from EEG signals.
Journal: PloS one
In common: MNE-Python, scikit-learn, pandas, 3 other tools, 4 references
[8] doi:10.1093/cercor/bhag113 [code]
Long-term reliability and stability of parameterized resting state EEG: evidence from a five-year follow-up.
Journal: Cerebral cortex (New York, N.Y. : 1991)
In common: MNE-BIDS, MNE-Python, scikit-learn, 4 other tools, 2 references
[9] doi:10.1038/s41746-026-02946-2 [code]
Fully-automated sleep staging for Parkinson's disease and isolated REM sleep behavior disorder.
Journal: NPJ digital medicine
In common: MNE-BIDS, MNE-Python, scikit-learn, 4 other tools, sleep disorders, Parkinson's
[10] doi:10.1093/braincomms/fcag236 [code]
Dynamic, state-dependent characteristics of cognitive fluctuations in Lewy body dementia: a magnetoencephalography study.
Journal: Brain communications
In common: MNE-Python, pandas, NumPy, Alzheimer's / dementia, 4 references

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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

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