Skip to content

Commit

Permalink
Merge 24.7 to 24.9
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-teamcity committed Sep 10, 2024
2 parents cb0dfc9 + 444ccf4 commit 53f9e11
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

@Category({Daily.class, Assays.class})
Expand All @@ -43,6 +44,8 @@ public final class LuminexExcludedTitrationTest extends LuminexTest
@Test
public void testTitrationExclusion()
{
int jobCount = executeSelectRowCommand("pipeline", "Job").getRows().size();

ensureMultipleCurveDataPresent(TEST_ASSAY_LUM);

clickAndWait(Locator.linkContainingText(MULTIPLE_CURVE_ASSAY_RUN_NAME));
Expand All @@ -52,19 +55,21 @@ public void testTitrationExclusion()

String titration = "Sample 1";
String exclusionMessage = "excluding all analytes for titration " + titration;
excludeTitration(titration, exclusionMessage, MULTIPLE_CURVE_ASSAY_RUN_NAME, 2);
verifyTitrationExclusion(titration, exclusionMessage);
excludeTitration(titration, exclusionMessage, MULTIPLE_CURVE_ASSAY_RUN_NAME, ++jobCount, 1, 1);
verifyTitrationExclusion(titration, exclusionMessage, 70);

titration = "Sample 2";
String analyte = "ENV6";
exclusionMessage = "excluding " + analyte + " analyte for titration " + titration;
excludeTitration(titration, exclusionMessage, MULTIPLE_CURVE_ASSAY_RUN_NAME, 3, analyte);
verifyTitrationAnalyteExclusion(titration, analyte, exclusionMessage);
excludeTitration(titration, exclusionMessage, MULTIPLE_CURVE_ASSAY_RUN_NAME, ++jobCount, 1, 1, analyte);
verifyTitrationAnalyteExclusion(titration, analyte, exclusionMessage, 12);
}

@Test
public void testCrossPlateTitration()
{
int jobCount = executeSelectRowCommand("pipeline", "Job").getRows().size();

List<File> files = new ArrayList<>();
files.add(TEST_ASSAY_LUM_FILE5);
files.add(TEST_ASSAY_LUM_FILE6);
Expand All @@ -81,28 +86,61 @@ public void testCrossPlateTitration()
table.clickHeaderButton("Import Data");
clickButton("Next");

String runName = "Cross Plate titration";
waitForElement(Locators.panelWebpartTitle.withText("Run Properties"));
setFormElement(Locator.name("name"), "Cross Plate titration");
setFormElement(Locator.name("name"), runName);

uploadAssayFiles(files);
clickButton("Next");

assertTextPresent("Standard1-CrossplateTitration");
String titration = "Standard1-CrossplateTitration";
assertTextPresent(titration);
clickButton("Save and Finish");

// Issue 51084: verify exclusions for a cross plate titration (exclusions applied to all DataIds for the titration)
clickAndWait(Locator.linkContainingText(runName));
String exclusionMessage = "excluding all analytes for titration " + titration;
excludeTitration(titration, exclusionMessage, runName, ++jobCount, 2, 1);

_customizeViewsHelper.openCustomizeViewPanel();
_customizeViewsHelper.addColumn("ExclusionComment");
_customizeViewsHelper.applyCustomView();
verifyTitrationExclusion(titration, exclusionMessage, 12);

titration = "Standard1";
exclusionMessage = "excluding one analyte for titration " + titration;
excludeTitration(titration, exclusionMessage, runName, ++jobCount, 5, 2, "GS Analyte B");
verifyTitrationAnalyteExclusion(titration, "GS Analyte B", exclusionMessage, 50);

clickAndWait(Locator.linkWithText("view excluded data"));
DataRegionTable region = new DataRegionTable("TitrationExclusion", this);
region.setFilter("Description", "Equals", "Standard1-CrossplateTitration");
assertEquals("Expected 2 rows for titration", 2, region.getDataRowCount());
region.setFilter("Analytes", "Contains", "GS Analyte A");
assertEquals("Expected 2 rows for analyte A", 2, region.getDataRowCount());
region.setFilter("Analytes", "Contains", "GS Analyte B");
assertEquals("Expected 2 rows for analyte B", 2, region.getDataRowCount());
region.clearFilter("Analytes");
region.setFilter("Description", "Equals", "Standard1");
assertEquals("Expected 5 rows for titration", 5, region.getDataRowCount());
region.setFilter("Analytes", "Contains", "GS Analyte A");
assertEquals("Expected 0 rows for analyte B", 0, region.getDataRowCount());
region.setFilter("Analytes", "Contains", "GS Analyte B");
assertEquals("Expected 5 rows for analyte B", 5, region.getDataRowCount());
}

private void uploadAssayFiles(List<File> guavaFiles)
{
setInput(Locator.name("__primaryFile__"), guavaFiles);
}

private void verifyTitrationAnalyteExclusion(String excludedTitration, String excludedAnalyte, String exclusionMessage)
private void verifyTitrationAnalyteExclusion(String excludedTitration, String excludedAnalyte, String exclusionMessage, int rowCount)
{
DataRegionTable region = new DataRegionTable("Data", this);

region.setFilter("Description", "Equals", excludedTitration);
region.setFilter("Analyte", "Contains", excludedAnalyte);
waitForElement(Locator.paginationText(1, 12, 12));
waitForElement(Locator.paginationText(1, rowCount, rowCount));
List<List<String>> vals = region.getFullColumnValues("Well", "Description", "Type", "Exclusion Comment", "Analyte");
List<String> wells = vals.get(0);
List<String> descriptions = vals.get(1);
Expand All @@ -127,7 +165,7 @@ private void verifyTitrationAnalyteExclusion(String excludedTitration, String ex
comment = comments.get(i);
log("Comment: "+ comment);
analyte= analytesPresent.get(i);
analyte = analyte.substring(0, 4);
analyte = analyte.contains("(") ? analyte.substring(0, 4) : analyte;
log("Analyte: " + analyte);

if (analyte.contains(excludedAnalyte) && description.equals(excludedTitration))
Expand All @@ -150,12 +188,12 @@ private void verifyTitrationAnalyteExclusion(String excludedTitration, String ex
region.clearFilter("Description");
}

private void verifyTitrationExclusion(String excludedTitration, String exclusionMessage)
private void verifyTitrationExclusion(String excludedTitration, String exclusionMessage, int rowCount)
{
DataRegionTable region = new DataRegionTable("Data", this);

region.setFilter("Description", "Equals", excludedTitration);
waitForElement(Locator.paginationText(1, 70, 70));
waitForElement(Locator.paginationText(1, rowCount, rowCount));
List<List<String>> vals = region.getFullColumnValues("Well", "Description", "Type", "Exclusion Comment", "Analyte");
List<String> wells = vals.get(0);
List<String> descriptions = vals.get(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void testTitrationExclusionRetention()

//Add titration exclusion that matches
String titrationMatchComment = "titration match";
excludeTitration("Standard1", titrationMatchComment, RUN_NAME, 1, matchingAnalyte);
excludeTitration("Standard1", titrationMatchComment, RUN_NAME, 1, 1, 1, matchingAnalyte);

//Re-import
reimportAndReplaceRunFile(BASE_RUN_FILE, BASE_RUN_FILE, "Standard1", null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ protected void excludeReplicateGroup(String wellName, String type, String descri
clickButton(SAVE_CHANGES_BUTTON, 0);
}

protected void excludeTitration(String titration, String exclusionMessage, String runName, int pipelineJobCount, String...analytes)
protected void excludeTitration(String titration, String exclusionMessage, String runName, int pipelineJobCount, int numCommands, int numMatchingJobs, String...analytes)
{
DataRegionTable table = new DataRegionTable("Data", getDriver());
table.clickHeaderMenu("Exclusions", false, "Exclude Titrations");
Expand All @@ -343,7 +343,9 @@ protected void excludeTitration(String titration, String exclusionMessage, Strin
clickButton("Save", 0);
_extHelper.waitForExtDialog("Confirm Exclusions", WAIT_FOR_JAVASCRIPT);
clickButtonContainingText("Yes", 0);
verifyExclusionPipelineJobComplete(pipelineJobCount, "INSERT titration exclusion (Description: " + titration + ")", runName, exclusionMessage);

String expectedInfo = numCommands > 1 ? "MULTIPLE titration exclusions" : "INSERT titration exclusion (Description: " + titration + ")";
verifyExclusionPipelineJobComplete(pipelineJobCount, expectedInfo, runName, exclusionMessage, numCommands, numMatchingJobs);
}

/**
Expand Down Expand Up @@ -516,6 +518,7 @@ protected void addFilesToAssayRun(File firstFile, File... additionalFiles)
for (File additionalFile : additionalFiles)
{
sleep(500);
scrollIntoView(Locator.lkButton("Next"));
click(Locator.xpath("//a[contains(@class, 'labkey-file-add-icon-enabled')]"));

String fieldName = ASSAY_DATA_FILE_LOCATION_MULTIPLE_FIELD + (index++);
Expand Down
4 changes: 2 additions & 2 deletions luminex/webapp/luminex/exclusion/AnalyteExclusionPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function openExclusionsAnalyteWindow(assayId, runId)
{
var win = new LABKEY.Exclusions.BaseWindow({
title: 'Exclude Analytes from Analysis',
width: Ext.getBody().getViewSize().width < 500 ? Ext.getBody().getViewSize().width * .9 : 450,
height: Ext.getBody().getViewSize().height > 500 ? 460 : Ext.getBody().getViewSize().height * .75,
width: Math.max(600, Ext.getBody().getViewSize().width * .5),
height: Math.max(600, Ext.getBody().getViewSize().height * .5),
items: new LABKEY.Exclusions.AnalytePanel({
protocolSchemaName: assay[0].protocolSchemaName,
assayId: assayId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function openExclusionsSinglepointUnknownWindow(assayId, runId)
{
var win = new LABKEY.Exclusions.BaseWindow({
title: 'Exclude Singlepoint Unknowns from Analysis',
width: Ext.getBody().getViewSize().width < 550 ? Ext.getBody().getViewSize().width * .9 : 500,
height: Ext.getBody().getViewSize().height > 700 ? 600 : Ext.getBody().getViewSize().height * .75,
width: Math.max(600, Ext.getBody().getViewSize().width * .6),
height: Math.max(600, Ext.getBody().getViewSize().height * .6),
items: new LABKEY.Exclusions.SinglepointUnknownPanel({
protocolSchemaName: assay[0].protocolSchemaName,
assayId: assayId,
Expand Down Expand Up @@ -65,7 +65,6 @@ LABKEY.Exclusions.SinglepointUnknownPanel = Ext.extend(LABKEY.Exclusions.BasePan
{
this.excluded = [];
this.comments = [];
this.excludedDataIds = [];
this.present = [];
this.preExcludedIds = [];
this.preAnalyteRowIds = [];
Expand Down Expand Up @@ -277,7 +276,6 @@ LABKEY.Exclusions.SinglepointUnknownPanel = Ext.extend(LABKEY.Exclusions.BasePan
this.comments[rowId] = Ext.getCmp('comment').getValue();
this.present[rowId] = this.getGridCheckboxSelModel().getSelections().length;
record.set('Present', this.present[rowId]);
this.excludedDataIds[rowId] = record.get('DataId');
},
rowselect : function(tsl, rowId, record)
{
Expand Down Expand Up @@ -446,7 +444,7 @@ LABKEY.Exclusions.SinglepointUnknownPanel = Ext.extend(LABKEY.Exclusions.BasePan
var commands = [];
for (var index = 0; index < this.excluded.length; index++)
{
var dataId = this.excludedDataIds[index];
var record = this.getAvailableItemsGrid().getStore().getAt(index);
var analytesForExclusion = this.excluded[index];
if (analytesForExclusion == undefined)
continue;
Expand Down Expand Up @@ -475,7 +473,7 @@ LABKEY.Exclusions.SinglepointUnknownPanel = Ext.extend(LABKEY.Exclusions.BasePan
var commandConfig = {
command: command,
key: this.preExcludedIds[index], // this will be undefined for the insert case
dataId: dataId,
dataId: record.get('DataId'),
description: analytesForExclusion['Name'],
analyteRowIds: (analyteRowIds != "" ? analyteRowIds : null),
analyteNames: (analyteNames != "" ? analyteNames : null), // for logging purposes only
Expand Down
Loading

0 comments on commit 53f9e11

Please sign in to comment.