From ba093cee1838b0b1df3f57c648bc053d4a354c80 Mon Sep 17 00:00:00 2001 From: Joshua Orvis Date: Sun, 14 Jan 2024 22:31:21 -0600 Subject: [PATCH] URL options now handled for manually entered genes, gene lists, dataset collections and exact matches --- www/expression.html | 2 +- www/index.html | 2 +- www/js/expression.js | 8 ++++++-- www/js/index.js | 5 +++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/www/expression.html b/www/expression.html index 51502cdd..2b232998 100644 --- a/www/expression.html +++ b/www/expression.html @@ -74,7 +74,7 @@
diff --git a/www/index.html b/www/index.html index 49f1fcec..9a65cb8c 100644 --- a/www/index.html +++ b/www/index.html @@ -183,7 +183,7 @@

diff --git a/www/js/expression.js b/www/js/expression.js index 1dade18f..d5f745c0 100644 --- a/www/js/expression.js +++ b/www/js/expression.js @@ -3,7 +3,9 @@ document.addEventListener('DOMContentLoaded', () => { document.querySelector('#page-header-label').textContent = 'Gene Expression Search'; // Handle passed URL parameters - + if (getUrlParameter('gene_symbol_exact_match') === 'true') { + document.querySelector('#gene-search-exact-match').checked = true; + } }); @@ -33,6 +35,8 @@ const parseDatasetCollectionURLParams = () => { const layout_id = getUrlParameter('layout_id'); if (layout_id) { - selectDatasetCollection(layout_id); + selected_dc_share_id = layout_id; + selected_dc_label = dataset_collection_label_index[layout_id]; + document.querySelector('#dropdown-dc-selector-label').innerHTML = selected_dc_label; } } \ No newline at end of file diff --git a/www/js/index.js b/www/js/index.js index d94a75c9..c3188a84 100644 --- a/www/js/index.js +++ b/www/js/index.js @@ -24,6 +24,11 @@ document.addEventListener('DOMContentLoaded', () => { if (manually_entered_genes.length > 0) { url += `gene_symbol=${manually_entered_genes.join(',')}`; } + + // are we doing exact matches? + if (document.querySelector('#gene-search-exact-match').checked) { + url += '&gene_symbol_exact_match=true'; + } // add the gene lists if (Object.keys(selected_carts).length > 0) {