-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
97 lines (76 loc) · 2.82 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# https://bcrisktool.cancer.gov/about.html
# https://ems-trials.org/riskevaluator/documents/Breast_cancer_prediction_model.pdf
import streamlit as st
import streamlit.components.v1 as components
import risk_factors as risk
st.title('Genetic Cancer Risk Assessment')
# pedigree
def draw_pedigree_chart():
st.warning('''
Create a pedigree, save it to your computer,
upload it in the sidebar to caluclate
the risk models. Or click [The Pedigree Project](https://pedigree.surge.sh/).
''')
src = 'https://pedigree.surge.sh/'
return components.iframe(src, width=850, height=800, scrolling=True)
# sidebar elements
models = risk.models()
pedigree_have_need = risk.pedigree_have_need()
if pedigree_have_need == 'Choose an option':
pass
elif pedigree_have_need == 'Create new pedigree':
draw_pedigree_chart = draw_pedigree_chart()
else:
upload_pedigree = risk.upload_pedigree()
menarche_age = risk.menarche_age()
parity = risk.parity()
age_first_live_birth = risk.age_first_live_birth()
oral_contraceptive_use = risk.oral_contraceptive_use()
if oral_contraceptive_use == 'Yes':
oral_contraceptive_use_duration = risk.oral_contraceptive_use_duration()
else:
oral_contraceptive_use_duration = 0
hrt = risk.hrt()
height = risk.height()
weight = risk.weight()
bmi = risk.bmi(height, weight)
alcohol_intake = risk.alcohol_intake()
if alcohol_intake == 'Yes':
alcohol_intake_quantity = risk.alcohol_intake_quantity()
else:
alcohol_intake_quantity = 0
age_menopause = risk.age_menopause()
breast_density = risk.breast_density()
tubal_ligation = risk.tubal_ligation()
endometriosis = risk.endometriosis()
brca_status = risk.brca_status()
breast_biopsy = risk.breast_biopsy()
ovarian_cancer = risk.ovarian_cancer()
ashkenazi_jewish = risk.ashkenazi_jewish()
def risk_factors():
risk_factors = {
'menarche': menarche_age,
'parity': parity,
'age_first_live_birth': age_first_live_birth,
'oral_contraceptive_use': oral_contraceptive_use,
'oral_contraceptive_use_duration': oral_contraceptive_use_duration,
'hrt': hrt,
'bmi': bmi,
'alcohol_intake': alcohol_intake,
'alcohol_intake_quantity': alcohol_intake_quantity,
'age_menopause': age_menopause,
'breast_density': breast_density,
'tubal_ligation': tubal_ligation,
'endometriosis': endometriosis,
'brca_status': brca_status,
'breast_biopsy': breast_biopsy,
'ovarian_cancer': ovarian_cancer,
'ashkenazi_jewish': ashkenazi_jewish
}
return risk_factors
def tyrer_cusick(age, height, weight, menarche_age, parity, age_menopause, hrt,
brca_status, breast_biopsyi, ovarian_cancer, ashkenazi_jewish):
pass
def BOADICEA():
"""https://www.nature.com/articles/6602175.pdf"""
pass