Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dkjang committed Jun 5, 2019
2 parents 4a9d4c7 + a77fe94 commit dac63a2
Show file tree
Hide file tree
Showing 21 changed files with 461 additions and 27 deletions.
7 changes: 4 additions & 3 deletions grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ environments {

// grails.serverURL = "http://demo52k.us-east-1.elasticbeanstalk.com"
// grails.serverURL = "http://ci-env.elasticbeanstalk.com"
// grails.serverURL = "http://type2diabetes-dev.elasticbeanstalk.com"
grails.serverURL = "http://type2diabetes-dev.elasticbeanstalk.com"

grails.serverURL = "http://type2diabetesgen-qasrvr.elasticbeanstalk.com"
// grails.serverURL = "http://type2diabetesgen-qasrvr.elasticbeanstalk.com"


// grails.serverURL = "http://ec2-54-175-211-21.compute-1.amazonaws.com/" // temp for now, will house new prdsrv1 URL
Expand Down Expand Up @@ -465,6 +465,7 @@ grails.plugin.springsecurity.interceptUrlMap = [
'/variant/**': ['ROLE_USER'],
'/variantInfo/**': ['ROLE_USER'],
'/grs/**': ['ROLE_USER'],
'/gait/**': ['ROLE_USER'],
'/variantSearch/retrieveGwasSpecificPhenotypesAjax': ['permitAll'],
'/variantSearch/**': ['ROLE_USER'],
'/beacon/*': ['permitAll'],
Expand Down Expand Up @@ -974,4 +975,4 @@ portal.data.versionDesignator = [ new PortalVersionBean("t2d", // label for




// Here the secret authentication strings
7 changes: 7 additions & 0 deletions grails-app/conf/portalResources.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ modules = {
resource url: 'css/dport/grsInfo.css'
}

gaitInfo {
dependsOn "core", "mbar", "bootstrapMultiselect", "burdenTest","boxwhisker"

resource url: 'js/lib/dport/gaitInfo.js'
resource url: 'css/dport/grsInfo.css'
}

regionInfo {
resource url: 'js/lib/dport/regionInfo.js'
resource url: 'css/dport/regionInfo.css'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package org.broadinstitute.mpg


import groovy.json.JsonSlurper
import org.broadinstitute.mpg.diabetes.util.PortalConstants
import org.broadinstitute.mpg.meta.UserQueryContext
import org.codehaus.groovy.grails.web.json.JSONObject

class GaitController {
RestServerService restServerService
WidgetService widgetService

def index() {
forward gaitInfo()
}

def gaitInfo(){
String uncharacterizedString = params.id
UserQueryContext userQueryContext = widgetService.generateUserQueryContext(uncharacterizedString)
if (userQueryContext.gene){
render (view: 'gaitInfo', model:[geneName: userQueryContext.originalRequest,allowExperimentChoice: false, allowPhenotypeChoice: true, allowStratificationChoice: true ])
}
if (userQueryContext.variant){
render (view: 'gaitInfo', model:[variantIdentifier: userQueryContext.originalRequest, variantSetId: userQueryContext.originalRequest,allowExperimentChoice: true, allowPhenotypeChoice: true, allowStratificationChoice: false])
}


}

def getGRSListOfVariantsAjax() {
String grsName = params.grsName

// TODO - eventually create new bean to hold all the options and have smarts for double checking validity
List <String> variantList = restServerService.getGrsVariants()//grsName should be passed in

if (variantList == null) {
render(status: 200, contentType: "application/json"){variantInfo:{results:[]}}
return
}

StringBuilder sb = new StringBuilder()
List <String> recordPerVariants = []
for (String varId in variantList){
List <String> idPieces = varId.split("_")
recordPerVariants << "{\"d\":1,\"dataset\":1,\"pVals\":[{\"count\":\"${idPieces[0]}\",\"level\":\"CHROM\"},"+
"{\"count\":\"${idPieces[1]}\",\"level\":\"POS\"},"+
"{\"count\":\"${idPieces[2]}\",\"level\":\"Reference_Allele\"},"+
"{\"count\":\"${varId}\",\"level\":\"VAR_ID\"},"+
"{\"count\":\"${idPieces[3]}\",\"level\":\"Effect_Allele\"}]}".toString()
}

JsonSlurper slurper = new JsonSlurper()
String codedVariantList = """{"results":[${recordPerVariants.join(",")}]}""".toString()
JSONObject sampleCallSpecifics = slurper.parseText(codedVariantList)

// send json response back
render(status: 200, contentType: "application/json") {sampleCallSpecifics}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class GrsController {
render (view: 'grsInfo', model:[])
}

def gaitInfo(){
render (view: 'gaitInfo', model:[])
}

def getGRSListOfVariantsAjax() {
String grsName = params.grsName

Expand Down
18 changes: 12 additions & 6 deletions grails-app/i18n/informational.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ informational.dataSubmission.section4=<li>See your data in the context of hundre
Analysis Team at the AMP Data Coordinating Center (AMP-DCC).</li><li>Get access \
to cutting edge analysis tools that can be used for your research.</li><li>Share your data with the wider diabetes research community.</li>
informational.dataSubmission.section5title=What if your data can’t come to the United States?
informational.dataSubmission.section5=<li>A Federated Node at EMBL-EBI will allow data to be stored there and be accessed by the Portal. In the future, we plan to \
informational.dataSubmission.section5=<li>A Federated Node at EMBL-EBI stores data for secure access via the Portal. In the future, we plan to \
release technology that will support additional federated nodes in other locations.</li>
informational.dataSubmission.section5atitle=Is funding available for projects to generate new data for the Portal?
informational.dataSubmission.section5a=<li>Yes! The Foundation for the NIH offers funding opportunities. <a href="http://fnih.org/what-we-do/current-research-programs/amp-t2d-project" target="_blank"> \
Expand All @@ -1541,11 +1541,13 @@ informational.dataSubmission.section6=Find complete information on data submissi
<a href="https://s3.amazonaws.com/broad-portal-resources/AMP_T2DKP_Submitter_Guide.pdf" target="_blank">AMP T2D Knowledge Portal Submitter and Analysis \
Guide for Data at the DCC</a>.
informational.dataSubmission.section7header=Data Submission
informational.dataSubmission.section7=contact our data intake team at: <br><a href="mailto:[email protected]">[email protected]</a>
informational.dataSubmission.section7=Submit data using our <a href="http://www.kp4cd.org/dataintake" target="_blank">Data Intake Tracker</a>
informational.dataSubmission.section7aheader=Data Submission Help
informational.dataSubmission.section7a=Contact our data intake team at: <br><a href="mailto:[email protected]">[email protected]</a>
informational.dataSubmission.section8header=General Questions
informational.dataSubmission.section8=contact us at: <br><a href="mailto:[email protected]">[email protected]</a>
informational.dataSubmission.section8=Contact us at: <br><a href="mailto:[email protected]">[email protected]</a>
informational.dataSubmission.section9title=What compliance/regulatory documents are needed to submit my data to the AMP T2D Knowledge Portal?
informational.dataSubmission.section9=<li>In order to include your data in the AMP T2D Knowledge Portal, you will need to obtain permission from your institution's your IRB review \
informational.dataSubmission.section9=<li>In order to include your data in the AMP T2D Knowledge Portal, you will need to obtain permission from your institution's IRB review \
board (or your country's equivalent) to share the data with us and make summary level metrics available on the Portal.</li><li>We also ask that you sign a \
<a href="https://s3.amazonaws.com/broad-portal-resources/AMP-T2D_DTA_and_policies.pdf" target="_blank">Data Transfer Agreement</a>.</li>
informational.about_t2d.title=About the Accelerating Medicines Partnership and the Type 2 Diabetes Knowledge Portal project
Expand Down Expand Up @@ -2717,8 +2719,12 @@ informational.modules.LDClumping.description2=LD (linkage disequilibrium) clumpi
informational.modules.VariantFinder.title=Variant Finder
informational.modules.VariantFinder.description=<p>This versatile tool lets you specify multiple search criteria to find genetic variants \
whose associations meet those criteria.
informational.modules.GAIT.title=GAIT
informational.modules.GAIT.description=<p>The Genetic Association Interactive Tool allows you to compute custom association statistics by specifying the phenotype to test for association, a subset of samples to analyze based on specific phenotypic criteria, and a set of covariates to control for in the analysis. In order to protect patient privacy, GAIT will only allow visualization or analysis of data from more than 100 individuals.</p><div style="float: left; margin-top: 5px;" class="btn dk-t2d-green dk-reference-button dk-right-column-buttons-compact "><a href="https://s3.amazonaws.com/broad-portal-resources/tutorials/KP_GAIT_guide.pdf" target="_blank">GAIT guide</a></div>
informational.modules.GAIT.title=Custom Association Analysis
informational.modules.geneGAIT.title=Gene GAIT
informational.modules.GAIT.description=<p>Custom association analysis, powered by the Genetic Association Interactive Tool (GAIT) software, \
allows you to filter samples and specify other parameters before running real-time association analysis. Enter a variant ID to perform \
single-variant analysis, or a gene name to perform a gene burden test. In order to protect patient privacy, visualization or analysis of data \
from fewer than 100 individuals is not supported.</p>
informational.modules.GRS.title=Genetic Risk Score
informational.modules.GRS.description=The Genetic Risk Score (GRS) tool takes a defined set of T2D risk-associated variants and allows you \
to calculate the p-value for association of this set with different phenotypes, potentially revealing genetic relationships between phenotypes.
Expand Down
2 changes: 2 additions & 0 deletions grails-app/i18n/portalHome.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ portal.header.nav.blog=blog
portal.header.nav.login=log in
portal.header.nav.downloads=downloads
portal.header.nav.grs=Genetic Risk Score
portal.header.nav.geneGait=Custom burden test
portal.header.nav.variantGait=Genetic Association Interactive Tool
portal.header.data_portal=Data portal
portal.header.tagline=Providing data and tools to promote understanding and treatment of type 2 diabetes and its complications
portal.home.collaborate=Click here to learn more
Expand Down
152 changes: 152 additions & 0 deletions grails-app/views/gait/gaitInfo.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<%--
Created by IntelliJ IDEA.
User: psingh
Date: 5/21/19
Time: 1:44 AM
--%>

<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="t2dGenesCore"/>
<r:require modules="core"/>
<r:require modules="datatables"/>
<r:require modules="gaitInfo"/>
<r:require modules="geneInfo"/>
<r:require modules="burdenTest"/>
<r:layoutResources/>


<link type="application/font-woff">
<link type="application/vnd.ms-fontobject">
<link type="application/x-font-ttf">
<link type="font/opentype">

</head>

<body>

<div id="rSpinner" class="dk-loading-wheel center-block" style="display:none">
<img src="${resource(dir: 'images', file: 'ajax-loader.gif')}" alt="Loading"/>
</div>
<script>
$( document ).ready(function() {
"use strict";
var drivingVariables = {
geneName: "${geneName}",
variantIdentifier: "${variantIdentifier}",
allowExperimentChoice:"${allowExperimentChoice}",
allowPhenotypeChoice:"${allowPhenotypeChoice}",
allowStratificationChoice:"${allowStratificationChoice}"
};
mpgSoftware.gaitInfo.setGaitInfoData(drivingVariables);
mpgSoftware.gaitInfo.buildGaitDisplay();
var pageTitle = $(".accordion-toggle").find("h2").text();
var textUnderTitle = $(".accordion-inner").find("h5").text();
$(".accordion-toggle").remove();
$(".accordion-inner").find("h5").remove();
var PageTitleDiv = '<div class="row">\n'+
'<div class="col-md-12">\n'+
'<h1 class="dk-page-title">' + pageTitle + '</h1>\n'+
'<div class="col-md-12">\n'+
'<h5 class="dk-under-header">' + textUnderTitle + '</h5>\n'+
'</div></div>';
$(PageTitleDiv).insertBefore(".gene-info-container");
$(".user-interaction").addClass("col-md-12");
/* end of DK's script */
});
</script>

<style>
ul.nav-tabs > li > a { background: none !important; }
ul.nav-tabs > li.active > a { background-color: #fff !important; }
#modeledPhenotypeTabs li.active > a { background-color: #9fd3df !important; }
</style>

<div id="main">

<div class="container">

<div class="gene-info-container row">

<h3><em style="font-weight: 900;"><%=geneName%></em></h3>


<h3><em style="font-weight: 900;"><%=variantIdentifier%></em></h3>


%{--If its gene Gait page then allowExperimentChoice = 0 and 'geneName':'geneName'--}%
%{--<g:if test="${geneName?.equals('')}">--}%

%{--<g:render template="/templates/burdenTestSharedTemplate" model="['variantIdentifier': variantIdentifier, 'accordionHeaderClass': 'accordion-heading']" />--}%

%{--<g:render template="/widgets/burdenTestShared" model="['variantIdentifier': variantIdentifier,--}%
%{--'accordionHeaderClass': 'accordion-heading',--}%
%{--'modifiedTitle': 'Variant Interactive burden test',--}%
%{--'modifiedGaitSummary': 'The Genetic Association Interactive Tool (GAIT) allows you to compute the disease or phenotype burden for this gene, using custom sets of variants, samples, and covariates. In order to protect patient privacy, GAIT will only allow visualization or analysis of data from more than 100 individuals.',--}%
%{--'allowExperimentChoice': 1,--}%
%{--'allowPhenotypeChoice': 1,--}%
%{--'allowStratificationChoice': 0,--}%
%{--'grsVariantSet':'',--}%
%{--'geneName':'']"/>--}%
%{--</g:if>--}%

%{--<g:else>--}%
%{--<g:render template="/templates/burdenTestSharedTemplate" model="['variantIdentifier': '', 'accordionHeaderClass': 'accordion-heading']" />--}%

%{--<g:render template="/widgets/burdenTestShared" model="['variantIdentifier': '',--}%
%{--'accordionHeaderClass': 'accordion-heading',--}%
%{--'modifiedTitle': 'Gene Interactive burden test',--}%
%{--'modifiedGaitSummary': 'The Genetic Association Interactive Tool (GAIT) allows you to compute the disease or phenotype burden for this gene, using custom sets of variants, samples, and covariates. In order to protect patient privacy, GAIT will only allow visualization or analysis of data from more than 100 individuals.',--}%
%{--'allowExperimentChoice': 1,--}%
%{--'allowPhenotypeChoice': 1,--}%
%{--'allowStratificationChoice': 1,--}%
%{--'grsVariantSet':'',--}%
%{--'geneName':geneName]"/>--}%

%{--</g:else>--}%


<g:render template="/templates/burdenTestSharedTemplate" model="['variantIdentifier': variantIdentifier, 'accordionHeaderClass': 'accordion-heading']" />



%{--If its gene Gait page then allowExperimentChoice = 0 and 'geneName':'geneName'--}%
<g:render template="/widgets/burdenTestShared" model="['variantIdentifier': '',
'accordionHeaderClass': 'accordion-heading',
'modifiedTitle': 'Custom Association Analysis',
'modifiedGaitSummary': 'This interface allows you to perform single-variant association analysis or a gene-level burden test using custom parameters. Results for the T2D phenotype are powered by the AMP T2D-GENES exome sequence analysis dataset; results for other traits are powered by the 19k exome sequence analysis subset. In order to protect patient privacy, visualization or analysis of data from fewer than 100 individuals is not supported.',
'allowExperimentChoice': allowExperimentChoice,
'allowPhenotypeChoice': allowPhenotypeChoice,
'allowStratificationChoice': allowStratificationChoice,
'grsVariantSet':'',
'geneName':geneName]"/>







</div>
</div>

</div>

</body>
</html>

6 changes: 5 additions & 1 deletion grails-app/views/gene/geneEffectorTable.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,13 @@
</div>
</div>

<h5><a data-toggle="collapse" href="#graphicsDiv" aria-expanded="false" aria-controls="collapseExample" style="font-size: 0.8em;">View / hide graphic</a></h5>
<!--<h5><a data-toggle="collapse" href="#graphicsDiv" aria-expanded="false" aria-controls="collapseExample" style="font-size: 0.8em;">View / hide graphic</a></h5>-->
<div class="col-md-12" style="border-bottom:solid 1px #ddd; margin-top: -25px; margin-bottom: 20px; padding-left: 0;">
<div class="btn dk-t2d-green dk-reference-button dk-right-column-buttons-compact"><a data-toggle="collapse" href="#graphicsDiv" aria-expanded="false" aria-controls="collapseExample" style="font-size: 0.8em;">View / hide graphic</a></div>
</div>
<div class="row collapse in" id="graphicsDiv">


<div class="col-md-5">
<p><g:message code="effectorTable.interface.help1"></g:message></p>
<p><g:message code="effectorTable.interface.help2"></g:message></p>
Expand Down
1 change: 1 addition & 0 deletions grails-app/views/gene/geneInfo.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
data: {geneName: '${geneName}'},
async: true
}).done(function (data) {
console.log(geneName);
mpgSoftware.geneInfo.fillTheGeneFields(data); // fills the uniprot summary
$('[data-toggle="popover"]').popover({
animation: true,
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/home/portalHome.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@

<div>
<div style="min-width: 500px; margin-top:30px;">
<h3><img src="${resource(dir: 'images', file: 'kpn_logo.svg')}" style="width: 120px;" align="left"><span style="display: inline-block; font-weight:400; font-size:35px; font-family:'Oswald'; margin: 2px 0 0 10px; padding: 0px 5px 2px 5px; border: solid 1px #00b1f0; border-right: none; border-left: none;">Knowledge Portal Network</span></h3>
<h3><a href="http://www.kp4cd.org/" target="_blank"><img src="${resource(dir: 'images', file: 'kpn_logo.svg')}" style="width: 120px;" align="left"><span style="display: inline-block; font-weight:400; font-size:35px; font-family:'Oswald'; margin: 2px 0 0 10px; padding: 0px 5px 2px 5px; border: solid 1px #00b1f0; border-right: none; border-left: none;">Knowledge Portal Network</span></a></h3>
<p style="font-size: 16px;"><g:message code="portal.home.about.KPN"></g:message></p>
</div>

Expand Down
Loading

0 comments on commit dac63a2

Please sign in to comment.