Skip to content

Commit 5dab20e

Browse files
Merge 25.4 to develop
2 parents 35dd6b7 + bad3fc2 commit 5dab20e

File tree

3 files changed

+20
-30
lines changed

3 files changed

+20
-30
lines changed

resources/schemas/dbscripts/postgresql/targetedms-25.001-25.002.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CREATE TABLE targetedms.msProject
2424
(
2525
Id SERIAL NOT NULL ,
2626
affiliation varchar(15) DEFAULT NULL,
27-
blocked BOOLEAN NOT NULL DEFAULT 0,
27+
blocked BOOLEAN NOT NULL DEFAULT ''0'',
2828
title varchar(255),
2929
type integer,
3030
submitDate timestamp NOT NULL,
@@ -69,9 +69,9 @@ CREATE TABLE targetedms.msInstrument
6969
id SERIAL NOT NULL ,
7070
name varchar(100) NOT NULL,
7171
description varchar(255) DEFAULT NULL,
72-
active BOOLEAN NOT NULL DEFAULT 1,
72+
active BOOLEAN NOT NULL DEFAULT ''1'',
7373
color varchar(10) DEFAULT NULL,
74-
massSpec BOOLEAN DEFAULT 1,
74+
massSpec BOOLEAN DEFAULT ''1'',
7575
instrument varchar(200),
7676
7777
Container entityid NOT NULL,
@@ -101,8 +101,8 @@ CREATE TABLE targetedms.paymentMethod
101101
state char(2) DEFAULT NULL,
102102
zip varchar(11) DEFAULT NULL,
103103
country varchar(50) DEFAULT NULL,
104-
isCurrent BOOLEAN NOT NULL DEFAULT 0,
105-
federalFunding BOOLEAN NOT NULL DEFAULT 0,
104+
isCurrent BOOLEAN NOT NULL DEFAULT ''0'',
105+
federalFunding BOOLEAN NOT NULL DEFAULT ''0'',
106106
poAmount decimal(11,2) DEFAULT NULL,
107107
name varchar(500) DEFAULT NULL,
108108
worktag varchar(10) DEFAULT NULL,

src/org/labkey/targetedms/parser/SignedMz.java

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
*/
2323
public class SignedMz implements Comparable<SignedMz>
2424
{
25-
private final Double _mz;
25+
private final double _mz;
2626
private final boolean _isNegative;
2727

28-
public SignedMz(Double mz, boolean isNegative)
28+
public SignedMz(double mz, boolean isNegative)
2929
{
3030
_mz = mz;
3131
_isNegative = isNegative;
3232
}
3333

34-
public Double getMz()
34+
public double getMz()
3535
{
3636
return _mz;
3737
}
@@ -41,42 +41,26 @@ public boolean isNegative()
4141
return _isNegative;
4242
}
4343

44-
public boolean hasValue()
45-
{
46-
return _mz != null;
47-
}
48-
4944
@Override
5045
public int compareTo(@NotNull SignedMz other)
5146
{
52-
if (hasValue() != other.hasValue())
53-
{
54-
return hasValue() ? 1 : -1;
55-
}
5647
if (isNegative() != other.isNegative())
5748
{
5849
return isNegative() ? -1 : 1;
5950
}
6051
// Same sign
61-
if (hasValue())
62-
return _mz.compareTo(other.getMz());
63-
64-
return 0; // Both empty
52+
return Double.compare(_mz, other.getMz());
6553
}
6654

6755
public int compareTolerant(SignedMz other, double tolerance)
6856
{
69-
if (hasValue() != other.hasValue())
70-
{
71-
return hasValue() ? 1 : -1;
72-
}
7357
if (isNegative() != other.isNegative())
7458
{
7559
return isNegative() ? -1 : 1; // Not interested in tolerance when signs disagree
7660
}
7761
// Same sign
7862
if (Math.abs(_mz - other.getMz()) <= tolerance)
7963
return 0;
80-
return _mz.compareTo(other.getMz());
64+
return Double.compare(_mz, other.getMz());
8165
}
8266
}

src/org/labkey/targetedms/parser/SkylineDocumentParser.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,6 +2292,7 @@ private void populateChromInfoChromatograms(GeneralPrecursor<?> precursor, List<
22922292
}
22932293
}
22942294

2295+
Map<ChromGroupHeaderInfo, SignedMz[]> cachedTransitions = new HashMap<>();
22952296
List<? extends GeneralTransition> transitionsList = precursor.getTransitionsList();
22962297
for (GeneralTransition transition: transitionsList)
22972298
{
@@ -2305,9 +2306,14 @@ private void populateChromInfoChromatograms(GeneralPrecursor<?> precursor, List<
23052306
int matchIndex = -1;
23062307
// Figure out which index into the list of transitions we're inserting.
23072308
double deltaNearestMz = Double.MAX_VALUE;
2308-
SignedMz[] transitions = Arrays.stream(_binaryParser.getTransitions(c))
2309-
.map(t->t.getProduct(c))
2310-
.toArray(SignedMz[]::new);
2309+
SignedMz[] transitions = cachedTransitions.get(c);
2310+
if (transitions == null)
2311+
{
2312+
transitions = Arrays.stream(_binaryParser.getTransitions(c))
2313+
.map(t->t.getProduct(c))
2314+
.toArray(SignedMz[]::new);
2315+
cachedTransitions.put(c, transitions);
2316+
}
23112317
double transitionMz = transition.getMz();
23122318
if (transChromInfo.isOptimizationPeak())
23132319
{
@@ -2332,7 +2338,7 @@ private void populateChromInfoChromatograms(GeneralPrecursor<?> precursor, List<
23322338
incrementMissingChromatograms(filePath,
23332339
"Unable to find a matching chromatogram for file path " + filePath +
23342340
". SKYD file may be out of sync with primary Skyline document. Transition " + transition +
2335-
", " + precursor + ", " +precursor.getCharge());
2341+
", " + precursor + ", " + precursor.getCharge());
23362342
}
23372343
else
23382344
{

0 commit comments

Comments
 (0)