Skip to content

Commit

Permalink
Merge branch 'main' into deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
tnaccarato committed Aug 14, 2024
2 parents d096a95 + 31e7ad8 commit 678e787
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
2 changes: 0 additions & 2 deletions vis_phewas/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ def test_graph_data_view_alleles(self):
'snp': 'HLA_DRB1_0101',
'gene_class': 1,
'gene_name': 'A',
'a1': 'A',
'a2': 'P',
'cases': 100,
'controls': 200,
'p': 0.01,
Expand Down
6 changes: 3 additions & 3 deletions vis_phewas/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def get_allele_data(disease_id, filters, show_subtypes=False) -> tuple:
"""
disease_string = disease_id.replace('disease-', '').replace('_', ' ')
queryset = HlaPheWasCatalog.objects.filter(phewas_string=disease_string).values(
'snp', 'gene_class', 'gene_name', 'a1', 'a2', 'cases', 'controls', 'p', 'odds_ratio', 'l95', 'u95', 'maf'
'snp', 'gene_class', 'gene_name', 'cases', 'controls', 'p', 'odds_ratio', 'l95', 'u95', 'maf'
).distinct()

# Remove snp from filters list so other snps are still shown
Expand Down Expand Up @@ -279,8 +279,8 @@ def get(self, request):
disease = request.GET.get('disease')
# Get the allele data for the allele and disease
allele_data = HlaPheWasCatalog.objects.filter(snp=allele, phewas_string=disease).values(
'gene_class', 'gene_name', 'serotype', 'subtype', 'phewas_string', 'category_string', 'a1', 'a2', 'cases',
'controls', 'odds_ratio', 'p', 'l95', 'u95', 'maf',
'gene_class', 'gene_name', 'serotype', 'subtype', 'phewas_string', 'phewas_code', 'category_string', 'cases',
'controls', 'odds_ratio', 'l95', 'u95', 'p', 'maf'
).distinct()[0]
# Remove the subtype if it is the main group
if allele_data['subtype'] == '00':
Expand Down
13 changes: 2 additions & 11 deletions vis_phewas/static/mainapp/js/FilterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ export class FilterManager {
input.placeholder = "Enter value";
input.className = "field-input";
filterInputContainer.appendChild(input);
// If the selected field is gene_class, gene_name, a1, or a2
// If the selected field is gene_class, gene_name
}
else if (
["gene_class", "gene_name", "a1", "a2"].includes(selectedField)
["gene_class", "gene_name"].includes(selectedField)
) {
// Add a select field for the operator
const select = document.createElement("select");
Expand All @@ -193,13 +193,6 @@ export class FilterManager {
<option value="DRB1">DRB1</option>
`);
}
else {
// Add a select field for the allele
select.innerHTML = DOMPurify.sanitize(`
<option value="A">A</option>
<option value="P">P</option>
`);
}
// Append the operator to the filter input container
filterInputContainer.appendChild(select);
}
Expand Down Expand Up @@ -286,8 +279,6 @@ export class FilterManager {
<option value="l95">95% CI Lower Bound</option>
<option value="u95">95% CI Upper Bound</option>
<option value="maf">Minor Allele Frequency</option>
<option value="a1">Allele 1</option>
<option value="a2">Allele 2</option>
`);
filterGroup.appendChild(select);

Expand Down

0 comments on commit 678e787

Please sign in to comment.