-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Add sex, race/ethnicity, and computed ancestry as faceted filter columns in the study table UI. Values use canonical labels — the normalization is already done by the search API (#189).
Context
The search API now returns a demographics field on each study with normalized categories:
{
"demographics": {
"sex": {
"n": 981,
"categories": [
{ "label": "Male", "count": 654, "percent": 66.7 },
{ "label": "Female", "count": 327, "percent": 33.3 }
]
}
}
}Because dbGaP studies are submitted independently by thousands of research groups, demographic labels vary across studies (e.g., "Female", "F", "female", "Woman"). The API normalizes these into a small set of canonical categories via demographic_mappings.json:
- Sex: Male, Female, Other/Unknown (3 values)
- Race/Ethnicity: American Indian or Alaska Native, Asian, Black or African American, Hispanic or Latino, Multiple, Native Hawaiian or Other Pacific Islander, Other, Unknown/Not Reported, White (9 values)
- Computed Ancestry: African, African American, East Asian, European, Hispanic1, Hispanic2, Other, Other Asian or Pacific Islander, South Asian (9 values)
The frontend should use these canonical labels to drive the filters.
Implementation
- Populate filterable columns from each study's
demographics.*.categories[].label— e.g., a study withsex.categories: [{label: "Male"}, {label: "Female"}]getssex: ["Male", "Female"]as a multi-value filterable field, same pattern asplatformsordataTypes. - Add faceted filters for sex, raceEthnicity, and computedAncestry to the filter sidebar, following the existing multi-value filter pattern.
- Group the 3 demographic filters under a "Demographics" section in the sidebar.
Acceptance criteria
- Sex, race/ethnicity, and computed ancestry appear as filterable facets in the study table
- Filter values are canonical labels (e.g., "Black or African American"), not raw study-specific labels
- Filter counts reflect the number of studies with each canonical category
- Selecting a filter value (e.g., "Female") shows only studies that have female participants
- Studies without demographic data are handled gracefully (excluded from counts, not hidden from table)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels