Skip to content

Commit 163f88b

Browse files
authored
Fix incorrectly disabled "Max LOQ CV" text box (#3390)
Fixed "Max LOQ CV" text box incorrectly disabled when LOD calculation is "Bilinear turning point" (reported by Philip) The "Max LOQ CV" text box needed to be disabled when the limit of quantification was being calculated using bootstrap curves. Now that LOQ is no longer calculated with using bootstrap curves, the text box should always be enabled. Also fix performance problem pasting a large number of values into Document Grid in very large document (not reported by anyone). Also fix performance problem I introduced earlier this week reading ResultFileMetadata
1 parent 73af77a commit 163f88b

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

pwiz_tools/Skyline/Model/Databinding/SkylineDataSchema.cs

+14-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ private readonly HashSet<IDocumentChangeListener> _documentChangedEventHandlers
4747
= new HashSet<IDocumentChangeListener>();
4848
private readonly CachedValue<ImmutableSortedList<ResultKey, Replicate>> _replicates;
4949
private readonly CachedValue<IDictionary<ResultFileKey, ResultFile>> _resultFiles;
50-
private readonly CachedValue<ElementRefs> _elementRefCache;
5150
private readonly CachedValue<AnnotationCalculator> _annotationCalculator;
5251
private readonly CachedValue<NormalizedValueCalculator> _normalizedValueCalculator;
52+
private ElementRefs _elementRefCache;
5353

5454
private BatchChangesState _batchChangesState;
5555

@@ -62,7 +62,6 @@ public SkylineDataSchema(IDocumentContainer documentContainer, DataSchemaLocaliz
6262

6363
_replicates = CachedValue.Create(this, CreateReplicateList);
6464
_resultFiles = CachedValue.Create(this, CreateResultFileList);
65-
_elementRefCache = CachedValue.Create(this, () => new ElementRefs(Document));
6665
_annotationCalculator = CachedValue.Create(this, () => new AnnotationCalculator(this));
6766
_normalizedValueCalculator = CachedValue.Create(this, () => new NormalizedValueCalculator(Document));
6867
}
@@ -228,6 +227,10 @@ private void DocumentChangedEventHandler(object sender, DocumentChangedEventArgs
228227
using (QueryLock.CancelAndGetWriteLock())
229228
{
230229
_document = _documentContainer.Document;
230+
if (!_document.DeferSettingsChanges)
231+
{
232+
_elementRefCache = null;
233+
}
231234
IList<IDocumentChangeListener> listeners;
232235
lock (_documentChangedEventHandlers)
233236
{
@@ -263,7 +266,15 @@ public Lazy<NormalizationData> LazyNormalizationData
263266
}
264267

265268
public ChromDataCache ChromDataCache { get; private set; }
266-
public ElementRefs ElementRefs { get { return _elementRefCache.Value; } }
269+
270+
public ElementRefs ElementRefs
271+
{
272+
get
273+
{
274+
_elementRefCache ??= new ElementRefs(Document);
275+
return _elementRefCache;
276+
}
277+
}
267278

268279
public AnnotationCalculator AnnotationCalculator
269280
{

pwiz_tools/Skyline/Model/Results/Spectra/SpectrumMetadatas.cs

+19-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public override int GetHashCode()
281281
return CollectionUtil.GetHashCodeDeep(this);
282282
}
283283

284-
private struct PrecursorWithLevel
284+
private readonly struct PrecursorWithLevel : IEquatable<PrecursorWithLevel>
285285
{
286286
public PrecursorWithLevel(int msLevel, SpectrumPrecursor spectrumPrecursor)
287287
{
@@ -291,6 +291,24 @@ public PrecursorWithLevel(int msLevel, SpectrumPrecursor spectrumPrecursor)
291291

292292
public int MsLevel { get; }
293293
public SpectrumPrecursor Precursor { get; }
294+
295+
public bool Equals(PrecursorWithLevel other)
296+
{
297+
return MsLevel == other.MsLevel && Precursor.Equals(other.Precursor);
298+
}
299+
300+
public override bool Equals(object obj)
301+
{
302+
return obj is PrecursorWithLevel other && Equals(other);
303+
}
304+
305+
public override int GetHashCode()
306+
{
307+
unchecked
308+
{
309+
return (MsLevel * 397) ^ Precursor.GetHashCode();
310+
}
311+
}
294312
}
295313

296314
private struct ScanId

pwiz_tools/Skyline/SettingsUI/PeptideSettingsUI.Designer.cs

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pwiz_tools/Skyline/SettingsUI/PeptideSettingsUI.cs

-5
Original file line numberDiff line numberDiff line change
@@ -2115,11 +2115,6 @@ private void listLibraries_MouseMove(object sender, MouseEventArgs e)
21152115
ChangeTooltip(listLibraries, librarySpec?.ItemDescription?.ToString() ?? _librariesOriginalTooltip);
21162116
}
21172117

2118-
private void comboLodMethod_SelectedIndexChanged(object sender, EventArgs e)
2119-
{
2120-
tbxMaxLoqBias.Enabled = comboLodMethod.SelectedItem != LodCalculation.TURNING_POINT_STDERR;
2121-
}
2122-
21232118
private void comboRegressionFit_SelectedIndexChanged(object sender, EventArgs e)
21242119
{
21252120
UpdateLodOptions(comboLodMethod.SelectedItem as LodCalculation);

0 commit comments

Comments
 (0)