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
Binary file modified .DS_Store
Binary file not shown.
Binary file modified data/.DS_Store
Binary file not shown.
485 changes: 485 additions & 0 deletions data/cancer_types.ipynb

Large diffs are not rendered by default.

1,770 changes: 1,679 additions & 91 deletions data/processing.py

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions data/survival_dict.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
type,5yr_survival
nsclc,0.28
sclc,0.07
lung,0.175
oral cavity and pharynx,0.68
lip,0.914
tongue,0.688
laryngeal,0.61
thyroid,0.984
head and neck,0.7752
cervical,0.67
endometrial,0.81
invasive epithelial ovarian,0.5
ovarian stromal,0.89
germ cell tumors of ovary,0.92
fallopian tube,0.55
ovarian,0.715
anal,0.7
intraheptic bile duct,0.09
extraheptic bile duct,0.11
bile duct,0.1
colorectal,0.63
esophagus ,0.22
gallbladder,0.2
gist,0.82
liver,0.22
pancreatic,0.13
small intestine,0.69
stomach,0.36
bladder,0.78
kidney,0.78
malignant mesothelioma,0.12
breast,0.91
penile,0.65
prostate,0.97
testicular,0.95
vaginal,0.51
leiomyosarcoma,0.38
undifferentiated sarcoma,0.43
endometrial stromal sarcoma,0.96
uterine sarcoma,0.57
vulvar,0.71
adrenal,0.5
melanoma,0.94
eye,0.81
soft tissue sarcoma,0.65
osteosarcoma,0.59
chondrosarcoma,0.79
chordoma,0.84
giant cell tumor of bone,0.78
bone ,0.8033333333
low-grade astrocytoma,0.48
anaplastic astrocytoma,0.34
glioblastoma,0.12
oligodendroglioma,0.8
anaplastic oligodendroglioma,0.63
ependymoma,0.9
meningioma,0.79
brain,0.58
myeloma,0.58
hodgkin lymphoma,0.89
non-hodgkin lymphoma,0.78
lymphoma,0.835
leukemia,0.67
aml,0.295
all,0.681
other,0.708
pain,
pediatric,0.6949166667
peds pilocytic astrocytoma,0.95
peds diffuse astrocytoma,0.825
peds anaplastic astrocytoma,0.25
peds glioblastoma,0.2
peds oligodendroglioma,0.9
peds ependymoma,0.75
peds embryonal tumors,0.625
peds brain,0.6428571429
peds all,0.9
peds aml,0.675
peds jmml,0.5
peds cml,0.7
peds leukemia,0.69375
Binary file modified trial_app/.DS_Store
Binary file not shown.
Binary file modified trial_app/frontend/pages/.DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions trial_app/frontend/pages/helper_functions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
shortcut_map = {'Adenocarcinoma':'adeno', 'Squamous Cell Carcinoma':'squamous cell', 'Transitional Cell Carcinoma': 'carcinoma',
'Basal Cell Carcinoma': 'carcinoma', 'Ductal Carcinoma': 'ductal', 'Other Carcinoma': 'carcinoma',
'Brain Cancer': 'brain', 'Sarcoma': 'sarcoma', 'Lymphoma': 'lymphoma', 'Leukemia': 'leukemia', 'Melanoma':'melanoma',
'Myeloma': 'myeloma', 'Pediatric Cancer': 'other', 'Pain relating to any disease': 'pain', 'Other': 'other'}

conditions_5yr_survival_map = {'myeloma': 0.598, 'squamous cell': 0.99,
'adeno': 0.175, 'carcinoma': 0.99, 'leukemia': 0.65,
'ductal': 0.99, 'sarcoma': 0.65,
'lymphoma': 0.83, 'melanoma': 0.94,
'brain': 0.326, 'pain': 0.68, 'other': 0.68}

conditions_max_treatment_duration_map = {'myeloma': 180, 'squamous cell': 49, 'adeno': 1080,
'carcinoma': 1440, 'leukemia': 1095, 'ductal': 1825,
'sarcoma': 1825,'lymphoma': 730, 'melanoma': 730,
'brain': 4320, 'pain': 4320, 'other': 4320}

conditions_min_treatment_duration_map = {'myeloma': 90, 'squamous cell': 14, 'adeno': 360,
'carcinoma': 360, 'leukemia': 730, 'ductal': 365, 'sarcoma': 240,
'lymphoma': 180, 'melanoma': 150, 'brain': 1080, 'pain': 14, 'other': 14}
28 changes: 26 additions & 2 deletions trial_app/frontend/pages/loading.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import streamlit as st
import time
# import pandas as pd
# from pages.trial import (
# type, display_location, display_dmc, display_resp_party, display_intervention, display_intervention_types, display_purpose,
# display_outcome_measures, mask, vol, display_primary_duration, display_secondary_duration, features)

progress_text = "Operation in progress. Please wait."
my_bar = st.progress(0, text=progress_text)
Expand All @@ -12,13 +16,33 @@

st.header('Your prediction result is...')
st.balloons()
st.write('')

# display_features = {'Cancer type': type, 'Phase': features['phase'], 'Locations': display_location,
# 'Number of sites': features['num_locations'], 'Number of subjects': features['enroll_count'],
# 'Number of inclusion criteria': features['num_inclusion'], 'Number of exclusion criteria': features['num_exclusion'],
# 'Data monitoring committee': display_dmc, 'Responsible party': display_resp_party,
# 'Intervention model': display_intervention, 'Intervention type(s)': display_intervention_types,
# 'Primary purpose': display_purpose, 'Number of groups': features['number_of_groups'],
# 'Outcome measure(s)': display_outcome_measures, 'Masking': mask, 'Healthy volunteers': vol,
# 'Primary outcome measure duration (from baseline)': display_primary_duration,
# 'Secondary outcome measure duration (from baseline)': display_secondary_duration}

# df = pd.Series(display_features, name='Inputs')

# Check if prediction result is available in session state
if 'prediction_result' in st.session_state:
prediction = st.session_state['prediction_result']
st.write('Your trial is estimated to take between: ', prediction["bin_interval"], "years.")
lower = prediction['bin_interval'][1:5]
upper = prediction['bin_interval'][7:11]
st.write('Your trial is estimated to take between ', lower, ' and ', upper, " years.")
# st.write('')
# st.write('Your inputs were:')
# st.write('')
# st.table(df)

else:
st.error('No prediction result available. Please go back to the input page.')

# Add a button to go back to the input page
st.page_link('pages/trial.py', label='Go Back')
st.page_link('pages/trial.py', label='**Go Back**')
Loading