Skip to content

Commit f42435c

Browse files
authored
Refactor of mGAP overview page (#135)
* Refactor of mGAP overview page
1 parent 8e37da3 commit f42435c

6 files changed

Lines changed: 96 additions & 9 deletions

File tree

mGAP/resources/views/overview.html

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,52 @@
1010
});
1111
})(jQuery);
1212
</script>
13+
14+
<script>
15+
$( function() {
16+
$( "i.mgap-help" ).on("click", function(e){
17+
const el = $(e.target);
18+
const videoName = el.attr('data-video');
19+
const title = el.attr('data-video-title');
20+
21+
LDK.Assert.assertNotEmpty('Missing data-video attribute.', videoName);
22+
23+
mGAP.Utils.showVideoDialog(videoName, title);
24+
});
25+
} );
26+
</script>
1327
<div class="colDiv">
1428
<div style="flex: 1;margin-right: 20px;">
1529
Non-human primates, such as Rhesus macaques, are a powerful genetic model of human disease. mGAP seeks to fill several major voids to promote genomic analyses and the study of human genetic disease in this key pre-clinical model.
1630
The database provides open access to rhesus macaque genomic and phenotypic data. Our dataset was originally generated using animals from the large, pedigreed colony of Indian-origin rhesus macaques housed at the Oregon National Primate Research Center (ONPRC); however, it has
17-
since <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-externalData.view">been expanded to include data from other National Primate Research Centers and NHP colonies.</a>. Below are the key features of mGAP:
31+
since <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-externalData.view">been expanded to include data from other National Primate Research Centers and NHP colonies.</a>.
32+
<br><br>
33+
<span style="font-weight: bold">NEW: Click the video icons (<i class="fa-solid fa-video mgap-help"></i>) in order to load help videos, or <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-tutorials.view">view our tutorials page</a> for more detail.</span>
1834
<br>
19-
<h4 style="text-decoration: underline;">Short Variant Catalog:</h4>
35+
<h4><span style="text-decoration: underline">Short Variant Catalog:</span> <img style="vertical-align: sub" width="40px" src="<%=contextPath%>/mgap/images/SNV.png" alt="SNV"></h4>
2036
The primary dataset generated by mGAP is a catalog of short variants (summarized to the right). Raw sequence data are <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mgap-dataProcessing.view">analyzed using a vetted pipeline</a> designed to produce high-confidence genotype calls.
2137
The resulting variants are <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mgap-annotation.view">annotated using a wide range of data sources</a>, including predicted function, overlap with regulatory elements and association with phenotypes and diseases.
2238
<br>
2339
<ul style="padding-top: 10px;">
24-
<li>Use the <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-genomeBrowser.view?">Genome Browser</a> to view and search data</li>
25-
<!-- <li>Use our new <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-genomeBrowser.view?target=variantSearch">Full-text Search</a> tool to query variants based on gene, or using our <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mgap-annotation.view">extensive annotations</a></li>-->
26-
<li>View our list of <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-variantList.view">Predicted Damaging Variants</a>, which is a list of predicted high-impact or disease associated variants, generated from each release</li>
40+
<li>Use the <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-genomeBrowser.view?">Genome Browser</a> to view and search data. <i class="fa-solid fa-video mgap-help" data-video="genome-browser"></i></li>
41+
<li>Use our new <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-genomeBrowser.view?target=variantSearch">Full-text Search</a> tool to query variants based on gene, or using our <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mgap-annotation.view">extensive annotations</a> <i class="fa-solid fa-video mgap-help" data-video="variant-search"></i></li>
42+
<li>View our list of <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-variantList.view">Predicted Damaging Variants</a>, which is a list of predicted high-impact or disease associated variants, generated from each release <i class="fa-solid fa-video mgap-help" data-video="high-impact-variants"></i></li>
2743
<li>Unlike many datasets, mGAP has genotype-level data, <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/project-begin.view?pageId=clinical">often connected to living animals from pedigreed breeding colonies</a></li>
2844
<li>Download raw data, including <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/project-begin.view?pageId=datasets">sequence data</a> and <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/project-begin.view?pageId=variants">variant data</a></li>
2945
</ul>
3046

31-
<h4 style="text-decoration: underline;">Structural Variant Catalog:</h4>
47+
<h4><span style="text-decoration: underline;">Structural Variant Catalog:</span> <img style="vertical-align: sub" width="40px" src="<%=contextPath%>/mgap/images/SV.png" alt="SV"></h4>
3248
We have released a draft dataset with structural variants generated from PacBio sequencing of 44 Rhesus macaques. These data complement the short variant catalog by detecting categories of variants not readily accomplished with short read Illumina data.
3349
<br>
3450
<ul style="padding-top: 10px;">
3551
<li>Use the <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-genomeBrowser.view?activeTracks=mGAP Structural Variants 1.0">Genome Browser</a> to view and search structural variant data</li>
3652
</ul>
3753

38-
<h4 style="text-decoration: underline;">NHP Models of Human Disease:</h4>
54+
<h4><span style="text-decoration: underline;">NHP Models of Human Disease:</span> <img style="vertical-align: sub" width="40px" src="<%=contextPath%>/mgap/images/phenotypes.png" alt="Phenotypes"></h4>
3955
NHPs serve as essential pre-clinical models for a range of human diseases. The mGAP site supports this work by providing information about published NHP disease/phenotype models, and by providing summaries of the annotated variant catalog to help identify novel disease-associated variants.
4056
<br>
4157
<ul style="padding-top: 10px;">
58+
<li>Tutorial on searching phenotypes and variants <i class="fa-solid fa-video mgap-help" data-video="phenotypes_and_models"></i></li>
4259
<li>View our list of <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/project-begin.view?pageId=model">Published NHP Disease Models</a></li>
4360
<li>View the list of <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mgap-phenotypeList.view">Genes and OMIM diseases/phenotypes</a> where predicted damaging variants were detected</li>
4461
<li>View our list of <a class="mgap-link" href="<%=contextPath%><%=containerPath%>/mGap-variantList.view">Predicted Damaging Variants</a>, which is a list of predicted high-impact or disease associated variants, generated from each release</li>
@@ -48,7 +65,7 @@ <h4 style="text-decoration: underline;">NHP Models of Human Disease:</h4>
4865

4966
<div id="mgap-graph-outer" style="width: 350px;border: 1px;border-color: black; border-style: solid;padding: 10px;">
5067

51-
<h4 style="font-style: italic;margin-top: 0px;">Summary of Current Release:</h4>
68+
<h4 style="font-style: italic;margin-top: 0;">Summary of Current Release:</h4>
5269
<br>
5370
<div id="mgap-release-table"></div>
5471

mGAP/resources/views/overview.view.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
<dependency path="ldk.context"/>
77
<dependency path="internal/jQuery"/>
88
<dependency path="https://cdn.plot.ly/plotly-latest.min.js"/>
9+
<dependency path="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"/>
10+
<dependency path="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css"/>
11+
<dependency path="https://kit.fontawesome.com/d2fb21907d.js"/>
912
</dependencies>
1013
</view>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<script type="text/javascript">
2+
(function($){
3+
$( document ).ready(function() {
4+
const videos = [{
5+
Title: 'Overview',
6+
src: 'overview',
7+
},{
8+
Title: 'Genome Browser Overview',
9+
src: 'genome-browser',
10+
},{
11+
Title: 'Phenotypes and Phenotype Searches',
12+
src: 'phenotypes-and-models',
13+
},{
14+
Title: 'Using the Variant Table',
15+
src: 'mgap-table-view-tutorial',
16+
}]
17+
18+
// $('#tileview').dxTileView({
19+
// items: videos,
20+
// height: 390,
21+
// baseItemHeight: 120,
22+
// baseItemWidth: 185,
23+
// itemMargin: 10,
24+
// itemTemplate(itemData, itemIndex, itemElement) {
25+
// const $image = $('<div>')
26+
// .addClass('image')
27+
// .css('background-image', `url(${itemData.src})`);
28+
//
29+
// itemElement
30+
// .append(`<div>${itemData.Title}</div>`)
31+
// .append($image);
32+
// },
33+
// });
34+
});
35+
})(jQuery);
36+
</script>
37+
38+
<div id="tileview">Videos will be added shortly</div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<view xmlns="http://labkey.org/data/xml/view" title="mGAP Tutorials">
2+
<permissions>
3+
<permission name="read"/>
4+
</permissions>
5+
<dependencies>
6+
<dependency path="ldk.context"/>
7+
<dependency path="internal/jQuery"/>
8+
<dependency path="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"/>
9+
<dependency path="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css"/>
10+
</dependencies>
11+
</view>

mGAP/resources/web/mGAP/Utils.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,24 @@ mGAP.Utils = (function($){
227227
var ctx = LABKEY.getModuleContext('mgap') || {};
228228

229229
return ctx['mgapReleaseVersion'];
230+
},
231+
232+
showVideoDialog: function(videoName, title) {
233+
const videoURL = LABKEY.ActionURL.getContextPath() + '/mgap/videos/' + videoName + ".mp4";
234+
235+
$('<div>' +
236+
'<video width="100%" controls>' +
237+
'Your browser does not support the video tag.' +
238+
'<source src="' + videoURL + '" type="video/mp4" />' +
239+
'</video>' +
240+
'</div>').dialog({
241+
width: '60%',
242+
modal: true,
243+
title: title || 'mGAP Help',
244+
close: function(event, ui) {
245+
$(this).remove();
246+
}
247+
});
230248
}
231249
}
232250
})(jQuery);

mGAP/resources/web/mGAP/mgap.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ html {
88
font-size: 14px; !important;
99
}
1010

11-
.mgap-help {
11+
.mgap-video-icon {
1212
cursor: help;
1313
}

0 commit comments

Comments
 (0)