starting Safety Signal (All drugs)
This commit is contained in:
@@ -439,6 +439,145 @@
|
||||
" lastUpdatedElementId = 'last_updated')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "6c302a04",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Symptoms caused by Drugs (EudraVigilance)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "fb02ce7c",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from SymptomsCausedByVaccines.DataFrameFilter import DataFrameFilter\n",
|
||||
"from SymptomsCausedByVaccines.HtmlUpdater import updateHtmlFile, updateHtmlFile4SymptomsCausedByCOVIDLots\n",
|
||||
"from SymptomsCausedByVaccines.PrrSeriesFactory import PrrSeriesFactory\n",
|
||||
"from SymptomsCausedByVaccines.PrrSeriesTransformer import PrrSeriesTransformer\n",
|
||||
"from SymptomsCausedByVaccines.ProportionalReportingRatiosPersister import saveProportionalReportingRatios\n",
|
||||
"import os\n",
|
||||
"import pandas as pd"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4ad05656",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"prrByVaccineAndSymptom = pd.read_csv(\n",
|
||||
" 'data/prrByDrugAndSymptom-EudraVigilance-10.csv',\n",
|
||||
" index_col = 'DRUG')\n",
|
||||
"prrByVaccineAndSymptom"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "7aed1621",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"prrByVaccineAndSymptom = DataFrameFilter.withoutZeroRowsAndZeroColumns(prrByVaccineAndSymptom)\n",
|
||||
"prrByVaccineAndSymptom"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "588aaa2b",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"prrByVaccineBySymptom = PrrSeriesFactory.getPrrByVaccineBySymptom(prrByVaccineAndSymptom)\n",
|
||||
"prrByVaccineBySymptom"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "379d9730",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"prrBySymptomByVaccine = PrrSeriesFactory.getPrrBySymptomByVaccine(prrByVaccineAndSymptom)\n",
|
||||
"prrBySymptomByVaccine"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "0cfd4c66",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"prrByVaccineBySymptomWithoutZeroPrrs = PrrSeriesTransformer.filterByNonZeroPrrs(prrByVaccineBySymptom)\n",
|
||||
"prrByVaccineBySymptomWithoutZeroPrrs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "86da9cb7",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"prrBySymptomByVaccineWithHighPrrs = PrrSeriesTransformer.filterPrrs(prrBySymptomByVaccine, lambda prr: prr >= 2)\n",
|
||||
"prrBySymptomByVaccineWithHighPrrs"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "b41b60c7",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"webAppBaseDir = os.getcwd() + '/../docs/SymptomsCausedByDrugs'"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "26f72e75",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"saveProportionalReportingRatios(\n",
|
||||
" prrByVaccineBySymptomWithoutZeroPrrs,\n",
|
||||
" directory = os.path.normpath(webAppBaseDir + '/data/ProportionalReportingRatios/symptoms'))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "5bfdcbdd",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"saveProportionalReportingRatios(\n",
|
||||
" prrBySymptomByVaccineWithHighPrrs,\n",
|
||||
" directory = os.path.normpath(webAppBaseDir + '/data/ProportionalReportingRatios/vaccines'))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "cc97b8d4",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"updateHtmlFile(\n",
|
||||
" symptoms = list(prrByVaccineAndSymptom.columns),\n",
|
||||
" vaccines = list(prrByVaccineAndSymptom.index),\n",
|
||||
" htmlFile = os.path.normpath(webAppBaseDir + '/index.html'))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3e47c62c",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import html
|
||||
|
||||
def getVaccineOptions(vaccines, defaultOptionText):
|
||||
return _getOptionsWithDefaultOption(defaultOptionText = defaultOptionText, values = vaccines)
|
||||
|
||||
@@ -15,4 +17,4 @@ def _getOptions(values):
|
||||
|
||||
|
||||
def _getOption(value):
|
||||
return '<option value="{value}">{value}</option>'.format(value=value)
|
||||
return '<option value="{value}">{value}</option>'.format(value = html.escape(value))
|
||||
|
||||
Reference in New Issue
Block a user