Skip to content

Commit ee539ee

Browse files
Merge 25.3 to 25.5
2 parents e3d5e5f + 2623f4a commit ee539ee

19 files changed

Lines changed: 766 additions & 166 deletions

resources/queries/targetedms/PTMPercents.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ SELECT
88
PreviousAA @hidden,
99
NextAA @hidden,
1010
SampleFileId.ReplicateId.Name AS ReplicateName,
11-
-- Explicitly cast for SQLServer to avoid trying to add as numeric types
12-
SUBSTRING(Sequence, IndexAA + 1, 1) || CAST(StartIndex + IndexAA + 1 AS VARCHAR) AS SiteLocation,
11+
SiteLocation,
1312
SUBSTRING(Sequence, IndexAA + 1, 1) AS AminoAcid,
1413
StartIndex + IndexAA + 1 AS Location,
1514
PeptideGroupId
@@ -23,5 +22,6 @@ GROUP BY
2322
StartIndex,
2423
PeptideGroupId,
2524
IndexAA,
26-
StructuralModId
25+
StructuralModId,
26+
SiteLocation
2727
PIVOT PercentModified BY ReplicateName

resources/queries/targetedms/PTMPercentsPrepivot.query.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
<column columnName="ModifiedAreaProportion">
77
<formatString>0.00%</formatString>
88
</column>
9+
<column columnName="SiteLocation">
10+
<displayColumnFactory>
11+
<className>org.labkey.targetedms.query.SiteLocationDisplayColumnFactory</className>
12+
</displayColumnFactory>
13+
</column>
914
</columns>
1015
</table>
1116
</tables>

resources/queries/targetedms/PeptideIds.query.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<tables xmlns="http://labkey.org/data/xml">
44
<table tableName="PeptideIds" tableDbType="TABLE">
55
<columns>
6+
<column columnName="RetentionTime">
7+
<formatString>0.0</formatString>
8+
</column>
69
<column columnName="Modification">
710
<textAlign>left</textAlign>
811
</column>
@@ -36,6 +39,11 @@
3639
<className>org.labkey.targetedms.query.CrossLinkedPeptideDisplayColumn$PeptideLocationFactory</className>
3740
</displayColumnFactory>
3841
</column>
42+
<column columnName="PeptideIdentity">
43+
<displayColumnFactory>
44+
<className>org.labkey.targetedms.query.CrossLinkedPeptideDisplayColumn$PeptideIdentityFactory</className>
45+
</displayColumnFactory>
46+
</column>
3947
<column columnName="BondLocation">
4048
<columnTitle>Disulfide Bond Connection</columnTitle>
4149
<displayColumnFactory>

resources/queries/targetedms/PeptideIds.sql

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ SELECT
66
PrecursorId.NeutralMass AS ExpectedPeptideMass,
77
-- Concatenate the empty string so that the protein DisplayColumn doesn't get propagated too
88
PrecursorId.PeptideId.PeptideGroupId.Label || '' AS Chain,
9-
CAST(PrecursorId.PeptideId.StartIndex + 1 AS VARCHAR) || '-' || CAST(PrecursorId.PeptideId.EndIndex AS VARCHAR) AS PeptideLocation,
9+
CAST(PrecursorId.PeptideId.StartIndex + 1 AS VARCHAR) || '-' ||
10+
-- Subtract one from the index if it was a c-term clipping of lysine, shortening the sequence
11+
CAST(PrecursorId.PeptideId.EndIndex - (CASE WHEN LOCATE('C-Term Lys Clipping', Modification) >= 0 THEN 1 ELSE 0 END) AS VARCHAR) AS PeptideLocation,
12+
CAST(PrecursorId.PeptideId.StartIndex + 1 AS VARCHAR) || '-' ||
13+
-- Subtract one from the index if it was a c-term clipping of lysine, shortening the sequence
14+
CAST(PrecursorId.PeptideId.EndIndex - (CASE WHEN LOCATE('C-Term Lys Clipping', Modification) >= 0 THEN 1 ELSE 0 END) AS VARCHAR) AS PeptideIdentity,
1015
-- Value is calculated in Java in CrossLinkedPeptideDisplayColumn
1116
CAST(NULL AS VARCHAR) AS BondLocation,
1217
PrecursorId.PeptideId.Sequence @hidden,
@@ -15,18 +20,22 @@ SELECT
1520
PrecursorId.PeptideId.PeptideModifiedSequence AS PeptideModifiedSequence,
1621
PrecursorId.PeptideId AS Id @hidden,
1722
PrecursorId.PeptideId.PeptideGroupId.RunId AS RunId @hidden,
18-
-- Show the modifications and their locations
19-
(SELECT GROUP_CONCAT((StructuralModId.Name ||
20-
-- For now omit AA index info for anything but the first crosslinked peptide
21-
CASE WHEN psm.PeptideIndex = 0 THEN (' @ ' ||
22-
SUBSTRING(p.Sequence, IndexAA + 1, 1) ||
23-
CAST(IndexAA + p.StartIndex + 1 AS VARCHAR)) ELSE '' END),
24-
(', ' || CHR(10)))
25-
FROM targetedms.PeptideStructuralModification psm INNER JOIN targetedms.Peptide p ON psm.PeptideId = p.Id WHERE psm.PeptideId = pci.PrecursorId.PeptideId) AS Modification,
23+
mods.Modification,
2624
SUM(TotalArea) AS TotalArea
2725

2826
FROM
29-
targetedms.precursorchrominfo pci
27+
targetedms.precursorchrominfo pci LEFT OUTER JOIN
28+
-- Show the modifications and their locations
29+
(SELECT GROUP_CONCAT((StructuralModId.Name ||
30+
-- For now omit AA index info for anything but the first crosslinked peptide
31+
CASE WHEN psm.PeptideIndex = 0 THEN (' @ ' ||
32+
SUBSTRING(p.Sequence, IndexAA + 1, 1) ||
33+
CAST(IndexAA + p.StartIndex + 1 AS VARCHAR)) ELSE '' END),
34+
(', ' || CHR(10))) AS Modification,
35+
psm.PeptideId
36+
FROM targetedms.PeptideStructuralModification psm INNER JOIN targetedms.Peptide p ON psm.PeptideId = p.Id
37+
GROUP BY psm.PeptideId)
38+
mods ON mods.PeptideId = pci.PrecursorId.PeptideId
3039
GROUP BY
3140
PrecursorId.PeptideId.PeptideModifiedSequence,
3241
PrecursorId.NeutralMass,
@@ -38,4 +47,5 @@ GROUP BY
3847
PrecursorId.PeptideId.NextAA,
3948
PrecursorId.PeptideId.PreviousAA,
4049
PrecursorId.PeptideId.StartIndex,
41-
PrecursorId.PeptideId.EndIndex
50+
PrecursorId.PeptideId.EndIndex,
51+
Modification

resources/queries/targetedms/PeptideIds/.qview.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
2+
<columns>
3+
<column name="RetentionTime" />
4+
<column name="MinObservedPeptideMass" />
5+
<column name="MaxObservedPeptideMass" />
6+
<column name="ExpectedPeptideMass" />
7+
<column name="Chain" />
8+
<column name="PeptideIdentity" />
9+
<column name="BondLocation" />
10+
<column name="PeptideModifiedSequence" />
11+
<column name="Modification" />
12+
</columns>
213
<sorts>
314
<sort column="RetentionTime" />
415
</sorts>

src/org/labkey/targetedms/TargetedMSController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,7 +2520,7 @@ public void setPrecursor(Precursor precursor)
25202520

25212521
public HtmlString getModifiedPeptideHtml()
25222522
{
2523-
return new ModifiedPeptideHtmlMaker().getPrecursorHtml(getPrecursor(), getRun().getId(), _targetedMSSchema);
2523+
return new ModifiedPeptideHtmlMaker().getPrecursorHtml(getPrecursor(), getRun().getId(), _targetedMSSchema).first;
25242524
}
25252525

25262526
public PeptideSettings.IsotopeLabel getIsotopeLabel()
@@ -3225,7 +3225,7 @@ private void addSpectrumViews(TargetedMSRun run, VBox vbox, List<LibrarySpectrum
32253225

32263226
idx++;
32273227
}
3228-
if(unsupportedLibraries.size() > 0)
3228+
if(!unsupportedLibraries.isEmpty())
32293229
{
32303230
HtmlView view = new HtmlView(DIV("Annotated spectra cannot be displayed from the following unsupported "
32313231
+ (unsupportedLibraries.size() == 1 ? "library" : "libraries") + ": ",
@@ -3237,7 +3237,7 @@ private void addSpectrumViews(TargetedMSRun run, VBox vbox, List<LibrarySpectrum
32373237
view.setTitle("Unsupported Spectrum " + (unsupportedLibraries.size() == 1 ? "Library" : "Libraries"));
32383238
vbox.addView(view);
32393239
}
3240-
if(specLibErrors.size() > 0)
3240+
if(!specLibErrors.isEmpty())
32413241
{
32423242
HtmlView view = new HtmlView(DOM.LK.ERRORS(specLibErrors.stream().map(e -> new LabKeyError(e.getMessage())).collect(Collectors.toList())));
32433243
view.setTitle("Spectrum Library Errors");

src/org/labkey/targetedms/TargetedMSModule.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
import org.labkey.targetedms.parser.skyaudit.SkylineAuditLogParser;
7676
import org.labkey.targetedms.passport.PassportController;
7777
import org.labkey.targetedms.pipeline.TargetedMSPipelineProvider;
78+
import org.labkey.targetedms.query.CrossLinkedPeptideDisplayColumn;
7879
import org.labkey.targetedms.query.PrecursorManager;
7980
import org.labkey.targetedms.query.SkylineListSchema;
8081
import org.labkey.targetedms.search.ModificationSearchWebPart;
@@ -704,7 +705,8 @@ public Set<Class> getUnitTests()
704705
PrecursorManager.TestCase.class,
705706
CrossLinkedPeptideInfo.TestCase.class,
706707
Protein.TestCase.class,
707-
SpectrumFilter.TestCase.class
708+
SpectrumFilter.TestCase.class,
709+
CrossLinkedPeptideDisplayColumn.TestCase.class
708710
);
709711
}
710712

src/org/labkey/targetedms/TargetedMSSchema.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import org.labkey.api.exp.query.ExpRunTable;
4848
import org.labkey.api.exp.query.ExpSchema;
4949
import org.labkey.api.module.Module;
50-
import org.labkey.api.query.CrosstabView;
5150
import org.labkey.api.query.CustomView;
5251
import org.labkey.api.query.DefaultQueryUpdateService;
5352
import org.labkey.api.query.DefaultSchema;
@@ -111,7 +110,9 @@
111110
import org.labkey.targetedms.query.RepresentativeStateDisplayColumn;
112111
import org.labkey.targetedms.query.SampleFileTable;
113112
import org.labkey.targetedms.query.SkylineAuditTable;
113+
import org.labkey.targetedms.query.TargetedMSCrosstabView;
114114
import org.labkey.targetedms.query.TargetedMSForeignKey;
115+
import org.labkey.targetedms.query.TargetedMSQueryView;
115116
import org.labkey.targetedms.query.TargetedMSTable;
116117
import org.labkey.targetedms.view.FontAwesomeLinkColumn;
117118
import org.springframework.validation.BindException;
@@ -1505,7 +1506,6 @@ public DisplayColumn createRenderer(ColumnInfo colInfo)
15051506
if (TABLE_TRANSITION_ANNOTATION.equalsIgnoreCase(name) || TABLE_TRANSITION_OPTIMIZATION.equalsIgnoreCase(name))
15061507
{
15071508
TargetedMSTable result = new TargetedMSTable(getSchema().getTable(name), this, cf, ContainerJoinType.TransitionFK);
1508-
TargetedMSSchema targetedMSSchema = this;
15091509
result.getMutableColumnOrThrow("TransitionId").setFk(new TargetedMSForeignKey(this, TABLE_TRANSITION, cf));
15101510
result.addWrapColumn("MoleculeTransition", result.getRealTable().getColumn("TransitionId")).
15111511
setFk(new TargetedMSForeignKey(this, TABLE_MOLECULE_TRANSITION, cf));
@@ -1608,16 +1608,16 @@ public DisplayColumn createRenderer(ColumnInfo colInfo)
16081608
TABLE_INSTRUMENT_RATE.equalsIgnoreCase(name) ||
16091609
TABLE_INSTRUMENT_USAGE_PAYMENT.equalsIgnoreCase(name))
16101610
{
1611-
var result = new FilteredTable<TargetedMSSchema>(getSchema().getTable(name), this, cf)
1611+
var result = new FilteredTable<>(getSchema().getTable(name), this, cf)
16121612
{
16131613
@Override
16141614
public boolean hasPermission(@NotNull UserPrincipal user, @NotNull Class<? extends Permission> perm)
16151615
{
1616-
return getContainer().hasPermission(user,perm);
1616+
return getContainer().hasPermission(user, perm);
16171617
}
16181618

16191619
@Override
1620-
public @Nullable QueryUpdateService getUpdateService()
1620+
public @NotNull QueryUpdateService getUpdateService()
16211621
{
16221622
return new DefaultQueryUpdateService(this, getRealTable());
16231623
}
@@ -1668,7 +1668,7 @@ public QueryView createView(ViewContext context, @NotNull QuerySettings settings
16681668
String queryName = settings.getQueryName();
16691669
if (queryName != null && ("PTMPercentsGrouped".equalsIgnoreCase(queryName) || queryName.toLowerCase().startsWith(QUERY_PTM_PERCENTS_GROUPED_PREFIX.toLowerCase())))
16701670
{
1671-
return new CrosstabView(TargetedMSSchema.this, settings, errors)
1671+
return new TargetedMSCrosstabView(TargetedMSSchema.this, settings, errors)
16721672
{
16731673
@Override
16741674
protected DataRegion createDataRegion()
@@ -1705,7 +1705,16 @@ protected SafeToRender getMemberCaptionWithUrl(String caption, String url)
17051705
};
17061706
}
17071707

1708-
return super.createView(context, settings, errors);
1708+
QueryDefinition qdef = settings.getQueryDef(this);
1709+
if (qdef != null)
1710+
{
1711+
TableInfo tableInfo = qdef.getTable(this, new ArrayList<>(), true);
1712+
if (tableInfo instanceof CrosstabTableInfo cti && cti.isCrosstab())
1713+
1714+
return new TargetedMSCrosstabView(this, settings, errors);
1715+
}
1716+
1717+
return new TargetedMSQueryView(this, settings, errors);
17091718
}
17101719

17111720
@Override

0 commit comments

Comments
 (0)