wzkariampuzha commited on
Commit
2b7ba7c
1 Parent(s): 37c06c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -36
app.py CHANGED
@@ -119,40 +119,41 @@ if disease_or_gard_id:
119
  NER_pipeline, entity_classes,
120
  extract_diseases, GARD_dict, max_length,
121
  classify_model_vars)
122
- df.replace(to_replace='None', value="None")
123
- st.dataframe(df, height=200)
124
- csv = convert_df(df)
125
- disease, gardID = name_gardID
126
- #if the user input does not have a number in it (i.e. weak proxy for if it is a GARD ID), then preserve the user input as the disease term.
127
- if not bool(re.search(r'\d', disease_or_gard_id)):
128
- disease = disease_or_gard_id
 
 
 
 
 
 
 
 
129
 
130
- st.download_button(
131
- label="Download epidemiology results for "+disease+" as CSV",
132
- data = csv,
133
- file_name=disease+'.csv',
134
- mime='text/csv',
135
- )
136
-
137
- st.markdown('See the NIH GARD page for ['+disease+'](https://rarediseases.info.nih.gov/diseases/'+str(re.sub('GARD:|0','',gardID))+'/'+str('-'.join(disease.split()))+')')
138
-
139
- fig = epi_sankey(sankey_data,disease)
140
- st.plotly_chart(fig, use_container_width=True)
141
-
142
- if 'IDS' in list(df.columns):
143
- st.markdown('''COLUMNS: \\
144
- - PROB_OF_EPI: Probability that the paper is an epidemiologic study based on its abstract. \\
145
- - IsEpi: If it is an epidemiologic study (If PROB_OF_EPI >0.5) \\
146
- - DIS: Rare disease terms or synonyms identified in the abstract from the GARD Dictionary
147
- - IDS: GARD IDs identified in the abstract from the GARD Dictionary \\
148
- - EPI: Epidemiology Types are the metrics used to estimate disease burden such as "incidence", "prevalence rate", or "occurrence"
149
- - STAT: Epidemiology Rates describe how many people are afflicted by a disease.
150
- - DATE: The dates when the epidemiologic studies were conducted
151
- - LOC: Where the epidemiologic studies were conducted.
152
- - SEX: The biological sexes mentioned in the abstract. Useful for diseases that disproportionately affect one sex over the other or may provide context to composition of the study population
153
- - ETHN: Ethnicities, races, and nationalities of those represented in the epidemiologic study.
154
- ''')
155
- else:
156
- st.subheader("Categories of Results")
157
- st.markdown(" - **PROB_OF_EPI**: Probability that the paper is an epidemiologic study based on its abstract. \n - **IsEpi**: If it is an epidemiologic study (If PROB_OF_EPI >0.5) \n - **EPI**: Epidemiology Types are the metrics used to estimate disease burden such as 'incidence', 'prevalence rate', or 'occurrence' \n - **STAT**: Epidemiology Rates describe how many people are afflicted by a disease. \n - **DATE**: The dates when the epidemiologic studies were conducted \n - **LOC**: Where the epidemiologic studies were conducted. \n - **SEX**: The biological sexes mentioned in the abstract. Useful for diseases that disproportionately affect one sex over the other or may provide context to composition of the study population \n - **ETHN**: Ethnicities, races, and nationalities of those represented in the epidemiologic study.")
158
- #st.dataframe(data=None, width=None, height=None)
 
119
  NER_pipeline, entity_classes,
120
  extract_diseases, GARD_dict, max_length,
121
  classify_model_vars)
122
+ if df:
123
+ df.replace(to_replace='None', value="None")
124
+ st.dataframe(df, height=200)
125
+ csv = convert_df(df)
126
+ disease, gardID = name_gardID
127
+ #if the user input does not have a number in it (i.e. weak proxy for if it is a GARD ID), then preserve the user input as the disease term.
128
+ if not bool(re.search(r'\d', disease_or_gard_id)):
129
+ disease = disease_or_gard_id
130
+
131
+ st.download_button(
132
+ label="Download epidemiology results for "+disease+" as CSV",
133
+ data = csv,
134
+ file_name=disease+'.csv',
135
+ mime='text/csv',
136
+ )
137
 
138
+ st.markdown('See the NIH GARD page for ['+disease+'](https://rarediseases.info.nih.gov/diseases/'+str(re.sub('GARD:|0','',gardID))+'/'+str('-'.join(disease.split()))+')')
139
+
140
+ fig = epi_sankey(sankey_data,disease)
141
+ st.plotly_chart(fig, use_container_width=True)
142
+
143
+ if 'IDS' in list(df.columns):
144
+ st.markdown('''COLUMNS: \\
145
+ - PROB_OF_EPI: Probability that the paper is an epidemiologic study based on its abstract. \\
146
+ - IsEpi: If it is an epidemiologic study (If PROB_OF_EPI >0.5) \\
147
+ - DIS: Rare disease terms or synonyms identified in the abstract from the GARD Dictionary
148
+ - IDS: GARD IDs identified in the abstract from the GARD Dictionary \\
149
+ - EPI: Epidemiology Types are the metrics used to estimate disease burden such as "incidence", "prevalence rate", or "occurrence"
150
+ - STAT: Epidemiology Rates describe how many people are afflicted by a disease.
151
+ - DATE: The dates when the epidemiologic studies were conducted
152
+ - LOC: Where the epidemiologic studies were conducted.
153
+ - SEX: The biological sexes mentioned in the abstract. Useful for diseases that disproportionately affect one sex over the other or may provide context to composition of the study population
154
+ - ETHN: Ethnicities, races, and nationalities of those represented in the epidemiologic study.
155
+ ''')
156
+ else:
157
+ st.subheader("Categories of Results")
158
+ st.markdown(" - **PROB_OF_EPI**: Probability that the paper is an epidemiologic study based on its abstract. \n - **IsEpi**: If it is an epidemiologic study (If PROB_OF_EPI >0.5) \n - **EPI**: Epidemiology Types are the metrics used to estimate disease burden such as 'incidence', 'prevalence rate', or 'occurrence' \n - **STAT**: Epidemiology Rates describe how many people are afflicted by a disease. \n - **DATE**: The dates when the epidemiologic studies were conducted \n - **LOC**: Where the epidemiologic studies were conducted. \n - **SEX**: The biological sexes mentioned in the abstract. Useful for diseases that disproportionately affect one sex over the other or may provide context to composition of the study population \n - **ETHN**: Ethnicities, races, and nationalities of those represented in the epidemiologic study.")
159
+ #st.dataframe(data=None, width=None, height=None)