Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
13f20a3
In ExceptionWeb report https://skyline.ms/announcements/home/issues/e…
bspratt Aug 7, 2024
c4df609
was using wrong Trace method for immediate window placement
bspratt Aug 7, 2024
4d71770
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Aug 7, 2024
e85d846
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Aug 13, 2024
d95436c
Introducing
bspratt Aug 14, 2024
a827c3b
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Aug 14, 2024
21fbde2
update test to accommodate new exception type
bspratt Aug 14, 2024
385c304
Merge branch 'Skyline/work/20240807_graceful_handling_adduct_molecule…
bspratt Aug 14, 2024
c205d9d
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Aug 20, 2024
be1cfbe
clear up an unwanted using directive
bspratt Sep 4, 2024
419bec9
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Sep 4, 2024
f93c794
Merge branch 'Skyline/work/20240807_graceful_handling_adduct_molecule…
bspratt Sep 4, 2024
052ad3a
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Sep 9, 2024
4aca7ae
manual merge of commit 721ae29282b14b2aa0596e2c98f9d9c7d7d5060b
bspratt Sep 10, 2024
c4e20ae
Merge remote-tracking branch 'remotes/origin/master' into Skyline/wor…
bspratt Sep 10, 2024
b345e22
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Sep 11, 2024
b20e435
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Sep 24, 2024
ea667ec
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Sep 25, 2024
1d7ccf0
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Sep 30, 2024
adf085e
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 8, 2024
aa24656
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 8, 2024
725fed3
Make the error message more prominent
bspratt Oct 8, 2024
b468780
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 17, 2024
e80b3d6
use Messages.WriteAsyncUserMessage instead of Trace.Warning
bspratt Oct 17, 2024
bdb8e01
Merge branch 'Skyline/work/20240807_graceful_handling_adduct_molecule…
bspratt Oct 17, 2024
66fa89a
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 22, 2024
fea88af
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 24, 2024
07465ed
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Nov 4, 2024
20b63ba
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Nov 12, 2024
1e7a466
Add detail library name to immediate window message when adduct does …
bspratt Nov 13, 2024
f417703
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Nov 13, 2024
97f3811
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Nov 13, 2024
7ac34ee
Merge branch 'Skyline/work/20240807_graceful_handling_adduct_molecule…
bspratt Nov 13, 2024
83fa52f
Move strings to resource file
bspratt Nov 13, 2024
850be29
Avoid repeated messages (within the last 500msec) in Messages.WriteAs…
bspratt Nov 13, 2024
d5c4dc9
use Messages.WriteAsyncUserMessage to non-blockingly explain why libr…
bspratt Nov 13, 2024
b8a95dd
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Nov 15, 2024
3ffdbe2
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Nov 18, 2024
3c76101
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Nov 21, 2024
8720292
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Nov 22, 2024
cdae880
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Nov 25, 2024
3dd0c11
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Dec 11, 2024
543c151
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Jan 21, 2025
74e80d2
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Apr 2, 2025
7c113c4
Merge remote-tracking branch 'remotes/origin/master' into Skyline/wor…
bspratt Oct 6, 2025
00f4f2a
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 15, 2025
440a6ef
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 20, 2025
78420ca
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 20, 2025
d0a9fd4
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 21, 2025
e073016
Merge branch 'master' into Skyline/work/20240807_graceful_handling_ad…
bspratt Oct 22, 2025
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
47 changes: 31 additions & 16 deletions pwiz_tools/Skyline/Model/AbstractModificationMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.Linq;
using System.Text;
using pwiz.Common.Collections;
using pwiz.Common.SystemUtil;
using pwiz.Skyline.Model.Crosslinking;
using pwiz.Skyline.Model.DocSettings;
using pwiz.Skyline.Model.Lib;
Expand All @@ -39,6 +40,8 @@ public abstract class AbstractModificationMatcher

protected SrmSettings Settings { get; set; }
protected bool Initialized { get; set; }
protected internal string LibraryName { get; set; }

protected MappedList<string, StaticMod> DefSetStatic { get; private set; }
protected MappedList<string, StaticMod> DefSetHeavy { get; private set; }
protected IsotopeLabelType DocDefHeavyLabelType { get; private set; }
Expand All @@ -54,13 +57,15 @@ public static double GetDefaultModMass(char aa, StaticMod mod)
}

internal void InitMatcherSettings(SrmSettings settings,
MappedList<string, StaticMod> defSetStatic, MappedList<string, StaticMod> defSetHeavy)
MappedList<string, StaticMod> defSetStatic, MappedList<string, StaticMod> defSetHeavy, string libraryName)
{
DefSetStatic = defSetStatic;
DefSetHeavy = defSetHeavy;

Settings = settings;

LibraryName = libraryName;

var modifications = settings.PeptideSettings.Modifications;

UserDefinedTypedMods = new Dictionary<StaticMod, IsotopeLabelType>();
Expand Down Expand Up @@ -474,24 +479,34 @@ public PeptideDocNode CreateDocNodeFromSettings(LibKey key, Peptide peptide, Srm
SpectrumHeaderInfo libInfo;
if (nodePep != null && Settings.PeptideSettings.Libraries.TryGetLibInfo(key, out libInfo))
{
var isotopeLabelType = key.Adduct.HasIsotopeLabels ? IsotopeLabelType.heavy : IsotopeLabelType.light;
var group = new TransitionGroup(peptide, key.Adduct, isotopeLabelType);
nodeGroupMatched = new TransitionGroupDocNode(group, Annotations.EMPTY, Settings, null, libInfo, ExplicitTransitionGroupValues.EMPTY, null, null, false);
SpectrumPeaksInfo spectrum;
if (Settings.PeptideSettings.Libraries.TryLoadSpectrum(key, out spectrum))
try
{
// Add fragment and precursor transitions as needed
var transitionDocNodes =
Settings.TransitionSettings.Filter.SmallMoleculeIonTypes.Contains(IonType.precursor)
? nodeGroupMatched.GetPrecursorChoices(Settings, null, true) // Gives list of precursors
: new List<DocNode>();

if (Settings.TransitionSettings.Filter.SmallMoleculeIonTypes.Contains(IonType.custom))
var isotopeLabelType = key.Adduct.HasIsotopeLabels ? IsotopeLabelType.heavy : IsotopeLabelType.light;
var group = new TransitionGroup(peptide, key.Adduct, isotopeLabelType);
nodeGroupMatched = new TransitionGroupDocNode(group, Annotations.EMPTY, Settings, null, libInfo, ExplicitTransitionGroupValues.EMPTY, null, null, false);
SpectrumPeaksInfo spectrum;
if (Settings.PeptideSettings.Libraries.TryLoadSpectrum(key, out spectrum))
{
GetSmallMoleculeFragments(key, nodeGroupMatched, spectrum, transitionDocNodes);
// Add fragment and precursor transitions as needed
var transitionDocNodes =
Settings.TransitionSettings.Filter.SmallMoleculeIonTypes.Contains(IonType.precursor)
? nodeGroupMatched.GetPrecursorChoices(Settings, null, true) // Gives list of precursors
: new List<DocNode>();

if (Settings.TransitionSettings.Filter.SmallMoleculeIonTypes.Contains(IonType.custom))
{
GetSmallMoleculeFragments(key, nodeGroupMatched, spectrum, transitionDocNodes);
}
nodeGroupMatched = (TransitionGroupDocNode)nodeGroupMatched.ChangeChildren(transitionDocNodes);
return (PeptideDocNode)nodePep.ChangeChildren(new List<DocNode>() { nodeGroupMatched });
}
nodeGroupMatched = (TransitionGroupDocNode)nodeGroupMatched.ChangeChildren(transitionDocNodes);
return (PeptideDocNode)nodePep.ChangeChildren(new List<DocNode>() { nodeGroupMatched });
}
catch (InvalidChemicalModificationException e)
{
var message = string.IsNullOrEmpty(LibraryName) ?
string.Format(ModelResources.AbstractModificationMatcher_CreateDocNodeFromSettings_In___0_____1_, key.Target.DisplayName, e.Message) :
string.Format(ModelResources.AbstractModificationMatcher_CreateDocNodeFromSettings_In_entry___0___of___1_____2_, key.Target.DisplayName, LibraryName, e.Message);
Messages.WriteAsyncUserMessage(message); // Adduct makes no sense for target formula
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pwiz_tools/Skyline/Model/Import.cs
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ private PeptideGroupBuilder AddRow(PeptideGroupBuilder seqBuilder,
{
seqBuilder.AppendTransition(info, irt, explicitRT, libraryIntensity, productMz, note, lineText, lineNum);
}
catch (InvalidDataException x)
catch (Exception x) when (!ExceptionUtil.IsProgrammingDefect(x))
{
throw new LineColNumberedIoException(x.Message, lineNum, -1, x);
}
Expand Down
2 changes: 1 addition & 1 deletion pwiz_tools/Skyline/Model/ImportPeptideSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ private void InitializeUserDefinedTypedMods(SrmDocument document)
public void UpdateModificationMatches(SrmDocument document)
{
_matcher.ClearMatches();
_matcher.CreateMatches(document.Settings, DocLib.Keys, Settings.Default.StaticModList, Settings.Default.HeavyModList);
_matcher.CreateMatches(document.Settings, DocLib.Keys, Settings.Default.StaticModList, Settings.Default.HeavyModList, DocLib.Name);
}

public IEnumerable<StaticMod> GetMatchedMods()
Expand Down
10 changes: 7 additions & 3 deletions pwiz_tools/Skyline/Model/Lib/BiblioSpecLite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,8 @@ private bool ReadFromDatabase(ILoadMonitor loader, IProgressStatus status)
var librarySourceFiles = new List<BiblioLiteSourceInfo>();
bool hasRetentionTimesTable = SqliteOperations.TableExists(_sqliteConnection.Connection, @"RetentionTimes");
int segmentCount = hasRetentionTimesTable ? 2 : 1;
status = status.ChangeSegments(0, segmentCount).ChangeMessage(string.Format(LibResources.BiblioSpecLiteLibrary_ReadFromDatabase_Reading_entries_from__0__library, Path.GetFileName(FilePath)));
var blibFilePath = Path.GetFileName(FilePath);
status = status.ChangeSegments(0, segmentCount).ChangeMessage(string.Format(LibResources.BiblioSpecLiteLibrary_ReadFromDatabase_Reading_entries_from__0__library, blibFilePath));
using (SQLiteCommand select = new SQLiteCommand(_sqliteConnection.Connection))
{
// First get header information
Expand Down Expand Up @@ -833,10 +834,13 @@ private bool ReadFromDatabase(ILoadMonitor loader, IProgressStatus status)
return false;
}

// Remove and report nonsense entries (e.g. adduct removes more H2O than present in molecule)
libraryEntries = FilterInvalidLibraryEntries(ref status, libraryEntries, blibFilePath);

var valueCache = new ValueCache();
if (hasRetentionTimesTable) // Only a filtered library will have this table
{
status = status.ChangeSegments(1, segmentCount).ChangeMessage(string.Format(LibResources.BiblioSpecLiteLibrary_ReadFromDatabase_Reading_retention_times_from__0_, Path.GetFileName(FilePath)));
status = status.ChangeSegments(1, segmentCount).ChangeMessage(string.Format(LibResources.BiblioSpecLiteLibrary_ReadFromDatabase_Reading_retention_times_from__0_, blibFilePath));
var retentionTimeReader = new RetentionTimeReader(FilePath, schemaVer);
retentionTimeReader.ReadAllRows(loader, ref status, rows);
if (loader.IsCanceled)
Expand Down Expand Up @@ -872,7 +876,7 @@ private bool ReadFromDatabase(ILoadMonitor loader, IProgressStatus status)

_librarySourceFiles = librarySourceFiles.ToArray();
_libraryFiles = new LibraryFiles(_librarySourceFiles.Select(file => file.FilePath));
SetLibraryEntries(FilterInvalidLibraryEntries(ref status, libraryEntries.OrderBy(spec=>spec.Id)));
SetLibraryEntries(FilterInvalidLibraryEntries(ref status, libraryEntries.OrderBy(spec=>spec.Id), blibFilePath));
EnsureConnections(sm);
loader.UpdateProgress(status.ChangeSegments(segmentCount - 1, segmentCount).Complete());
return true;
Expand Down
2 changes: 1 addition & 1 deletion pwiz_tools/Skyline/Model/Lib/EncylopeDiaLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ private bool LoadLibraryFromDatabase(ILoadMonitor loader)
var spectrumInfos = libKeySourceFileDatas
.Where(entry => quantPeptides.Contains(entry.Key))
.Select(entry => MakeSpectrumInfo(entry.Key, entry.Value, sourceFileIds));
SetLibraryEntries(FilterInvalidLibraryEntries(ref status, spectrumInfos));
SetLibraryEntries(FilterInvalidLibraryEntries(ref status, spectrumInfos, Path.GetFileName(FilePath)));
_sourceFiles = new LibraryFiles(sourceFiles);
// ReSharper restore PossibleMultipleEnumeration
loader.UpdateProgress(status.Complete());
Expand Down
14 changes: 10 additions & 4 deletions pwiz_tools/Skyline/Model/Lib/Library.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,15 +1142,19 @@ protected virtual void SetLibraryEntries(IEnumerable<TInfo> entries)
_libraryEntries = new LibKeyMap<TInfo>(entryList, entryList.Select(entry=>entry.Key.LibraryKey));
}

protected List<TInfo> FilterInvalidLibraryEntries(ref IProgressStatus status, IEnumerable<TInfo> entries)
// Try to build a precursor from the information in each entry of the library. For those that fail, report the issue
// and remove them from the list of entries.
protected List<TInfo> FilterInvalidLibraryEntries(ref IProgressStatus status, IEnumerable<TInfo> entries, string dataSource)
{
var validEntries = new List<TInfo>();
var invalidKeys = new List<LibKey>();
foreach (var entry in entries)
{
if (!IsValidLibKey(entry.Key))
if (!IsValidLibKey(entry.Key, out var whyNot))
{
invalidKeys.Add(entry.Key);
Messages.WriteAsyncUserMessage(ModelResources.AbstractModificationMatcher_CreateDocNodeFromSettings_In_entry___0___of___1_____2_,
entry.Key, dataSource, whyNot); // Report to immediate window
}
else
{
Expand All @@ -1162,15 +1166,17 @@ protected List<TInfo> FilterInvalidLibraryEntries(ref IProgressStatus status, IE
return validEntries;
}

protected bool IsValidLibKey(LibKey libKey)
protected bool IsValidLibKey(LibKey libKey, out string errorMessage)
{
try
{
errorMessage = null;
var unused = libKey.LibraryKey.CreatePeptideIdentityObj();
return true;
}
catch (Exception)
catch (Exception e)
{
errorMessage = e.Message;
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion pwiz_tools/Skyline/Model/Lib/NistLibSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ private bool CreateCache(ILoadMonitor loader, IProgressStatus status, int percen
libraryEntries.Add(info);
}

libraryEntries = FilterInvalidLibraryEntries(ref status, libraryEntries);
libraryEntries = FilterInvalidLibraryEntries(ref status, libraryEntries, Path.GetFileName(FilePath));

long locationHeaders = outStream.Position;
foreach (var info in libraryEntries)
Expand Down
18 changes: 13 additions & 5 deletions pwiz_tools/Skyline/Model/Lib/SpectrumRanker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,19 @@ public SpectrumRanker(TargetInfo targetInfo, SrmSettings settings,
var ionMasses =
new IonMasses(calcMatch.GetPrecursorFragmentMass(Sequence), IonTable<TypedMass>.EMPTY)
.ChangeKnownFragments(knownFragments);
moleculeMasses =
new MoleculeMasses(
SequenceMassCalc.GetMZ(
calcMatchPre.GetPrecursorMass(Sequence.Molecule, null, PrecursorAdduct,
out _), PrecursorAdduct), ionMasses);
try
{
moleculeMasses =
new MoleculeMasses(
SequenceMassCalc.GetMZ(
calcMatchPre.GetPrecursorMass(Sequence.Molecule, null, PrecursorAdduct,
out _), PrecursorAdduct), ionMasses);
}
catch (InvalidChemicalModificationException)
{
moleculeMasses =
new MoleculeMasses(double.NaN, ionMasses); // Precursor m/z can't be calculated
}
}
else
{
Expand Down
15 changes: 13 additions & 2 deletions pwiz_tools/Skyline/Model/Lib/ViewLibraryPepInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,19 @@ public double CalcMz(SrmSettings settings,
{
TypedMass massH;
if (Target != null)
massH = settings.GetPrecursorCalc(transitionGroup.TransitionGroup.LabelType, mods)
.GetPrecursorMass(Target);
{
if (!Target.IsProteomic)
{
massH = SequenceMassCalc.FormulaMass(BioMassCalc.MONOISOTOPIC,
transitionGroup.PrecursorAdduct.ApplyToMolecule(Target.Molecule.ParsedMolecule));
return SequenceMassCalc.PersistentMZ(SequenceMassCalc.GetMZ(massH, transitionGroup.PrecursorAdduct.AdductCharge));
}
else
{
massH = settings.GetPrecursorCalc(transitionGroup.TransitionGroup.LabelType, mods)
.GetPrecursorMass(Target);
}
}
else
massH = new TypedMass(Key.PrecursorMz ?? 0, MassType.Monoisotopic);
return SequenceMassCalc.PersistentMZ(SequenceMassCalc.GetMZ(massH, transitionGroup.PrecursorAdduct));
Expand Down
2 changes: 1 addition & 1 deletion pwiz_tools/Skyline/Model/Lib/XHunterSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ private bool CreateCache(ILoadMonitor loader, IProgressStatus status, int percen
}
}

libraryEntries = FilterInvalidLibraryEntries(ref status, libraryEntries);
libraryEntries = FilterInvalidLibraryEntries(ref status, libraryEntries, Path.GetFileName(FilePath));

using (FileSaver fs = new FileSaver(CachePath, sm))
using (Stream outStream = sm.CreateStream(fs.SafeName, FileMode.Create, true))
Expand Down
6 changes: 4 additions & 2 deletions pwiz_tools/Skyline/Model/LibKeyModificationMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ public class LibKeyModificationMatcher : AbstractModificationMatcher
public PeptideModifications MatcherPepMods { get; set; }

public void CreateMatches(SrmSettings settings, IEnumerable<LibKey> libKeys,
MappedList<string, StaticMod> defSetStatic, MappedList<string, StaticMod> defSetHeavy)
MappedList<string, StaticMod> defSetStatic, MappedList<string, StaticMod> defSetHeavy,
string libraryName)
{
_dictAAMassPairs = new Dictionary<AATermKey, List<string>>();
_libKeys = libKeys.GetEnumerator();
InitMatcherSettings(settings, defSetStatic, defSetHeavy);
LibraryName = libraryName;
InitMatcherSettings(settings, defSetStatic, defSetHeavy, libraryName);
MatcherPepMods = CreateMatcherPeptideSettings(settings);
}

Expand Down
19 changes: 19 additions & 0 deletions pwiz_tools/Skyline/Model/ModelResources.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pwiz_tools/Skyline/Model/ModelResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -899,4 +899,10 @@ Would you like to continue?
<data name="PersistedViews_GetDefaults_Detailed_Info" xml:space="preserve">
<value>Detailed Info</value>
</data>
<data name="AbstractModificationMatcher_CreateDocNodeFromSettings_In___0_____1_" xml:space="preserve">
<value>In "{0}": {1}</value>
</data>
<data name="AbstractModificationMatcher_CreateDocNodeFromSettings_In_entry___0___of___1_____2_" xml:space="preserve">
<value>In entry "{0}" of "{1}": {2}</value>
</data>
</root>
2 changes: 1 addition & 1 deletion pwiz_tools/Skyline/Model/ModificationMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void CreateMatches(SrmSettings settings, IEnumerable<string> sequences,

_sequences = sequences.GetEnumerator();

InitMatcherSettings(settings, defSetStatic, defSetHeavy);
InitMatcherSettings(settings, defSetStatic, defSetHeavy, null);
if (UnmatchedSequences.Count > 0)
{
UnmatchedSequences.Sort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ public static bool IsParserException(Exception exception)
{
return exception is InvalidOperationException
|| exception is InvalidDataException
|| exception is InvalidChemicalModificationException
|| exception is ArgumentException;
}

Expand Down
4 changes: 3 additions & 1 deletion pwiz_tools/Skyline/SettingsUI/AddModificationsDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public override string ToString()

public LibKeyModificationMatcher Matcher { get; private set; }
private readonly LibKey[] _libKeys;
private readonly string _libraryName;
private readonly HashSet<StaticMod> _userDefinedTypedMods;
private readonly IsotopeLabelType _defaultHeavyLabelType;

Expand All @@ -57,6 +58,7 @@ public AddModificationsDlg(SrmSettings settings, Library library)

Matcher = new LibKeyModificationMatcher();
_libKeys = library.Keys.ToArray();
_libraryName = library.Name;
_userDefinedTypedMods = new HashSet<StaticMod>();
_settings = settings;
NewDocumentModsStatic = new StaticMod[0];
Expand Down Expand Up @@ -94,7 +96,7 @@ private void UpdateModificationMatches()
{
// Update matcher
Matcher.ClearMatches();
Matcher.CreateMatches(_settings, _libKeys, DefaultStatic, DefaultHeavy);
Matcher.CreateMatches(_settings, _libKeys, DefaultStatic, DefaultHeavy, _libraryName);

// Update UI
listMatched.Items.Clear();
Expand Down
Loading