Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,37 @@
"source": [
"# BACPAC Synthetic Data Analysis\n",
"\n",
"#### Prepared by Qiong Liu - Bioinformatician - CTDS\n",
"\n",
"In this notebook, we utilize data from the BACPAC synthetic data study to demonstrate how data accessed through the HEAL Data Platform can be analyzed in a HEAL workspace.\n",
"Prepared by:\n",
": Qiong Liu, Center for Translational Data Science (CTDS), University of Chicago"
]
},
{
"cell_type": "markdown",
"id": "afe543d1",
"metadata": {},
"source": [
":::{note} Attribution\n",
":class: dropdown\n",
"This notebook uses synthetic data created for the [BACPAC study](doi:10.60490/HDP00258) as part of the study entitled *Back Pain Consortium (BACPAC) Research Program Data Integration, Algorithm Development and Operations Management Center*. These synthetic data are for demonstration purposes only.\n",
"\n",
"The work here was conducted without direct involvement by the creator of the synthetic data, and does not represent study conclusions or recommendations on behalf of the NIH HEAL Initiative, The Center For Translational Data Science, or The University of Chicago.\n",
"The purpose of this notebook is to demonstrate how data accessed through the HEAL Data Platform can be analyzed in a HEAL workspace.\n",
"\n",
"## Table of Content\n",
"The work here was conducted without direct involvement of the by the creator of the synthetic data, and therefore does not necessarily reflect the views or opinions of the creator, of the NIH HEAL Initiative®, or of the Center for Translational Data Science (CTDS) at the University of Chicago.\n",
":::"
]
},
{
"cell_type": "markdown",
"id": "174ceacf",
"metadata": {},
"source": [
"## Table of Contents\n",
"- [Set up notebook](#h1)\n",
"- [Pull file objects using the Gen3 SDK](#Pull-file-objects-using-the-Gen3-SDK)\n",
"- [Demographic characteristics of participants in BACPAC](#Demographic-characteristics-of-participants-in-BACPAC)\n",
"- [Opiod pain medication profiling at two time points](#Opiod-pain-medication-profiling-at-two-time-points)\n",
"- [Opioid pain medication profiling at two time points](#Opiod-pain-medication-profiling-at-two-time-points)\n",
"- [Physical function outcomes](#Physical-function-outcomes)\n",
"\n",
"\n",
"\n",
"## Set up notebook"
]
},
Expand All @@ -32,7 +48,6 @@
"metadata": {},
"outputs": [],
"source": [
"# Uncomment the line to install python libraries by removing #\n",
"!pip install kaleido==0.2.1 -q\n",
"\n",
"import shutil\n",
Expand All @@ -50,16 +65,7 @@
"import os\n",
"\n",
"plotly.offline.init_notebook_mode()\n",
"from IPython.display import Markdown, Image, display\n",
"\n",
"folder_path = 'img/BACPAC_Synthetic_Data_Analysis'\n",
"if os.path.exists(folder_path) and os.path.isdir(folder_path):\n",
" shutil.rmtree(folder_path)\n",
" os.makedirs(folder_path)\n",
" print(f\"A new folder - '{folder_path}' - has been created.\")\n",
"else:\n",
" os.makedirs(folder_path)\n",
" print(f\"A new folder - '{folder_path}' - has been created.\")\n"
"from IPython.display import Markdown, Image, display"
]
},
{
Expand All @@ -68,7 +74,7 @@
"metadata": {},
"source": [
"## Query study metadata\n",
"Users can query study metadata in HEAL data commons using our metadata service (MDS). The cell below shows how to retrieve the metadata of the BACPAC study by interacting with the gen3 MDS endpoint. "
"Users can query study metadata in the HEAL Data Platform using our metadata service (MDS). The cell below shows how to retrieve the metadata of the BACPAC study by interacting with the Gen3 MDS endpoint. "
]
},
{
Expand Down Expand Up @@ -163,13 +169,11 @@
"new_df2.reset_index(inplace=True)\n",
"new_df2 = new_df2.rename({0:\"Count\", \"sex\": \"Sex\", \"ethnicity\": \"Ethnicity\"}, axis=\"columns\")\n",
"\n",
"fig = go.Figure()\n",
"fig = px.bar(new_df2, x=\"Sex\", y=\"Count\", color=\"Ethnicity\",\n",
"fig1 = go.Figure()\n",
"fig1 = px.bar(new_df2, x=\"Sex\", y=\"Count\", color=\"Ethnicity\",\n",
" title= \"Ethnicity and Sex Characteristics of Participants in the BACPAC Study\", \n",
" width= 800, height = 500)\n",
"fig.write_image('img/BACPAC_Synthetic_Data_Analysis/figure1.png')\n",
"\n",
"Image(filename=\"img/BACPAC_Synthetic_Data_Analysis/figure1.png\")"
"fig1.show()"
]
},
{
Expand Down Expand Up @@ -228,10 +232,8 @@
"fig2.update_layout(title_text=\"Self-Report of Opioid Pain Medication Use at Baseline and Twelve Weeks\",title_font_size=20)\n",
"for data in fig2.data:\n",
" data[\"width\"]=0.6\n",
" \n",
"fig2.write_image('img/BACPAC_Synthetic_Data_Analysis/figure2.png')\n",
"\n",
"Image(filename=\"img/BACPAC_Synthetic_Data_Analysis/figure2.png\")"
"fig2.show()"
]
},
{
Expand Down Expand Up @@ -263,18 +265,15 @@
" category_orders={\"Sex\": [\"Intersex\", \"Unknown\", \"Male\", \"Female\"]})\n",
"fig3.update_layout(title_text=\"Opioid Pain Medication at Two Time Points in Different Sex Groups\", title_font_size=20)\n",
"\n",
"fig3.write_image('img/BACPAC_Synthetic_Data_Analysis/figure3.png')\n",
"\n",
"Image(filename=\"img/BACPAC_Synthetic_Data_Analysis/figure3.png\")\n",
"\n"
"fig3.show()"
]
},
{
"cell_type": "markdown",
"id": "3a47c533",
"metadata": {},
"source": [
"We observed an increase of particpants taking opioid medication at week 12 in both male and femal groups compared to baseline week 0.\n",
"We observed an increase of particpants taking opioid medication at week 12 in both male and female groups compared to baseline week 0.\n",
"\n",
"## Physical function outcomes\n",
" The cell below uses the Physical Function 6b T-Score to display physical function outcomes in different ethnicity groups at week 0 and week 12."
Expand Down Expand Up @@ -355,9 +354,7 @@
"fig4.update_xaxes(title_text=\"PROMIS-Physical Function 6b T-Score\",\n",
" title_font_size=15, range=[29, 49], row=2, col=2)\n",
"\n",
"fig4.write_image('img/BACPAC_Synthetic_Data_Analysis/figure4.png')\n",
"\n",
"Image(filename=\"img/BACPAC_Synthetic_Data_Analysis/figure4.png\")"
"fig4.show()"
]
},
{
Expand Down Expand Up @@ -393,7 +390,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.13.13"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@
"source": [
"# High-Resolution, Spinal Cord Stimulation for Non-Opioid Treatment of Neuropathic Pain\n",
"\n",
"#### Prepared by J M Maxwell - Data Science, Sr. Analyst - CTDS\n",
"\n",
"In this notebook, we utilize data from the study “High-Resolution, Spinal Cord Stimulation for Non-Opioid Treatment of Neuropathic Pain” to recreate a number of the images and figures as seen in the paper by Quintero et al. titled *Correlating Evoked Electromyography and Anatomic Factors During Spinal Cord Stimulation Implantation With Short-Term Outcomes* [(PMID: 39320285)](https://pubmed.ncbi.nlm.nih.gov/39320285/). The data for this study are archived in Mendeley Data.\n",
"Prepared by:\n",
": J M Maxwell, Center for Translational Data Science (CTDS), University of Chicago"
]
},
{
"cell_type": "markdown",
"id": "fb2242a4-31ab-4453-b120-94ab0ef63fc1",
"metadata": {},
"source": [
":::{note} Attribution\n",
":class: dropdown\n",
"This notebook uses data collected by [](doi:10.1016/j.neurom.2024.08.004) as part of their study entitled *High-Resolution, Spinal Cord Stimulation for Non-Opioid Treatment of Neuropathic Pain*. The data have been archived by the authors at [Mendeley Data](https://data.mendeley.com/datasets/rmj2kngzbp) and are accessible via the [HEAL Data Platform](https://healdata.org/portal/discovery/HDP00384/).\n",
"\n",
"The purpose of this notebook is to demonstrate how data accessed through the HEAL Data Platform can be analyzed in a HEAL workspace. Due to possible minor differences in selection/filtering of observations and handling of missing data, the tables and figures in this notebook may slightly vary from the results published in the paper.\n",
"The purpose of this notebook is to demonstrate how the data may be accessed and used for analysis, and is intended to be used as a jumping off point for researchers who may wish to use these data for their own secondary analyses. While some of the analyses below may recreate analyses presented in the original publication, they are not intended to replicate the original results, and differences in analytic methods and software, selection/filtering of observations, and handling of missing data may yield results that differ from the original.\n",
"\n",
"The work here was conducted without direct involvement by Quintero et al., and does not represent study conclusions or recommendations on behalf of the NIH HEAL Initiative, The Center For Translational Data Science, or The University of Chicago.\n"
"The work here was conducted without direct involvement of the original authors and therefore does not necessarily reflect the views or opinions of the authors, of the NIH HEAL Initiative®, or of the Center for Translational Data Science (CTDS) at the University of Chicago.\n",
":::\n"
]
},
{
Expand All @@ -23,9 +33,9 @@
"source": [
"## Access Data\n",
"\n",
"To access the data from this study make sure you are logged in to the InCommon login option and then: \n",
"1) Go to the HEAL Discovery page to select the study\n",
"2) Select the 'Open In Workspace' option and choose the (Tutorials) Example Analysis Jupyter Lab Notebooks workspace option\n",
"To access the data from this study, make sure you are logged in with the InCommon login option, and then: \n",
"1) Go to the HEAL Discovery page and search for \"HDP00384\". Select the study by clicking the checkbox on the left. \n",
"2) Click the 'Open In Workspace' button above the study record table. Choose the (Tutorials) Example Analysis Jupyter Lab Notebooks workspace option.\n",
"3) Use the exported study manifest to download the study. \n",
"\n",
"Otherwise you may run the following gen3-sdk command to download the relevant files from the study."
Expand All @@ -49,7 +59,7 @@
"source": [
"## About the Study\n",
"\n",
"The study, *High-Resolution, Spinal Cord Stimulation for Non-Opioid Treatment of Neuropathic Pain*, investigated the outcomes of elliciting EMGs (electromyography) in subject's regions of pain during surgery. Data for evaluating the treatment effect were collected from 21 patients in two phases. Subject outcomes were measured using: the Numerical Rating Scale, McGill Pain Questionnaire, Beck Depression Inventory, Oswestry Disability Index, and Pain Catastrophizing Score, and were recorded preoperatively and at three months following the procedure. "
"The study, *High-Resolution, Spinal Cord Stimulation for Non-Opioid Treatment of Neuropathic Pain*, investigated the outcomes of eliciting EMGs (electromyography) in subject's regions of pain during surgery. Data for evaluating the treatment effect were collected from 21 patients in two phases. Subject outcomes were measured using: the Numerical Rating Scale; McGill Pain Questionnaire; Beck Depression Inventory; Oswestry Disability Index; and Pain Catastrophizing Score, and were recorded preoperatively and at three months following the procedure. "
]
},
{
Expand All @@ -67,9 +77,6 @@
"execution_count": null,
"id": "0f4d1d41-1371-4d58-8e25-e2c83e9610d9",
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -104,7 +111,7 @@
"source": [
"### Read In Data and Clean Data\n",
"\n",
"After reading in the data, we perform standard data cleaning steps to improve the usability of the data, remove extraneous data features, and engineer new features measuring the percent change in treatment effects from before and after the each sample subject's operation."
"After reading in the data, we perform standard data cleaning steps to improve the usability of the data, remove extraneous data features, and engineer new features measuring the percent change in treatment effects from before and after each sample subject's operation."
]
},
{
Expand Down Expand Up @@ -147,9 +154,6 @@
"execution_count": null,
"id": "fa558ab5-7de0-4798-9829-933dc0265b01",
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": []
},
"outputs": [],
Expand All @@ -176,9 +180,6 @@
"execution_count": null,
"id": "0a2b0935-272d-4d51-86a9-6191f3c00e8d",
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -213,9 +214,6 @@
"execution_count": null,
"id": "5ae261f5-5228-4259-9c1b-53c43b3f25a6",
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -243,10 +241,8 @@
"axes[3].set_position([0.24,0.125,0.228,0.343])\n",
"axes[4].set_position([0.55,0.125,0.228,0.343])\n",
"axes[5].set_visible(False)\n",
"plt.close(fig)\n",
"\n",
"fig.savefig('img/Non-Opioid_Treatment_Analysis/figure1.png')\n",
"Image(filename=\"img/Non-Opioid_Treatment_Analysis/figure1.png\")"
"plt.show()"
]
},
{
Expand Down Expand Up @@ -281,9 +277,6 @@
"execution_count": null,
"id": "ad4e37b9-12df-4e4b-b085-c290ad7c51cd",
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -326,9 +319,6 @@
"execution_count": null,
"id": "f0d3d7a3-c896-4cde-8bed-9e3af5d428d1",
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -368,7 +358,7 @@
"id": "1f6e3f5e-5bd6-43c2-86a4-1816854802cf",
"metadata": {},
"source": [
"[We found large, average percent descreases between pre and post operation data across all five measured treatment effects for subject's reported pain, depression, and pain induced disability.](#H1) Using both parametric and non-parametric statistical testing we found there was a statistically significant difference to the subject's pain and disability as reported with the Numerical Rating Scale for pain and the Oswestry Disability Index for lower-back pain induced disability."
"[We found large, average percent decreases between pre and post operation data across all five measured treatment effects for subject's reported pain, depression, and pain induced disability.](#H1) Using both parametric and non-parametric statistical testing, we found there was a statistically significant difference to the subject's pain and disability as reported with the Numerical Rating Scale for pain and the Oswestry Disability Index for lower-back pain induced disability."
]
},
{
Expand Down Expand Up @@ -413,7 +403,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.13.13"
},
"toc-autonumbering": false,
"toc-showcode": true,
Expand Down
Loading
Loading