The goal of this project is to provide implementation of our Plos Digital Health paper
- Our source code for data extraction builds on AI Clinician where the dataset were extracted from MIMIC III database Identifying and Analyzing Sepsis States: A Retrospective Study on Patients with Sepsis in ICUs, Plos Digital Health, 2022. To access to the dataset, researchers need to follow the instructions from the website and then follow the instructions from here to install the MiMIC III.
- Once the MIMIC III databased is installed, run elixhauser_quan.sql to build public table Elixhauser_Quan Table to derive the comorbidity concept.
- We use the matlab implementation of PCHA software to compute archetypes. The source code can be donwloaded from here.
- Run AI_Clinician_Data_Extraction.ipynb for Data Extraction from MIMIC-III database.
- Run AI_Clinician_Sepsis3_Definition.m for identifying Sepsis patients.
- Run AI_Clinician_mimic3_Dataset_premobid.m for obtaining the dataset used in our Plos Digital Health paper.
- run ./features/prepare_data.py to preprocess the data format used for computing archetypes
- run run_AA.m to compute the archetypes for each k (the number of archetypes).
- Note: the derived archetype label in our analysis is saved in "dist_max_labels.mat".
- run Premorbid_heatmap_z_score.m for z-score table
- run Premorbid_heatmap_z_score_p_value.m for p-value table
- Generate Patient Trajectories data using "combine_archetype_label_gradient_sepsis.m"
- Compute First Order Treatment Transitions using calculate_markov_chain.py.
- Generate First Order Treatment Transition Graph using markov_chain_plot_first_order_treatment_combine.m
- Generate Patient Trajectories data using "combine_archetype_label_gradient_sepsis.m"
- Compute Second Order Transitions using calculate_markov_chain_second_order.py
- Generate First Order Treatment Transition Graph using markov_chain_plot_second_order_combine.m
- Generate Patient Trajectories data using "combine_archetype_label_gradient_sepsis.m"
- Compute Second Order Transitions using calculate_markov_chain_third_orde.py
- Generate First Order Treatment Transition Graph using markov_chain_plot_third_order.m
- run get_gradient_data.m to derive transition data.
- run run_AA_gradient.m to compute the gradient archetypes for each k (the number of archetypes).
- Note: the derived gradient archetype label in our analysis is saved in "gradient_dist_max_labels.mat".
- Run transition_gradient_histo.m to compute gradient histogram for each gradient archetype.
- Run gradient_heatmap_z_score.m to compute z-score for each gradient archetype.
- Run gradient_heatmap_z_score_p_value.m to compute its corresponding p-value for each gradient archetype.