diff --git a/.nvmrc b/.nvmrc index 5debbed..e1fcd1e 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/carbon +lts/erbium diff --git a/assets/js/pages/gwas_region.js b/assets/js/pages/gwas_region.js index ac248c8..7faeaaf 100644 --- a/assets/js/pages/gwas_region.js +++ b/assets/js/pages/gwas_region.js @@ -24,7 +24,8 @@ function makePlot(template_vars) { { lz_sources: getBasicSources(assoc_sources), lz_layout: getBasicLayout(state, panels, { responsive_resize: false }), - study_names: [template_vars.label] + study_names: [template_vars.label], + top_hits_url: template_vars.top_hits_url, }, template_vars, { genome_build: template_vars.build, diff --git a/assets/js/pages/gwas_summary.js b/assets/js/pages/gwas_summary.js index 3ae7d52..be407fe 100644 --- a/assets/js/pages/gwas_summary.js +++ b/assets/js/pages/gwas_summary.js @@ -13,7 +13,6 @@ function createTopHitsTable(selector, data, region_url) { data = data.filter(v => !!v.peak) .map(item => { // FIXME: Synthetic field; feed a marker into pheweb loader code for better tables in the future - // TODO: Get pheweb "nearest gene" annotations working (and make build agnostic) item.marker = `${item.chrom}: ${item.pos.toLocaleString()}`; return item; }); diff --git a/assets/vue/gwas_region.vue b/assets/vue/gwas_region.vue index 0d2c2f0..6a55b53 100644 --- a/assets/vue/gwas_region.vue +++ b/assets/vue/gwas_region.vue @@ -1,8 +1,12 @@ - - diff --git a/locuszoom_plotting_service/gwas/views.py b/locuszoom_plotting_service/gwas/views.py index 5fb6edc..f28ab02 100644 --- a/locuszoom_plotting_service/gwas/views.py +++ b/locuszoom_plotting_service/gwas/views.py @@ -214,6 +214,10 @@ def get_context_data(self, **kwargs): reverse('apiv1:gwas-region', kwargs={'slug': gwas.slug}), token ), + 'top_hits_url': add_token( + reverse('gwas:manhattan-json', kwargs={'slug': gwas.slug}), + token, + ), 'label': gwas.label, 'build': gwas.build, # Default region for bare URLs is the top hit in the study diff --git a/locuszoom_plotting_service/taskapp/tasks.py b/locuszoom_plotting_service/taskapp/tasks.py index 9987218..006a1e7 100644 --- a/locuszoom_plotting_service/taskapp/tasks.py +++ b/locuszoom_plotting_service/taskapp/tasks.py @@ -8,6 +8,7 @@ from django.db.models import signals from django.db import transaction from django.dispatch import receiver +from django.urls import reverse from django.utils import timezone from zorp import ( @@ -156,8 +157,9 @@ def mark_success(self, fileset_id): metadata.save() # TODO: Render this as a nicer-looking template + log_url = reverse('gwas:gwas-ingest-log', kwargs={'slug': metadata.slug}) send_mail('[locuszoom] Upload succeeded', - f'Your upload is done processing. Please visit https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()} to see the Manhattan plot and begin exploring regions of your data.', # noqa + f'Your upload is done processing. Please visit https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()} to see the Manhattan plot and begin exploring regions of your data.\nBe sure to review the ingest logs for any warnings: https://{settings.LZ_OFFICIAL_DOMAIN}{log_url}', # noqa 'locuszoom-service@umich.edu', [metadata.owner.email]) @@ -176,8 +178,9 @@ def mark_failure(self, fileset_id): instance.save() metadata = instance.metadata + log_url = reverse('gwas:gwas-ingest-log', kwargs={'slug': metadata.slug}) send_mail('[locuszoom] Upload failed', - f'Your upload failed to process. Please visit https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()} to see the error logs.', # noqa + f'Your upload failed to process. Please review the ingest logs for warnings and error messages: https://{settings.LZ_OFFICIAL_DOMAIN}{log_url}\nOr visit the upload page to change settings: https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()}', # noqa 'locuszoom-service@umich.edu', [metadata.owner.email]) diff --git a/locuszoom_plotting_service/templates/base.html b/locuszoom_plotting_service/templates/base.html index 42edabc..1a2f132 100644 --- a/locuszoom_plotting_service/templates/base.html +++ b/locuszoom_plotting_service/templates/base.html @@ -39,8 +39,8 @@ - + {% block css %}{% endblock %} @@ -131,15 +131,12 @@ {# Javascript: global template code, plus custom items per page #} - - - + + + {% block javascript %}{% endblock javascript %} diff --git a/locuszoom_plotting_service/templates/gwas/gwas_region.html b/locuszoom_plotting_service/templates/gwas/gwas_region.html index a5f529e..c38fa19 100644 --- a/locuszoom_plotting_service/templates/gwas/gwas_region.html +++ b/locuszoom_plotting_service/templates/gwas/gwas_region.html @@ -22,6 +22,9 @@ Uploaded by: {{ gwas.owner.display_name }}, {{ gwas.created | date }} {% if gwas.is_public %}Public {% else %}Private{% endif %} {% if gwas.pmid %}PubMed{% endif %} + {% if gwas.owner == request.user %}(edit) + {% if not gwas.is_public %}(share){% endif %} + {% endif %} diff --git a/package.json b/package.json index 3742138..ffa7448 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ "d3": "3.5.16", "d3-tip": "0.9.0", "gwas-credible-sets": "^0.1.0", - "locuszoom": "0.10.0-beta.2", - "locuszoom-tabix": "https://github.com/statgen/localzoom#dbcc3e5", + "locuszoom": "0.10.0", + "locuszoom-tabix": "https://github.com/statgen/localzoom#918fd75", "pako": "^1.0.8", "underscore": "1.8.3", "vue": "^2.6.10", diff --git a/yarn.lock b/yarn.lock index 11c423a..a5c1667 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3253,25 +3253,25 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -"locuszoom-tabix@https://github.com/statgen/localzoom#dbcc3e5": - version "0.4.0" - resolved "https://github.com/statgen/localzoom#dbcc3e59a2061903d831ca4f8d6874f271f2590f" +"locuszoom-tabix@https://github.com/statgen/localzoom#918fd75": + version "0.5.0" + resolved "https://github.com/statgen/localzoom#918fd7525f7e14c13dae60dc6f630188b1669c53" dependencies: "@sentry/browser" "^4.5.2" bootstrap "^4.1.3" bootstrap-vue "^2.0.0-rc.11" gwas-credible-sets "^0.1.0" - locuszoom "0.10.0-beta.2" + locuszoom "0.10.0" lodash "^4.17.11" tabix-reader "https://github.com/abought/tabix-reader" tabulator-tables "^4.1.4" vue "^2.6.10" vue-bootstrap-typeahead "^0.2.6" -locuszoom@0.10.0-beta.2: - version "0.10.0-beta.2" - resolved "https://registry.yarnpkg.com/locuszoom/-/locuszoom-0.10.0-beta.2.tgz#7c007c421ee3c1e39f9adab6612874761bb455c6" - integrity sha512-SkyquD7OCPJQcCrFoJxHBlA9/U9CNJb+EE1n+O/jnX5CqiFlPUHHrzi8KzBUPZ25DQHdtCHXM7YE+0imHTrYDg== +locuszoom@0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/locuszoom/-/locuszoom-0.10.0.tgz#7dad2341af6e539f6bbf0878ec1753a521e7c647" + integrity sha512-v+g8YKHszmZL7/yJg5EDZhrGS3jlGoP/WTXM0WFjTUi8MrPCADaeutwx/FhkmZtbhtlb+khO+8EYItaaTGEMLg== dependencies: d3 "3.5.17" promise-polyfill "^8.1.3"