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 @@ -234,6 +234,8 @@ private PeptidesTableInfo createPeptideTable(MS2Schema schema)
_peptidesTable = new PeptidesTableInfo(schema, _url.clone(), ContainerFilter.current(schema), runTypes.toArray(new MS2RunType[0]), highestScoreFlag);
// Manually apply the metadata
_peptidesTable.overlayMetadata(_peptidesTable.getPublicName(), schema, new ArrayList<>());
// Wrapped columns from XML metadata only get their lookups here, as UserSchema.getTable() would do
_peptidesTable.afterConstruct();
}
return _peptidesTable;
}
Expand Down
5 changes: 3 additions & 2 deletions ms2/src/org/labkey/ms2/query/ComparePeptideTableInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.jetbrains.annotations.NotNull;
import org.labkey.api.data.ColumnInfo;
import org.labkey.api.data.ContainerFilter;
import org.labkey.api.data.JdbcType;
import org.labkey.api.data.SQLFragment;
import org.labkey.api.data.TableInfo;
Expand Down Expand Up @@ -74,7 +75,7 @@ public ComparePeptideTableInfo(MS2Schema schema, List<MS2Run> runs, boolean forE
@Override
public TableInfo getLookupTableInfo()
{
return new PeptidesTableInfo(_userSchema);
return _userSchema.getTable(MS2Schema.TableType.Peptides.name(), ContainerFilter.current(_userSchema));
}
};
if (!forExport)
Expand All @@ -96,7 +97,7 @@ public TableInfo getLookupTableInfo()
@Override
public TableInfo getLookupTableInfo()
{
return new PeptidesTableInfo(_userSchema);
return _userSchema.getTable(MS2Schema.TableType.Peptides.name(), ContainerFilter.current(_userSchema));
}
});
addColumn(peptideIdColumn);
Expand Down
30 changes: 29 additions & 1 deletion ms2/test/src/org/labkey/test/tests/ms2/MS2ExtensionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
import org.labkey.test.Locator;
import org.labkey.test.categories.Daily;
import org.labkey.test.categories.MS2;
import org.labkey.test.params.FieldKey;
import org.labkey.test.util.DataRegionTable;
import org.labkey.test.util.EscapeUtil;
import org.labkey.test.util.LogMethod;
import org.labkey.test.util.PortalHelper;

import java.io.File;
import java.util.HashSet;
import java.util.Set;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand All @@ -52,17 +56,41 @@ protected void setupMS2()
cleanPipeline();
super.setupMS2();
importMS2Run("DRT2", 2);
_containerHelper.enableModule(getProjectName() + "/" + FOLDER_NAME, MS2EXTENSIONS_MODULE);
}

@Override
protected void verifyMS2()
{
verifyMultiProteinsSearch();
verifyChargeFilterLookup();
}

// Issue 52659: lookups from module query XML must resolve in the run's peptide grid and on the protein page
private void verifyChargeFilterLookup()
{
// HyperChgFilt2 is 999999 for charges other than 2+ (XTandemChargeQueryColumns.sql)
String chargeTwoFilter = EscapeUtil.encode(REGION_NAME_PEPTIDES + "." + FieldKey.fromParts("XTandemChgFilt", "HyperChgFilt2") + "~lt") + "=999999";

navigateToFolder(FOLDER_NAME);
clickAndWait(Locator.linkWithText("drt/CAexample_mini (DRT2)"));
selectOptionByText(Locator.name("viewParams"), "<Standard View>");
clickButton("Go");
beginAt(getCurrentRelativeURL() + "&" + chargeTwoFilter);

assertTextNotPresent("Ignoring filter");
DataRegionTable peptides = new DataRegionTable(REGION_NAME_PEPTIDES, this);
assertEquals("Peptide rows filtered on a module-defined lookup", 21, peptides.getDataRowCount());
assertEquals("Charges after filtering on HyperChgFilt2", Set.of("2+"), new HashSet<>(peptides.getColumnDataAsText("Charge")));

beginAt(getAttribute(Locator.linkWithText("gi|15645924|ribosomal_protein"), "href") + "&allPeps=true");
assertTextPresent("1 total, 1 distinct", "R.VKLKAMQLSNPNEIKKAR.N");
assertTextNotPresent("K.YTELK.D");
}

private void verifyMultiProteinsSearch()
{
_containerHelper.enableModule(MS2EXTENSIONS_MODULE);
navigateToFolder(FOLDER_NAME);
PortalHelper _portalHelper = new PortalHelper(this);
_portalHelper.addWebPart(MS2EXTENSIONS_WEBPART);

Expand Down
Loading