OSCR

Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 237 lines · 8.7 KB · no license

  1. import util.psh_util as psh_util
  2. import es_based_detector as eb
  3. import pandas as pd
  4. import numpy as np
  5. import sys
  6. def es_based_process(labelled_case, ground_truth_annotations, patients_list_file, fileserver_path):
  7. # get raw vital HR (spo2r) from mat file
  8. #url1 = '/trend/1_trend.mat'
  9. url1 = labelled_case
  10. spo2r1 = psh_util.create_vital_from_url(url1, 'SPO2r')
  11. # get annotations (ground truth), label only from Auton viewer
  12. #ground_truth = pd.read_csv('/data/all_annotations_GT.csv')
  13. ground_truth = pd.read_csv(ground_truth_annotations)
  14. p1_annotations = ground_truth[ground_truth.project_id == 9]
  15. # all annotations, magic number = 1675827557.07 for converting timestamp from viewer to proper epoch
  16. spo2r_int = psh_util.create_annotation_intervals(p1_annotations, 1675827557.07)
  17. # get annotations on raw trend data
  18. gt_all, gt_index_all = psh_util.create_time_interval_for_GT(spo2r1, spo2r_int)
  19. ogt_all, ogt_index_all = psh_util.create_time_interval_outside_GT(spo2r1, spo2r_int)
  20. # extract features for model training
  21. outside_features = psh_util.extract_feature_from_outside_interval(spo2r1, 'SPO2r', spo2r_int)
  22. inside_features = psh_util.extract_feature_from_interval(spo2r1, 'SPO2r', spo2r_int)
  23. # stat features
  24. feature_list = ['mean', 'std', 'var', 'min', 'max', 'median']
  25. # getting patient ids
  26. patient_list = pd.read_csv(patients_list_file)
  27. patient_ids = patient_list['pid'].unique()
  28. all_patient_meta = []
  29. for i in patient_ids:
  30. cur_pair = [int(i), patient_list[patient_list['pid'] == i].iloc[-1]['case_control']]
  31. all_patient_meta.append(cur_pair)
  32. all_patient_meta_pd = pd.DataFrame(all_patient_meta, columns=['record_id', 'PSH_status'])
  33. # label window size: 10 min (300 datapoints)
  34. window_length = 300
  35. #############################
  36. ## Combine analysis result ##
  37. #############################
  38. all_pd = []
  39. for i in range(len(all_patient_meta_pd)):
  40. pid = int(all_patient_meta_pd.iloc[i].record_id)
  41. if np.isnan(all_patient_meta_pd.iloc[i].PSH_status):
  42. psh_status = 0
  43. else:
  44. psh_status = int(all_patient_meta_pd.iloc[i].PSH_status)
  45. #psh_status = int(all_patient_meta_pd.iloc[i].PSH_status)
  46. print('current id: '+str(pid))
  47. print('PSH status: '+str(psh_status))
  48. '''
  49. Part I. create intervals
  50. '''
  51. # create the driver vital: SPO2r
  52. url = fileserver_path+str(pid)+'_trend.mat'
  53. cur_hr = psh_util.create_vital_from_url(url, 'SPO2r')
  54. # modify min rule
  55. min_rule = min_rule + 10
  56. # create labelled interval on min, std, and median
  57. min_interval, min_label = eb.rolling_labels(cur_hr, 'SPO2r', window_length, min_rule, 'min')
  58. std_interval, std_label = eb.rolling_labels(cur_hr, 'SPO2r', window_length, std_rule, 'std')
  59. median_interval, median_label = eb.rolling_labels(cur_hr, 'SPO2r', window_length, median_rule, 'median')
  60. # combine all intervals
  61. print('min len: '+str(len(min_interval))+', std len: '+str(len(std_interval))+', md len: '+str(len(median_interval)))
  62. combined = []
  63. combined.extend(min_interval)
  64. combined.extend(std_interval)
  65. combined.extend(median_interval)
  66. # merge overlapping intervals
  67. merged = eb.merge(combined)
  68. print('merged len: '+str(len(merged)))
  69. # filter with short intervals, use threshold 230
  70. filtered = []
  71. for s, e in merged:
  72. if e-s > 230:
  73. filtered.append([s,e])
  74. print('filtered len: '+str(len(filtered)))
  75. # convert to a time intervals
  76. time_intervals = eb.convert_index_time(cur_hr, filtered)
  77. # create trajectory
  78. '''
  79. Part II: get confidence scores
  80. '''
  81. # get other vitals
  82. # blood presure
  83. cur_nbps = psh_util.create_vital_from_url(url, 'NBPS')
  84. # RR
  85. cur_resp = psh_util.create_vital_from_url(url, 'RESP')
  86. # tmp1
  87. cur_tmp1 = psh_util.create_vital_from_url(url, 'TMP1')
  88. # tmp2
  89. cur_tmp2 = psh_util.create_vital_from_url(url, 'TMP2')
  90. # get confidence lists from NBPS and RESP
  91. # use 4 hours before/after each episode
  92. nbps_diff = eb.calculate_confidence_bp(cur_nbps, 'NBPS', time_intervals, 4)
  93. resp_diff = eb.calculate_confidence_bp(cur_resp, 'RESP', time_intervals, 4)
  94. # based on the list, calculate the actual score
  95. nbps_scores = eb.get_score_from_list(nbps_diff)
  96. resp_scores = eb.get_score_from_list(resp_diff)
  97. # get confidence lists from tmp1 and tmp2
  98. # use 38 degree as the threshold
  99. t1_percent = eb.calculate_confidence_tmp(cur_tmp1, 'TMP1', time_intervals, 38)
  100. t2_percent = eb.calculate_confidence_tmp(cur_tmp2, 'TMP2', time_intervals, 38)
  101. '''
  102. Part III: combine everything together into csv
  103. '''
  104. length = len(time_intervals)
  105. # all current ids
  106. id_lst = length*[pid]
  107. # psh status list
  108. psh_lst = length*[psh_status]
  109. start_time_lst = []
  110. end_time_lst = []
  111. start_index_lst = []
  112. end_index_lst = []
  113. duration = []
  114. nbps_diff_lst = []
  115. nbps_score_lst = []
  116. resp_diff_lst = []
  117. resp_score_lst = []
  118. tmp1_percent_lst = []
  119. tmp1_score_lst = []
  120. tmp2_percent_lst = []
  121. tmp2_score_lst = []
  122. for s_index, e_index in filtered:
  123. start_index_lst.append(s_index)
  124. end_index_lst.append(e_index)
  125. for idx, time_pair in enumerate(time_intervals):
  126. start_time_lst.append(time_pair[0])
  127. end_time_lst.append(time_pair[1])
  128. duration.append(time_pair[1]-time_pair[0])
  129. # adding nbps differences and score
  130. if idx in nbps_diff:
  131. nbps_diff_lst.append(nbps_diff[idx])
  132. nbps_score_lst.append(nbps_scores[idx])
  133. else:
  134. nbps_diff_lst.append(np.nan)
  135. nbps_score_lst.append(np.nan)
  136. # adding resp differences and score
  137. if idx in resp_diff:
  138. resp_diff_lst.append(resp_diff[idx])
  139. resp_score_lst.append(resp_scores[idx])
  140. else:
  141. resp_diff_lst.append(np.nan)
  142. resp_score_lst.append(np.nan)
  143. # adding tmp1 precentage and score
  144. if idx in t1_percent:
  145. tmp1_percent_lst.append(t1_percent[idx])
  146. if t1_percent[idx] > 0.5:
  147. tmp1_score_lst.append(1)
  148. else:
  149. tmp1_score_lst.append(0)
  150. else:
  151. tmp1_percent_lst.append(np.nan)
  152. tmp1_score_lst.append(np.nan)
  153. # adding tmp2 precentage and score
  154. if idx in t2_percent:
  155. tmp2_percent_lst.append(t2_percent[idx])
  156. if t2_percent[idx] > 0.5:
  157. tmp2_score_lst.append(1)
  158. else:
  159. tmp2_score_lst.append(0)
  160. else:
  161. tmp2_percent_lst.append(np.nan)
  162. tmp2_score_lst.append(np.nan)
  163. cur_interval_pd = pd.DataFrame({'id': id_lst, 'PSH': psh_lst, 'start_time': start_time_lst, 'end_time': end_time_lst,
  164. 'start_index': start_index_lst, 'end_index': end_index_lst,
  165. 'duration(sec)': duration,
  166. 'NBSP_values': nbps_diff_lst, 'NBSP_scores': nbps_score_lst,
  167. 'RESP_values': resp_diff_lst, 'RESP_scores': resp_score_lst,
  168. 'TMP1_percent': tmp1_percent_lst, 'TMP1_score': tmp1_score_lst,
  169. 'TMP2_percent': tmp2_percent_lst, 'TMP2_score': tmp2_score_lst})
  170. file_name = str(pid)+'_intervals.csv'
  171. #cur_interval_pd.to_csv(file_name, index=False)
  172. all_pd.append(cur_interval_pd)
  173. print('-----------------------')
  174. final_pd_4 = pd.concat(all_pd)
  175. final_pd_4.to_csv('updated_rule_all_patients_score_4hour_window.csv', index=False)
  176. print('complete!')
  177. def main():
  178. print('Labelled Cases File Path: ', sys.argv[1])
  179. print('Ground Truth File Path: ', sys.argv[2])
  180. print('All Patients List: ', sys.argv[3])
  181. print('All Other Cases Path: ', sys.argv[4])
  182. es_based_process(labelled_case=sys.argv[1], ground_truth_annotations=sys.argv[2], patients_list_file=sys.argv[3], fileserver_path=sys.argv[4])
  183. if __name__ == "__main__":
  184. main()

es_based_analysis.py at commit 26a46d7, no license · at the source

Overview

Authors: Xiangxiang Kong1, Lujie Karen Chen1, Sancharee Hom Chowdhurry1, Ryan B Felix2, Shiming Yang2, Peter Hu2, Neeraj Badjatia2, Jamie Erin Podell2
  1. University of Maryland, Baltimore, United States of America
  2. University of Maryland, School of Medicine, United States of America
Institutions: University of Maryland, Baltimore (United States)
Journal: PloS one, volume 21, issue 3, article e0344088
Dates: received 8 August 2025; accepted 15 February 2026; published online 3 March 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pone.0344088 · PMID 41774715 · PMCID PMC12956124 · OpenAlex W7133355326
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism), traumatic brain injury (population), clinical / translational (subfield)
Methods: Statistics, Machine learning, Physiology & signal measures, Connectivity
MeSH: Autonomic Nervous System Diseases*, Brain Injuries, Traumatic*, Adult, Female, Humans, Machine Learning, Male, Middle Aged, Vital Signs (* major topic)
Topic: Traumatic Brain Injury and Neurovascular Disturbances (Neurology, Medicine), according to OpenAlex
Funding: Institute for Clinical and Translational Research, University of Maryland, Baltimore (1UL1TR003098)
Citations: cited by 1 paper (Europe PMC); 20 references in the paper

Abstract

Paroxysmal sympathetic hyperactivity (PSH) is a syndrome that occurs in a large subset of critically ill traumatic brain injury (TBI) patients and is associated with complications and poor recovery. PSH is defined by recurrent episodic vital sign elevations in the appropriate clinical context. However, standard diagnostic criteria rely heavily on subjective judgment, leading to challenges and delays in recognition, monitoring, and management. The objective of this study was to develop automated PSH detection and quantification tools that exclusively utilize objective bedside continuous vital sign data. Using a cohort of 221 critically ill acute TBI patients with at least 14 days of continuous physiologic data (of which 107 were clinically diagnosed with PSH) we developed a high-resolution clinical feature scale based on established PSH-Assessment Measure criteria and two artificial intelligence-based episode detection models including an expert system approach and a machine learning model approach, using a clinician-annotated case example as ground truth. For the episode detection methods, PSH was quantified as the number, duration, and overall temporal burden of detected episodes. To evaluate performance, we compared quantifications across PSH cases and controls and explored precision and recall. All three methods demonstrated initial face validity to delineate PSH cases from non-PSH TBI controls. Future optimization and implementation of the described computational frameworks with real-time patient data could improve the standard monitoring and management of this challenging clinical syndrome.

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

Repository

Its files are read in the Code ↔ Paper reader above.

seankong88/PSH_episode_analysis

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 26a46d7b38b184a2b9af431566742aaefc195921, 26 December 2025
Languages: Python (6)
Size: 13 files, 6 scripts
Software Heritage: not archived
Found in: the text, “Author generated code”
Holds: README, environment (requirements.txt)
Not found: license file, CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (5 files), pandas (5 files), SciPy (3 files), Matplotlib (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
7 files

The paper's code and data availability statement is in the Data section.

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;
  • 6 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • 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

We provide de-identified data as supporting files, and we also provide author-generated code at the following url: https://github.com/seankong88/PSH_episode_analysis.

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, 8 authors, 9 MeSH terms, 1 funder, 18 references.

Cite

This paper

Kong, X., Chen, L. K., Chowdhurry, S. H., Felix, R. B., Yang, S., Hu, P., Badjatia, N., & Podell, J. E. (2026). Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients. PloS one, 21(3), e0344088. https://doi.org/10.1371/journal.pone.0344088

BibTeX

@article{kong2026computational,
author = {Kong, Xiangxiang and Chen, Lujie Karen and Chowdhurry, Sancharee Hom and Felix, Ryan B and Yang, Shiming and Hu, Peter and Badjatia, Neeraj and Podell, Jamie Erin},
title = {{Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients}},
journal = {PloS one},
year = {2026},
month = mar,
volume = {21},
number = {3},
pages = {e0344088},
publisher = {PLOS},
issn = {1932-6203},
doi = {10.1371/journal.pone.0344088},
url = {https://doi.org/10.1371/journal.pone.0344088},
pmid = {41774715},
pmcid = {PMC12956124}
}

RIS

TY - JOUR
AU - Kong, Xiangxiang
AU - Chen, Lujie Karen
AU - Chowdhurry, Sancharee Hom
AU - Felix, Ryan B
AU - Yang, Shiming
AU - Hu, Peter
AU - Badjatia, Neeraj
AU - Podell, Jamie Erin
TI - Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients
T2 - PloS one
J2 - PLoS One
PY - 2026
DA - 2026/03/03
VL - 21
IS - 3
SP - e0344088
SN - 1932-6203
PB - PLOS
DO - 10.1371/journal.pone.0344088
UR - https://doi.org/10.1371/journal.pone.0344088
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pone.0344088",
"type": "article-journal",
"title": "Computational frameworks for automated detection and quantification of paroxysmal sympathetic hyperactivity among traumatic brain injury patients",
"container-title": "PloS one",
"author": [
{
"family": "Kong",
"given": "Xiangxiang"
},
{
"family": "Chen",
"given": "Lujie Karen"
},
{
"family": "Chowdhurry",
"given": "Sancharee Hom"
},
{
"family": "Felix",
"given": "Ryan B"
},
{
"family": "Yang",
"given": "Shiming"
},
{
"family": "Hu",
"given": "Peter"
},
{
"family": "Badjatia",
"given": "Neeraj"
},
{
"family": "Podell",
"given": "Jamie Erin"
}
],
"container-title-short": "PLoS One",
"volume": "21",
"issue": "3",
"page": "e0344088",
"DOI": "10.1371/journal.pone.0344088",
"PMID": "41774715",
"PMCID": "PMC12956124",
"ISSN": "1932-6203",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pone.0344088",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
3
]
]
}
}

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.1371/journal.pone.0345651 [code]
Non-concussive head impacts sustained during American football correlate with changes in gut microbiome diversity and composition.
Journal: PloS one
In common: seaborn, scikit-learn, pandas, 3 other tools, traumatic brain injury, clinical / translational
[2] doi:10.1186/s12974-026-03890-4 [code]
Neuronal toll-like receptor-4 regulation of matrix metalloproteinase-9 activity mediates dentate circuit dysfunction after traumatic brain injury.
Journal: Journal of neuroinflammation
In common: seaborn, scikit-learn, pandas, 3 other tools, traumatic brain injury
[3] doi:10.1002/hbm.70534 [code]
Longitudinal Multimodal Neuroimaging After Traumatic Brain Injury.
Journal: Human brain mapping
In common: seaborn, pandas, SciPy, 2 other tools, traumatic brain injury, clinical / translational
[4] doi:10.1038/s41598-026-47942-4 [code]
CT-based radiomic markers to predict late-onset seizures after traumatic brain injury.
Journal: Scientific reports
In common: scikit-learn, pandas, SciPy, 2 other tools, traumatic brain injury, clinical / translational
[5] doi:10.1093/braincomms/fcag123 [code]
Traumatic brain injury recovery prediction by harmonizing real brain CT and synthetic brain MRI: a pilot study.
Journal: Brain communications
In common: scikit-learn, pandas, SciPy, 2 other tools, traumatic brain injury
[6] doi:10.1093/braincomms/fcag145 [code]
GABA<sub>A</sub> binding correlates with high-frequency EEG: a possible proxy for depolarization in traumatic brain injury.
Journal: Brain communications
In common: pandas, SciPy, Matplotlib, 1 other tool, traumatic brain injury
[7] doi:10.1007/s00429-026-03166-w [code]
Autoencoders for unsupervised analysis of rat myeloarchitecture.
Journal: Brain structure & function
In common: scikit-learn, SciPy, Matplotlib, 1 other tool, traumatic brain injury
[8] doi:10.1016/j.ynirp.2026.100377 [code]
Accelerated brain aging in Veterans with posttraumatic stress symptoms and mild traumatic brain injury.
Journal: Neuroimage. Reports
In common: scikit-learn, pandas, NumPy, traumatic brain injury, clinical / translational
[9] doi:10.1136/tsaco-2025-001974 [code]
Association of alcohol use with helmet use in cyclists: analysis of the National Trauma Data Bank.
Journal: Trauma surgery & acute care open
In common: scikit-learn, pandas, NumPy, traumatic brain injury, clinical / translational
[10] doi:10.1002/adhm.202503457 [code]
A 3D Human Neuron-on-Chip Platform to Monitor Neuronal Injury Responses.
Journal: Advanced healthcare materials
In common: traumatic brain injury, 1 reference

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.