Skip to content

Commit

Permalink
Merge pull request #23 from eipm/B2AI-541
Browse files Browse the repository at this point in the history
B2AI-541
  • Loading branch information
jmtang2018 authored Nov 21, 2024
2 parents 14f4f95 + 0f1c3bb commit c3f5270
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/tabs/collection_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def collection_methods_page(tab_name):

csv_file_path = "tables/Disease_cohort_inclusion_exclusion_criteria.csv"
caption = 'Table 1 - Disease cohort inclusion/exclusion criteria and validation methods'
create_html_table(csv_file_path, caption)
create_html_table(csv_file_path, caption, [], 0)

csv_file_path = "tables/Acoustic_Tasks_Protocol.csv"
caption = 'Table 2 - Acoustic Tasks in Protocol'
Expand Down
115 changes: 114 additions & 1 deletion src/tabs/study_metadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,119 @@
import streamlit as st
from tabs.utils import coming_soon_message
from tabs.utils import create_html_table

def show_table(key, button_text, show_table, csv_file_path, caption):
if st.button(button_text, key):
st.session_state[show_table] = not st.session_state[show_table]

# Conditionally display the table
if st.session_state[show_table]:
create_html_table(csv_file_path, caption, [], 0)

# Define the content of the Study Metadata page
def study_metadata_page(tab_name):
coming_soon_message(tab_name)

# Initialize session state for table visibility
if 'show_table_1' not in st.session_state:
st.session_state['show_table_1'] = False

st.markdown(
"""
Official Title: Bridge2AI-Voice
Design: Study Type - Observational
Enrollment Count (Anticipated by 2027): 10,000
Design Observation Model
- Cohort
Design Time Perspective
- Cross-sectional
Biospecimens: Respiratory, Voice and speech samples
Biospecimens Description<br>
The Bridge2AI-Voice dataset contains samples from conventional acoustic tasks including respiratory sounds, cough sounds, and free speech prompts, capturing voice, speech and language data relating to health. Participants who consent are asked to perform speaking tasks and complete self-reported demographic and medical history questionnaires, as well as disease-specific validated questionnaires. Participants who consent also permit investigators to access medical information through EHR platforms in order to perform gold standard validation of diagnoses and symptoms
<ins>Eligibility</ins>
Sex<br>
All
Gender Based<br>
No
Minimum Age<br>
18 years (this will change when pediatric cohort is introduced, and metadata will be updated to reflect new eligibility criteria)
Maximum Age<br>
120 years
Healthy Volunteers<br>
Yes
Inclusion Criteria<br>""", unsafe_allow_html=True)

show_table(1, 'See Collection Methods - Table 1', 'show_table_1', "tables/Disease_cohort_inclusion_exclusion_criteria.csv", 'Table 1 - Disease cohort inclusion/exclusion criteria and validation methods')

st.markdown(
"""
Exclusion Criteria<br>
Does not read or speak English (Please note, the Spanish protocols and Data collection will be included in future releases)<br>""", unsafe_allow_html=True)

show_table(2, 'See Collection Methods - Table 1', 'show_table_1', "tables/Disease_cohort_inclusion_exclusion_criteria.csv", 'Table 1 - Disease cohort inclusion/exclusion criteria and validation methods')

st.markdown(
"""
Study Population<br>
The current v.1.0.0 dataset contains only adult populations. As the study progresses, a pediatric cohort will be introduced. Inclusion/exclusion criteria and additional information regarding the dataset and study metadata will be updated at that time. In addition, the current dataset contains fluent English speakers but will expand to include data collection in Spanish.
Sampling Method<br>
Non-Probability Sample<br>
Identification Information<br>
Organization Study ID<br>
OT2OD032720<br>
Organization Study Type<br>
U.S. National Institutes of Health (NIH) Grant/Contract Award Number
Secondary ID<br>
<table style="border: none;">
<tr>
<td><b>ID</b></td>
<td><b>Link</b></td>
</tr>
<tr>
<td>OT2OD032720</td>
<td><a href="https://reporter.nih.gov/search/4XtcXzBGEkWQlwG5v8odBA/project-details/10858564">https://reporter.nih.gov/search/4XtcXzBGEkWQlwG5v8odBA/project-details/10858564</a></td>
</tr>
</table>
Collaborators
- University of South Florida
- Weill Cornell Medicine
- Oregon Health & Science University
- Massachusetts Institute of Technology
- University of Toronto
- Mount Sinai Hospital
- Hospital for Sick Children
- Simon Fraser University
- The Hastings Center
- Washington University in St. Louis
- University of Florida
- Vanderbilt University Medical Center
URL
How to cite
If you use this dataset for any purpose, please cite the resources specified in the Bridge2AI-Voice documentation for version 1.0.0 of the dataset at (URL)
Bridge2AI-Voice Consortium (2024). Flagship Voice Dataset from the Bridge2AI-Voice Project (1.0.0) [Dataset].
Contact
For any questions, suggestions, or feedback related to this dataset, please email [email protected]
Acknowledgement
Bridge2AI-Voice is supported by NIH grant OT2OD032720 through the NIH Bridge2AI Common Fund program.
""", unsafe_allow_html=True)

22 changes: 19 additions & 3 deletions src/tabs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@ def coming_soon_message(tab_name):
image_path = "images/Wave.png"
st.image(image_path, caption='', use_container_width=True)

def create_html_table(csv_file_path, caption=None, cell_values=[]):
# Read CSV file
def create_html_table(csv_file_path, caption=None, cell_values=[], column_index=-1):
# Read CSV file
df = pd.read_csv(csv_file_path, dtype=str) # Ensure all columns are read as strings

# Replace NaN with an empty string;
df = df.fillna("")


bold_cells = df.iloc[:, column_index].tolist() if column_index >= 0 else []

# Convert DataFrame to HTML table
html_table = df.to_html(index=False, classes='table table-striped')

if bold_cells and len(bold_cells) > 0:
for bold_cell in bold_cells:
html_table = html_table.replace(f'<td>{bold_cell}</td>', f'<td class="bold-cell">{bold_cell}</td>')

if cell_values and len(cell_values) > 0:
for cell_value in cell_values:
html_table = html_table.replace(f'<td>{cell_value}</td>', f'<td class="center-align">{cell_value}</td>')
Expand Down Expand Up @@ -51,9 +58,18 @@ def create_html_table(csv_file_path, caption=None, cell_values=[]):
padding: 4px !important;
text-align: left;
}
.table th {
background-color: #f2f2f2;
}
.table .center-align {
text-align: center; /* Center alignment for specific columns */
}
.table .bold-cell {
font-weight: bold; /* Bold font for first column cells */
}
</style>
""",
unsafe_allow_html=True
Expand Down

0 comments on commit c3f5270

Please sign in to comment.