Issue 717: Improve handling of unknown adducts in small molecule transition reader (exception on seeing adduct "[+]" not caught gracefully)

issues
Status:open
Assigned To:Brian Pratt
Type:Defect
Area:Skyline
Priority:3
Milestone: 
Opened:2020-02-11 by Brian Pratt
Changed:2020-02-11 by Brian Pratt
Resolved:
Resolution:
Closed:
2020-02-11 Brian Pratt
Title»Improve handling of unknown adducts in small molecule transition reader (exception on seeing adduct "[+]" not caught gracefully)
Assigned ToGuest»Brian Pratt
Type»Defect
Area»Skyline
Priority»3
We should probably just recognize "[+]" as meaning "[M+]" but we should also be more graceful.


From https://skyline.ms/announcements/home/issues/exceptions/thread.view?entityId=32b34c35-2e82-1038-af43-e465a393dc59&_anchor=43919#row:43919

Skyline version: 20.1.0.31-f09d9bed5 (64-bit)
Installation ID: fd0e7ec2-d5c9-4cbc-9126-7e90362f03ee
Exception type: InvalidOperationException
Error message: Failed parsing adduct description "[+]"

--------------------

Stack trace:

   at pwiz.Skyline.Util.Adduct.ParseDescription(String input) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Util\Adduct.cs:line 459
   at pwiz.Skyline.Util.Adduct..ctor(String description, ADDUCT_TYPE integerMode, Nullable`1 explicitCharge) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Util\Adduct.cs:line 153
   at pwiz.Skyline.Util.Adduct.FromString(String value, ADDUCT_TYPE parserMode, Nullable`1 explicitCharge) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Util\Adduct.cs:line 569
   at pwiz.Skyline.Util.Adduct.FromStringAssumeChargeOnly(String value) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Util\Adduct.cs:line 542
   at pwiz.Skyline.Util.Adduct.ChangeCharge(Int32 newCharge) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Util\Adduct.cs:line 796
   at pwiz.Skyline.Model.SmallMoleculeTransitionListReader.ReadPrecursorOrProductColumns(SrmDocument document, Row row, ParsedIonInfo precursorInfo) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Model\SmallMoleculeTransitionListReader.cs:line 1223
   at pwiz.Skyline.Model.SmallMoleculeTransitionListReader.GetRequireProductInfo(SrmDocument document) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Model\SmallMoleculeTransitionListReader.cs:line 371
   at pwiz.Skyline.Model.SmallMoleculeTransitionListReader.CreateTargets(SrmDocument document, IdentityPath to, IdentityPath& firstAdded) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Model\SmallMoleculeTransitionListReader.cs:line 124
   at pwiz.Skyline.EditUI.PasteDlg.AddTransitionList(SrmDocument document, IdentityPath& selectedPath) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\EditUI\PasteDlg.cs:line 615
   at pwiz.Skyline.EditUI.PasteDlg.GetNewDocument(SrmDocument document, Boolean validating, IdentityPath& selectedPath, List`1& newPeptideGroups) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\EditUI\PasteDlg.cs:line 247
   at pwiz.Skyline.EditUI.PasteDlg.GetNewDocument(SrmDocument document, Boolean validating, IdentityPath& selectedPath) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\EditUI\PasteDlg.cs:line 227
   at pwiz.Skyline.EditUI.PasteDlg.ValidateCells() in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\EditUI\PasteDlg.cs:line 219
   at pwiz.Skyline.EditUI.PasteDlg.btnValidate_Click(Object sender, EventArgs e) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\EditUI\PasteDlg.cs:line 213
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Exception caught at:
   at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   at System.Windows.Forms.Control.WndProcException(Exception e)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at pwiz.Skyline.SkylineWindow.ShowPasteTransitionListDlg() in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Skyline.cs:line 2548
   at pwiz.Skyline.SkylineWindow.insertTransitionListMenuItem_Click(Object sender, EventArgs e) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Skyline.cs:line 2537
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at pwiz.Skyline.Program.Main(String[] args) in C:\proj\skyline_20_1_x64\pwiz_tools\Skyline\Program.cs:line 305