Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@
import org.labkey.api.action.ApiSimpleResponse;
import org.labkey.api.action.MutatingApiAction;
import org.labkey.api.action.SpringActionController;
import org.labkey.api.data.ContainerFilter;
import org.labkey.api.data.ContainerManager;
import org.labkey.api.data.ContainerType;
import org.labkey.api.exp.api.ExpProtocol;
import org.labkey.api.exp.api.ExperimentService;
import org.labkey.api.security.RequiresPermission;
import org.labkey.api.security.permissions.ReadPermission;
import org.labkey.api.security.permissions.UpdatePermission;
import org.labkey.api.util.Pair;
import org.springframework.validation.BindException;
Expand Down Expand Up @@ -64,7 +67,7 @@ public ApiResponse execute(CacheAnalysesForm form, BindException errors)
return null;
}

if (!protocol.getContainer().getContainerFor(ContainerType.DataType.tabParent).equals(getContainer().getContainerFor(ContainerType.DataType.tabParent)))
if (!new ContainerFilter.CurrentAndSubfoldersPlusShared(getContainer().getContainerFor(ContainerType.DataType.tabParent), getUser()).generateIds(getContainer().getContainerFor(ContainerType.DataType.tabParent), ReadPermission.class, getViewContext().getContextualRoles()).contains(protocol.getContainer().getEntityId()))
{
errors.reject(ERROR_MSG, "Protocol is from the wrong container: " + form.getProtocolId());
logger.error("CacheAnalysesAction targeted a protocol from the wrong container: {}, from {}, in the container: {}", form.getProtocolId(), protocol.getContainer().getPath(), getContainer().getPath());
Expand Down Expand Up @@ -151,7 +154,7 @@ public ApiResponse execute(CacheAnalysesForm form, BindException errors)
return null;
}

if (!protocol.getContainer().getContainerFor(ContainerType.DataType.tabParent).equals(getContainer().getContainerFor(ContainerType.DataType.tabParent)))
if (!new ContainerFilter.CurrentAndSubfoldersPlusShared(getContainer().getContainerFor(ContainerType.DataType.tabParent), getUser()).generateIds(getContainer().getContainerFor(ContainerType.DataType.tabParent), ReadPermission.class, getViewContext().getContextualRoles()).contains(protocol.getContainer().getEntityId()))
{
errors.reject(ERROR_MSG, "Protocol is from the wrong container: " + form.getProtocolId());
logger.error("CacheHaplotypesAction targeted a protocol from the wrong container: {}, from {}, in the container: {}", form.getProtocolId(), protocol.getContainer().getPath(), getContainer().getPath());
Expand Down
9 changes: 5 additions & 4 deletions PMR/test/src/org/labkey/test/tests/pmr/PMRTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.labkey.api.util.FileUtil;
import org.labkey.remoteapi.query.SelectRowsCommand;
import org.labkey.remoteapi.query.TruncateTableCommand;
import org.labkey.serverapi.reader.Readers;
Expand Down Expand Up @@ -62,13 +63,13 @@ protected void doCleanup(boolean afterTest) throws TestTimeoutException
@BeforeClass
public static void setupProject() throws Exception
{
PMRTest init = (PMRTest)getCurrentTest();
PMRTest init = getCurrentTest();
init.doSetup();
}

private File getKinshipPath()
{
return new File(TestFileUtils.getDefaultFileRoot(getProjectName()), "kinshipEtlDir");
return FileUtil.appendName(TestFileUtils.getDefaultFileRoot(getProjectName()), "kinshipEtlDir");
}

private void doSetup()
Expand Down Expand Up @@ -143,7 +144,7 @@ private void testKinshipEtl() throws Exception

// Verify data imported, and then delete from the DB
SelectRowsCommand select1 = new SelectRowsCommand("ehr", "kinship");
Assert.assertEquals("Incorrect number of kinship rows", 136, select1.execute(getApiHelper().getConnection(), getProjectName()).getRowCount().intValue());
Assert.assertEquals("Incorrect number of kinship rows", 104, select1.execute(getApiHelper().getConnection(), getProjectName()).getRowCount().intValue());

new TruncateTableCommand("ehr", "kinship").execute(getApiHelper().getConnection(), getProjectName());
Assert.assertEquals("Incorrect number of kinship rows", 0, select1.execute(getApiHelper().getConnection(), getProjectName()).getRowCount().intValue());
Expand All @@ -153,7 +154,7 @@ private void testKinshipEtl() throws Exception
goToDataPipeline();
waitForPipelineJobsToComplete(4, "ETL Job: Import PRIMe-seq Kinship Data", false);

Assert.assertEquals("Incorrect number of kinship rows after ETL", 136, select1.execute(getApiHelper().getConnection(), getProjectName()).getRowCount().intValue());
Assert.assertEquals("Incorrect number of kinship rows after ETL", 104, select1.execute(getApiHelper().getConnection(), getProjectName()).getRowCount().intValue());
}

private void createTestPedigreeData() throws Exception
Expand Down
2 changes: 1 addition & 1 deletion SivStudies/resources/etls/siv-studies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<setting name="dataSourceSchema" value="geneticscore"/>
<setting name="dataSourceQuery" value="mhc_data"/>
<setting name="dataSourceSubjectColumn" value="subjectid"/>
<setting name="dataSourceColumns" value="subjectid,created,assaytype,marker,result,score"/>
<setting name="dataSourceColumns" value="subjectid,created,assaytype,marker,result,score,librarytype"/>
<setting name="dataSourceColumnMapping" value="subjectId=Id,created=date"/>
<setting name="dataSourceColumnDefaults" value="category=MHC Typing;dataSource=ONPRC Genetics Core"/>

Expand Down
3 changes: 3 additions & 0 deletions SivStudies/resources/queries/study/genetics.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<column columnName="assayType">
<columnTitle>Assay Type</columnTitle>
</column>
<column columnName="libraryType">
<columnTitle>Library Type</columnTitle>
</column>
<column columnName="marker">
<columnTitle>Marker/Allele</columnTitle>
</column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@
<column columnName="assayType">
<datatype>varchar</datatype>
</column>
<column columnName="libraryType">
<datatype>varchar</datatype>
</column>
<column columnName="marker">
<datatype>varchar</datatype>
</column>
Expand Down
82 changes: 30 additions & 52 deletions mGAP/resources/views/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
}
});
}(jQuery, LABKEY));

$(document).ready(function () {
$('#slideshow').cycle({
fx: 'fade',
pager: '#smallnav',
pause: 1,
speed: 1800,
timeout: 3500
});
});
</script>
<div class="full" id="slideshow">
<img src="<%=contextPath%>/mGAP/welcome/images/102_6203.jpg" class="bgM"/>
Expand All @@ -22,85 +32,53 @@
<img src="<%=contextPath%>/mGAP/welcome/images/102_6416.jpg" class="bgM"/>
</div>
<div>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-bottom" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<a href="#" data-toggle="modal" data-target="#aboutModal">About</a>
<nav class="navbar navbar-expand-lg bg-dark fixed-bottom fs-3 py-2" id="navbar" data-bs-theme="dark">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav mx-auto mb-2 mb-lg-0">
<li class="nav-item mx-lg-3">
<a class="nav-link shadow-none" href="#" data-bs-toggle="modal" data-bs-target="#aboutModal">About</a>
</li>
<li>
<a href="<%=contextPath%>/login-login.view?returnUrl=<%=contextPath%>/project/mGAP/start.view?" id="login-el">Login</a>
<li class="nav-item mx-lg-3">
<a class="nav-link" href="<%=contextPath%>/login-login.view?returnUrl=<%=contextPath%>/project/mGAP/start.view?" id="login-el">Login</a>
</li>
<li>
<a href="<%=contextPath%>/mGAP/requestLogin.view">Request Access</a>
<li class="nav-item mx-lg-3">
<a class="nav-link" href="<%=contextPath%>/mGAP/requestLogin.view">Request Access</a>
</li>
<li>
<a href="<%=contextPath%>/mGap-contact.view?returnUrl=<%=contextPath%>/">Help</a>
<li class="nav-item mx-lg-3">
<a class="nav-link" href="<%=contextPath%>/mGap-contact.view?returnUrl=<%=contextPath%>/">Help</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>

<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-md-6 col-sm-12">
<h1 class="title">mGAP</h1>
<h3 class="title">The Macaque Genotype And Phenotype Resource</h3>
<!--<h5 class="title">Supported By NIH R24OD021324</h5>-->
<div class="row justify-content-md-center mt-5">
<div>
<h1 class="title mx-lg-3">mGAP</h1>
<h3 class="title mx-lg-3">The Macaque Genotype And Phenotype Resource</h3>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container -->

<script type="text/javascript" nonce="<%=scriptNonce%>">
$(document).ready(function () {
$('#slideshow').cycle({
fx: 'fade',
pager: '#smallnav',
pause: 1,
speed: 1800,
timeout: 3500
});
});
</script>
</div>


<!-- Modal -->
<div id="aboutModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div id="aboutModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modalTitle" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">About mGAP</h4>
<h4 class="modal-title" id="modalTitle">About mGAP</h4>
</div>
<div class="modal-body">
The Macaque Genotype and Phenotype Resource (mGAP) provides access to genotype data collected on a large, pedigreed, rhesus macaque colony housed at the Oregon National Primate Research Center (ONPRC). We hope to provide researchers with the tools to explore naturally occurring genetic variation in macaques. Our database of DNA variants is curated and heavily annotated, and can either be viewed through our genome browser or downloaded for external use.
<br><br>
<i>To request an account, please use the 'Request Access' link at the bottom of this page. mGAP is an NIH funded project, supported by R24OD021324.</i>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
Expand Down
12 changes: 5 additions & 7 deletions mGAP/resources/views/welcome.view.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<view xmlns="http://labkey.org/data/xml/view" template="app" frame="none" title="mGAP">
<requiresNoPermission/>
<dependencies>
<dependency path="ldk.context"/>
<dependency path="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"/>
<dependency path="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"/>
<dependency path="mGAP/welcome/css/bootstrap.min.css"/>
<dependency path="clientapi"/>
<dependency path="mGAP/welcome/css/welcome.css"/>
<dependency path="https://code.jquery.com/jquery-3.2.1.min.js"/>
<dependency path="mGAP/welcome/js/jquery.cycle.all.js"/>
<dependency path="mGAP/welcome/js/bootstrap.min.js"/>
<dependency path="https://code.jquery.com/jquery-3.7.1.min.js"/>
<dependency path="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.min.js"/>
<dependency path="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css"/>
<dependency path="mGAP/welcome/js/jquery.cycle2.min.js"/>
</dependencies>
</view>
6 changes: 0 additions & 6 deletions mGAP/resources/web/mGAP/welcome/css/bootstrap.min.css

This file was deleted.

7 changes: 0 additions & 7 deletions mGAP/resources/web/mGAP/welcome/js/bootstrap.min.js

This file was deleted.

Loading
Loading