Publishing Skyline document in Panorama error (small molecule spectral library)

support
Publishing Skyline document in Panorama error (small molecule spectral library) Chris Ashwood  2018-09-05 09:32
 
Dear Skyline Team,

I hope you are all well. When I attempt to publish a Skyline (daily) assay containing a small molecule spectral library via Panorama, I encounter an error:
---------------------------
Skyline-daily
---------------------------
Failed attempting to create sharing file W:\Sanitized\180905_CM_NG_2018-09-05_11-21-22.sky.zip.
Unable to cast object of type 'pwiz.Skyline.Model.Lib.BlibData.DbRefSpectraPeakAnnotations' to type 'pwiz.Skyline.Model.Lib.BlibData.DbRefSpectraPeakAnnotationsRedundant'.
---------------------------
OK More Info
---------------------------
System.Reflection.TargetInvocationException: Unable to cast object of type 'pwiz.Skyline.Model.Lib.BlibData.DbRefSpectraPeakAnnotations' to type 'pwiz.Skyline.Model.Lib.BlibData.DbRefSpectraPeakAnnotationsRedundant'. ---> System.InvalidCastException: Unable to cast object of type 'pwiz.Skyline.Model.Lib.BlibData.DbRefSpectraPeakAnnotations' to type 'pwiz.Skyline.Model.Lib.BlibData.DbRefSpectraPeakAnnotationsRedundant'.
   at (Object , GetterCallback )
   at NHibernate.Tuple.Entity.PocoEntityTuplizer.GetPropertyValuesToInsert(Object entity, IDictionary mergeMap, ISessionImplementor session)
   at NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.SaveOrUpdate(String entityName, Object obj)
   at NHibernate.Engine.Cascade.CascadeToOne(Object parent, Object child, IType type, CascadeStyle style, Object anything, Boolean isCascadeDeleteEnabled)
   at NHibernate.Engine.Cascade.CascadeCollectionElements(Object parent, Object child, CollectionType collectionType, CascadeStyle style, IType elemType, Object anything, Boolean isCascadeDeleteEnabled)
   at NHibernate.Engine.Cascade.CascadeCollection(Object parent, Object child, CascadeStyle style, Object anything, CollectionType type)
   at NHibernate.Engine.Cascade.CascadeAssociation(Object parent, Object child, IType type, CascadeStyle style, Object anything, Boolean isCascadeDeleteEnabled)
   at NHibernate.Engine.Cascade.CascadeOn(IEntityPersister persister, Object parent, Object anything)
   at NHibernate.Event.Default.AbstractSaveEventListener.CascadeAfterSave(IEventSource source, IEntityPersister persister, Object entity, Object anything)
   at NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.FireSave(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.Save(Object obj)
   at pwiz.Skyline.Model.Lib.BlibData.BlibDb.SaveRedundantSpectra(ISession sessionRedundant, IEnumerable`1 redundantSpectraIds, IDictionary`2 dictFiles, DbRefSpectra refSpectra, Library library, ISet`1 savedSpectraIds) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Model\Lib\BlibData\BlibDb.cs:line 602
   at pwiz.Skyline.Model.Lib.BlibData.BlibDb.MinimizeLibrary(BiblioSpecLiteSpec librarySpec, Library library, SrmDocument document, IDictionary`2 smallMoleculeConversionMap) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Model\Lib\BlibData\BlibDb.cs:line 501
   at pwiz.Skyline.Model.Lib.BlibData.BlibDb.MinimizeLibrariesHelper(SrmDocument document, String pathDirectory, String nameModifier, IDictionary`2 smallMoleculeConversionInfo, Dictionary`2 dictOldNameToNew, IProgressMonitor progressMonitor) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Model\Lib\BlibData\BlibDb.cs:line 1026
   at pwiz.Skyline.Model.SrmDocumentSharing.ShareMinimal(ZipFileShare zip) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Model\SrmDocumentSharing.cs:line 287
   at pwiz.Skyline.Model.SrmDocumentSharing.Share(IProgressMonitor progressMonitor) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Model\SrmDocumentSharing.cs:line 187
   at pwiz.Skyline.Controls.LongWaitDlg.RunWork(Action`1 performWork) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Controls\LongWaitDlg.cs:line 228
   --- End of inner exception stack trace ---
   at pwiz.Skyline.Util.Helpers.WrapAndThrowException(Exception x) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Util\Util.cs:line 1846
   at pwiz.Skyline.Controls.LongWaitDlg.PerformWork(Control parent, Int32 delayMillis, Action`1 performWork) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Controls\LongWaitDlg.cs:line 176
   at pwiz.Skyline.Controls.LongWaitDlg.PerformWork(Control parent, Int32 delayMillis, Action`1 performWork) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Controls\LongWaitDlg.cs:line 131
   at pwiz.Skyline.SkylineWindow.<>c__DisplayClass16a.<ShareDocument>b__167() in c:\proj\pwiz_x64\pwiz_tools\Skyline\SkylineFiles.cs:line 1140
   at pwiz.Skyline.Util.Helpers.Try[TEx](Action action, Int32 loopCount, Int32 milliseconds) in c:\proj\pwiz_x64\pwiz_tools\Skyline\Util\Util.cs:line 1818
   at pwiz.Skyline.SkylineWindow.ShareDocument(String fileDest, ShareType shareType) in c:\proj\pwiz_x64\pwiz_tools\Skyline\SkylineFiles.cs:line 1143
---------------------------

I do not encounter this issue when I instead Share the document in a complete format, so I'm guessing it is specific to the Panorama import. This is a sensitive dataset so I can email it if you would like the Skyline assay files.

Cheers,
Chris
 
 
Brian Pratt responded:  2018-09-05 11:42
Hi Chris,

Please do send the files.

Ideally, you would verify that you can use File>Share>Complete to create a .sky.zip file, then read that back in ever an empty document, then reproduce the problem from there. Then send us that .sky.zip file by whatever means you like.

Thanks

Brian
 
Chris Ashwood responded:  2018-09-05 11:50
Hi Brian,

Thank you for the quick follow-up. Opening up the file to an empty document has the same error so the zip file has been sent.

Cheers,
Chris
 
Nick Shulman responded:  2018-09-05 13:34
Thank you for sending us your files.

It looks like this bug happens whenever you have a redundant library, and there are any peak annotations in the spectral library.
Peak annotations tell Skyline the meaning of the m/z values in a spectrum. They are only important for small molecules, because for Peptides, Skyline can always figure out which m/z is the y7 ion, etc.

I am a little confused by the .blib file and .redundant.blib files that are in your .sky.zip:
831,488 bytes CA_Dextran_Library_3_13.blib
 86,016 bytes CA_Dextran_Library_3_13.redundant.blib
For some reason, the .redundant.blib file is smaller than the regular .blib, which I do not believe is possible since the .blib is obtained by removing things from the .redundant.blib.

Can you tell me how you created that .blib file? It would be helpful if you could send me whatever files you used to create that .blib, so I can make sure that Skyline is not doing anything wrong at that step.

If you want to work around this bug, and be able to minimize your Skyline document, you can delete the file "CA_Dextran_Library_3_13.redundant.blib". (Also, you can always upload your non-minimized .sky.zip to Panorama by visiting the Panorama website in a browser).

Thanks!
-- Nick
 
Chris Ashwood responded:  2018-09-05 13:59
Hi Nick,

Thanks for following up on this. This library was built essentially built manually from an SSL file, run through bibliospec to generate a blib/redundant.blib and then each annotation was added into the blib file using sqlite. Unlike the blib file, I believe I did not modify the redundant.blib file with the peak annotations so that is likely the cause of the size discrepancy.

I've followed your suggestion regarding deleting redundant.blib and this appears to have worked well in importing the data to Panorama. Since I've caused this issue by not modifying the redundant.blib file to be consistent with the corresponding blib file, it appears to be a PICNIC error and nothing to do with a Skyline bug!

Cheers,
Chris