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 @@ -11,16 +11,12 @@
import org.labkey.test.categories.External;
import org.labkey.test.categories.LabModule;
import org.labkey.test.components.ext4.Window;
import org.labkey.test.util.DataRegion;
import org.labkey.test.util.DataRegionTable;
import org.labkey.test.util.Ext4Helper;
import org.labkey.test.util.LogMethod;
import org.labkey.test.util.LoggedParam;
import org.labkey.test.util.ext4cmp.Ext4ComboRef;
import org.labkey.test.util.ext4cmp.Ext4FieldRef;
import org.labkey.test.util.ext4cmp.Ext4GridRef;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;

import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -98,7 +94,26 @@ public void testLabPurchasingModule()

// Adding the new vendor should have updated the combo:
grid.clickTbarButton("Add New");
checker().withScreenshot("LabPurchasingBeforeVendor");
grid.setGridCell(1, "vendorId", "New Vendor 1");
try
{
Assert.assertTrue("Missing vendor cell", isElementPresent(Ext4GridRef.locateExt4GridCell("New Vendor 1")));
}
catch (AssertionError e)
{
checker().withScreenshot("LabPurchasingVendor0");
WebElement el = grid.startEditing(1, "vendorId");
checker().withScreenshot("LabPurchasingVendor1");

setFormElementJS(el, "");
el.sendKeys("New Vendor 1");
sleep(1000);

checker().withScreenshot("LabPurchasingVendor2");

throw e;
}

// Try to save, expect error:
click(Ext4Helper.Locators.ext4Button("Order Items"));
Expand Down
3 changes: 2 additions & 1 deletion mGAP/resources/etls/prime-seq.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@
</columnTransforms>
</destination>
</transform>

<transform id="step5" type="RemoteQueryTransformStep">
<description>Copy to local table</description>
<source schemaName="mGAP" queryName="variantList" remoteSource="PRIMESEQ">
<source schemaName="mGAP" queryName="variantList" remoteSource="PRIMESEQ" sourceTimeout="0">
<sourceColumns>
<column>releaseId</column>
<column>contig</column>
Expand Down
23 changes: 23 additions & 0 deletions mGAP/resources/queries/mGAP/releaseTracks/.qview.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="rowid"/>
<column name="trackName"/>
<column name="label"/>
<column name="source"/>
<column name="category"/>
<column name="url"/>
<column name="vcfId"/>
<column name="description"/>
<column name="isprimarytrack"/>
<column name="mergepriority"/>
<column name="skipvalidation"/>
<column name="vcfId/container/Name">
<properties>
<property name="columnTitle" value="Workbook"/>
</properties>
</column>
</columns>
<sorts>
<sort column="trackName" descending="false"/>
</sorts>
</customView>
5 changes: 2 additions & 3 deletions mGAP/resources/schemas/mgap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,7 @@
<datatype>lsidtype</datatype>
<isReadOnly>true</isReadOnly>
<isHidden>true</isHidden>
<isUserEditable>false</isUserEditable>
<isUnselectable>true</isUnselectable>
<isUserEditable>false</isUserEditable>
<fk>
<fkColumnName>ObjectUri</fkColumnName>
<fkTable>Object</fkTable>
Expand Down Expand Up @@ -1141,4 +1140,4 @@
</column>
</columns>
</table>
</tables>
</tables>
27 changes: 10 additions & 17 deletions mGAP/src/org/labkey/mgap/pipeline/GenerateMgapTracksStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ public static class Provider extends AbstractVariantProcessingStepProvider<Gener
public Provider()
{
super("GenerateMgapTracksStep", "Generate mGAP Tracks", "GenerateMgapTracksStep", "This will use the set of sample IDs from the table mgap.releaseTrackSubsets to subset the input VCF and produce one VCF per track. It will perform basic validation and also update mgap.releaseTracks.", Arrays.asList(
ToolParameterDescriptor.create("releaseVersion", "mGAP Version", "This is the string that was used to annotate novel variants.", "textfield", new JSONObject(){{
ToolParameterDescriptor.create("releaseVersion", "mGAP Version", "This is the string that was used to annotate novel variants.", "ldk-numberfield", new JSONObject(){{
put("allowBlank", false);
put("decimalPrecision", 1);
put("doNotIncludeInTemplates", true);
}}, null)
), null, null);
Expand Down Expand Up @@ -174,17 +175,7 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
}

// Also create the Novel Sites track:
String releaseVersion = getProvider().getParameterByName("releaseVersion").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), String.class);
if (releaseVersion.toLowerCase().startsWith("v"))
{
releaseVersion = releaseVersion.substring(1);
}

if (!NumberUtils.isCreatable(releaseVersion))
{
throw new IllegalArgumentException("Expected the release version to be numeric: " + releaseVersion);
}

Double releaseVersion = getProvider().getParameterByName("releaseVersion").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Double.class);
File novelSitesOutput = new File(outputDirectory, "mGAP_v" + releaseVersion + "_NovelSites.vcf.gz");
if (new File(novelSitesOutput.getPath() + ".tbi").exists())
{
Expand Down Expand Up @@ -240,10 +231,10 @@ private void createOrUpdateTrack(SequenceOutputFile so, PipelineJob job, String
{
Container targetContainer = job.getContainer().isWorkbook() ? job.getContainer().getParent() : job.getContainer();
TableInfo releaseTracks = QueryService.get().getUserSchema(job.getUser(), targetContainer, mGAPSchema.NAME).getTable(mGAPSchema.TABLE_RELEASE_TRACKS);
TableSelector ts = new TableSelector(releaseTracks, PageFlowUtil.set("rowid"), new SimpleFilter(FieldKey.fromString("trackName"), so.getName()), null);
TableSelector ts = new TableSelector(releaseTracks, PageFlowUtil.set("rowid"), new SimpleFilter(FieldKey.fromString("trackName"), trackName), null);
if (!ts.exists())
{
job.getLogger().debug("Creating new track: " + so.getName());
job.getLogger().debug("Creating new track: " + trackName + " / " + so.getName());
Map<String, Object> newRow = new CaseInsensitiveHashMap<>();
newRow.put("trackName", trackName);
newRow.put("label", trackName);
Expand All @@ -259,13 +250,15 @@ private void createOrUpdateTrack(SequenceOutputFile so, PipelineJob job, String
}
else
{
job.getLogger().debug("Updating existing track: " + so.getName());
int rowId = ts.getObject(Integer.class);
job.getLogger().debug("Updating existing track: " + so.getName() + " / " + rowId);

Map<String, Object> toUpdate = new CaseInsensitiveHashMap<>();
toUpdate.put("rowId", ts.getObject(Integer.class));
toUpdate.put("rowId", rowId);
toUpdate.put("vcfId", so.getRowid());

Map<String, Object> oldKeys = new CaseInsensitiveHashMap<>();
toUpdate.put("rowId", ts.getObject(Integer.class));
oldKeys.put("rowId", rowId);

releaseTracks.getUpdateService().updateRows(job.getUser(), targetContainer, Arrays.asList(toUpdate), Arrays.asList(oldKeys), null, null);
}
Expand Down
4 changes: 3 additions & 1 deletion mGAP/src/org/labkey/mgap/pipeline/mGapReleaseGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ public class mGapReleaseGenerator extends AbstractParameterizedOutputHandler<Seq
public mGapReleaseGenerator()
{
super(ModuleLoader.getInstance().getModule(mGAPModule.class), "Create mGAP Release", "This will prepare an input VCF for use as an mGAP public release. This will optionally include: removing excess annotations and program records, limiting to SNVs (optional) and removing genotype data (optional). If genotypes are retained, the subject names will be checked for mGAP aliases and replaced as needed.", new LinkedHashSet<>(PageFlowUtil.set("sequenceanalysis/field/GenomeFileSelectorField.js")), Arrays.asList(
ToolParameterDescriptor.create("releaseVersion", "Version", "This string will be used as the version when published.", "textfield", new JSONObject(){{
ToolParameterDescriptor.create("releaseVersion", "Version", "This value will be used as the version when published.", "ldk-numberfield", new JSONObject(){{
put("allowBlank", false);
put("decimalPrecision", 1);
put("doNotIncludeInTemplates", true);
}}, null),
ToolParameterDescriptor.createExpDataParam("gtfFile", "GTF File", "The gene file used to create these annotations.", "sequenceanalysis-genomefileselectorfield", new JSONObject()
{{
Expand Down
7 changes: 1 addition & 6 deletions mcc/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mcc/resources/etls/snprc-datasets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<transforms>
<transform type="RemoteQueryTransformStep" id="demographics">
<description>Copy to target</description>
<source remoteSource="SNPRC" schemaName="study" queryName="Demographics">
<source remoteSource="SNPRC" schemaName="study" queryName="Demographics" sourceTimeout="0">
<sourceColumns>
<column>AnimalId</column>
<column>date</column>
Expand Down
29 changes: 29 additions & 0 deletions mcc/resources/queries/mcc/aggregatedDemographics.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="" tableDbType="TABLE">
<tableTitle>MCC Aggregated Demographics</tableTitle>
<columns>
<column columnName="Id">
<columnTitle>MCC ID</columnTitle>
</column>
<column columnName="originalId">
<columnTitle>Center Id</columnTitle>
</column>
<column columnName="dam">
<columnTitle>Dam MCC Id</columnTitle>
</column>
<column columnName="originalDam">
<columnTitle>Dam Center Id</columnTitle>
</column>
<column columnName="originalSire">
<columnTitle>Sire Center Id</columnTitle>
</column>
<column columnName="sire">
<columnTitle>Sire MCC Id</columnTitle>
</column>
</columns>
</table>
</tables>
</metadata>
</query>
8 changes: 8 additions & 0 deletions mcc/resources/queries/mcc/aggregatedDemographics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SELECT
d.birth,
d.death,
d.colony,
d.source,
d.damMccAlias.externalAlias as dam,
d.sireMccAlias.externalAlias as sire,
d.dam as originalDam,
Expand All @@ -18,6 +19,7 @@ SELECT
WHEN d.calculated_status = 'Alive' AND (SELECT COUNT(f.flag.value) as total FROM "/data/Colonies/SNPRC/".study.flags f WHERE f.Id = d.Id AND f.isActive = true) > 0 THEN true
ELSE false
END as u24_status,
d.Id.mostRecentDeparture.mostRecentDeparture,
o.availability,
o.current_housing_status,
o.infant_history,
Expand Down Expand Up @@ -50,6 +52,7 @@ SELECT
d.birth,
d.death,
d.colony,
d.source,
d.damMccAlias.externalAlias as dam,
d.sireMccAlias.externalAlias as sire,
d.dam as originalDam,
Expand All @@ -61,6 +64,7 @@ SELECT
WHEN d.calculated_status = 'Alive' AND (SELECT COUNT(f.flag.value) as total FROM "/data/Colonies/WNPRC/".study.flags f WHERE f.Id = d.Id AND f.isActive = true) > 0 THEN true
ELSE false
END as u24_status,
d.Id.mostRecentDeparture.mostRecentDeparture,
o.availability,
o.current_housing_status,
o.infant_history,
Expand Down Expand Up @@ -93,6 +97,7 @@ SELECT
d.birth,
d.death,
d.colony,
d.source,
d.damMccAlias.externalAlias as dam,
d.sireMccAlias.externalAlias as sire,
d.dam as originalDam,
Expand All @@ -101,6 +106,7 @@ SELECT
d.objectid,
d.calculated_status,
d.u24_status,
d.Id.mostRecentDeparture.mostRecentDeparture,
o.availability,
o.current_housing_status,
o.infant_history,
Expand Down Expand Up @@ -133,6 +139,7 @@ SELECT
d.birth,
d.death,
d.colony,
d.source,
d.damMccAlias.externalAlias as dam,
d.sireMccAlias.externalAlias as sire,
d.dam as originalDam,
Expand All @@ -141,6 +148,7 @@ SELECT
d.objectid,
d.calculated_status,
d.u24_status,
d.Id.mostRecentDeparture.mostRecentDeparture,
o.availability,
o.current_housing_status,
o.infant_history,
Expand Down
29 changes: 29 additions & 0 deletions mcc/resources/queries/mcc/aggregatedDemographics/.qview.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView" canOverride="false">
<columns>
<column name="Id"/>
<column name="originalId"/>
<column name="species"/>
<column name="gender"/>
<column name="birth"/>
<column name="death"/>
<column name="colony"/>
<column name="source"/>
<column name="dam"/>
<column name="originalDam"/>
<column name="sire"/>
<column name="originalSire"/>
<column name="mostRecentWeight"/>
<column name="calculated_status"/>
<column name="u24_status"/>
<column name="mostRecentDeparture"/>
<column name="availability"/>
<column name="current_housing_status"/>
<column name="infant_history"/>
<column name="fertility_status"/>
<column name="medical_history"/>
<column name="date_of_observations"/>
</columns>
<sorts>
<sort column="Id" descending="true"/>
</sorts>
</customView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView" canOverride="false" label="MCC Transfers">
<columns>
<column name="Id"/>
<column name="originalId"/>
<column name="species"/>
<column name="colony"/>
<column name="mostRecentDeparture"/>
<column name="source"/>
<column name="gender"/>
<column name="birth"/>
<column name="death"/>
<column name="mostRecentWeight"/>
<column name="calculated_status"/>
<column name="u24_status"/>
<column name="date_of_observations"/>
<column name="medical_history"/>
<column name="availability"/>
<column name="current_housing_status"/>
<column name="infant_history"/>
<column name="fertility_status"/>
</columns>
<sorts>
<sort column="Id" descending="true"/>
</sorts>
<filters>
<filter column="mostRecentDeparture" operator="isnonblank" value=""/>
<filter column="source" operator="isnonblank" value=""/>
</filters>
</customView>
5 changes: 3 additions & 2 deletions mcc/resources/queries/mcc/animalRequests.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ function calculatePreliminaryScore(row, oldRow) {
console.error('Unknown MCC institutiontype: ' + row.institutiontype)
}

if (['nih', 'other-federal', 'start-up', 'foundation'].indexOf(row.fundingsource) !== -1) {
var fs = row.fundingsource ? row.fundingsource.split(',') : []
if (fs.indexOf('nih') !== -1 || fs.indexOf('other-federal') !== -1 || fs.indexOf('start-up') !== -1 || fs.indexOf('foundation') !== -1) {
score += 1;
}
else if (row.fundingsource === 'private' || row.fundingsource === 'no-funding') {
else if (fs.indexOf('private') !== -1 || fs.indexOf('no-funding') !== -1) {
// no score change
}
else {
Expand Down
2 changes: 2 additions & 0 deletions mcc/resources/queries/mcc/animalRequests/Non-Draft.qview.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView" canOverride="false">
<filters>
<filter column="status" operator="neqornull" value="draft" />
<filter column="status" operator="neqornull" value="withdrawn" />
<filter column="status" operator="neqornull" value="fulfilled" />
</filters>
<sorts>
<sort column="rowid" descending="true"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView" label="Pending Requests" canOverride="false">
<filters>
<filter column="requestId/status" operator="neqornull" value="Approved"/>
<filter column="requestId/status" operator="neqornull" value="Withdrawn"/>
<filter column="requestId/status" operator="neqornull" value="Fulfilled"/>
</filters>
<sorts>
<sort column="requestId/rowid" descending="true"/>
Expand Down
Loading