Multiple spectral libraries within the same Skyline doc

support
Multiple spectral libraries within the same Skyline doc lincolnh  2024-12-05 10:51
 

Hi Skyline team,
I have a use case where I'm comparing the performance of several spectral libraries for the same set of raw files. It would be great if I could compare different spectral libraries within the same Skyline document without reimporting the raw files. That is, I want to keep the settings in the doc exactly the same and just compare the results of loading spectral library A vs spectral library B.

I know that I can go to Peptide Settings > Library > Edit to import a new library, but I get the feeling that Skyline doesn't actually update the settings according to the new library. The only way that I've been able to successfully perform this task so far is by creating separate Skyline docs for each library, which is cumbersome and slow.

Is there anyway to do this within the same Skyline doc?

Thanks,
Lincoln

 
 
Nick Shulman responded:  2024-12-05 21:11
I am not sure that I understand your question.
Usually, the observed m/z's in the spectra in the spectral library would affect the set of transitions that you end up with in the Targets tree.
Any time that you change the set of transitions you would need to extract chromatograms again.
What are the differences between your spectral libraries that you might think that you could observe without having to do a reimport?

Your question might be easier to understand if we could see your Skyline document.

In Skyline you can use the menu item:
File > Share
to create a .zip file containing your Skyline document and supporting files including extracted chromatograms and spectral libraries.
Files which are less than 50MB can be attached to these support requests.
You can always upload larger files here:
https://skyline.ms/files.url
-- Nick
 
lincolnh responded:  2024-12-06 15:55
The retention times are different between spectral libraries.

The Skyline file is huge, but I uploaded it to https://skyline.ms/files.url with the name magnet-nettle.sky.zip.
 
Nick Shulman responded:  2024-12-06 18:13
If you have made a change to the settings and want Skyline to detect peaks again and choose the best ones based on the new settings, you should use the "Rescore" button at "Edit > Manage Results".

Does that work for you?
--Nick
 
lincolnh responded:  2024-12-09 16:06
This works perfectly, thanks!
 
lincolnh responded:  2024-12-18 13:28
Mike mentioned that a better way of doing this might just be File > Import > Peak Boundaries, as all I actually want to do is reimport the peak boundaries, and "Rescore" potentially causes Skyline to redo its internal LDA scoring. However, when I try this I get a "Failed reading the file" error message (attached).

I don't think there's anything wrong with my blib files because I'm able to import them otherwise. But I can share a blib file if that would be helpful.
 
Nick Shulman responded:  2024-12-18 13:46
When you do "File > Import > Peak Boundaries" the file needs to be a tab or comma separated text file.

.blib files are SQLite databases, not text files, so the Import Peak Boundaries menu item does not know what to do with it.
If your spectral library contains explicit peak boundaries, it would be straightforward to write a SQL query to export those peak boundaries into the format that Skyline is expecting.

Can you send me your Skyline document as well as your .blib file.
In Skyline you can use the menu item:
File > Share
to create a .zip file containing your Skyline document and supporting files including spectral libraries extracted chromatograms.

Files which are less than 50MB can be attached to these support requests.
You can always upload larger files here:
https://skyline.ms/files.url

If the library has a checkmark next to it at "Settings > Peptide Settings > Libraries" then the .zip file will contain the .blib file. Otherwise, you can upload it separately.
-- Nick
 
lincolnh responded:  2024-12-18 20:27
Ok, I've uploaded my Skyline doc along with two blibs that I'd like to be able to switch between. The file name is outlier-filt-mini.sky.zip.

What are the fields in the file that Skyline is expecting here? If this is a matter of exporting my blib file to a csv, then that seems doable.
 
Nick Shulman responded:  2024-12-18 21:34

Here's the SQL statement that you can use to get a CSV file with peak boundaries from a .blib file:

SELECT rt.startTime MinStartTime, 
    rt.endTime MaxEndTime, 
    CONCAT(ssf.fileName, ".raw") FileName, 
    rs.peptideModSeq PeptideModifiedSequence
FROM RetentionTimes rt 
INNER JOIN SpectrumSourceFiles ssf ON rt.SpectrumSourceID = ssf.id 
INNER JOIN RefSpectra rs ON rt.RefSpectraId = rs.id 
WHERE rt.startTime IS NOT NULL;

I have attached the peak boundaries CSV files that I made from your .blib files. You can use them with the "File > Import > Peak Boundaries" menu item.

With the "rowmeansPeakBoundaries.csv" file Skyline gives me a message about forty thousand peptides not being matched to anything in the document. I ignored that message and it seemed like a lot of peak boundaries got changed but let me know if you want me to figure out what is going on with that message.

By the way, there are a couple of columns in the "RetentionTimes" table that have null in them which is causing problems for Skyline when you try to view the Library Explorer.
You could run the following SQL statements to fix that:

ALTER TABLE RetentionTimes DROP COLUMN RedundantRefSpectraID;
UPDATE RetentionTimes Set bestSpectrum = 0 where bestSpectrum IS NOT NULL;

-- Nick

 
Nick Shulman responded:  2024-12-18 21:35

Here's the SQL statement that you can use to get a CSV file with peak boundaries from a .blib file:

SELECT rt.startTime MinStartTime, 
    rt.endTime MaxEndTime, 
    CONCAT(ssf.fileName, ".raw") FileName, 
    rs.peptideModSeq PeptideModifiedSequence
FROM RetentionTimes rt 
INNER JOIN SpectrumSourceFiles ssf ON rt.SpectrumSourceID = ssf.id 
INNER JOIN RefSpectra rs ON rt.RefSpectraId = rs.id 
WHERE rt.startTime IS NOT NULL;

I have attached the peak boundaries CSV files that I made from your .blib files. I had to package them in zip files to get under the 50MB file size limit. After you unzip them you can use them with the "File > Import > Peak Boundaries" menu item.

With the "rowmeansPeakBoundaries.csv" file Skyline gives me a message about forty thousand peptides not being matched to anything in the document. I ignored that message and it seemed like a lot of peak boundaries got changed but let me know if you want me to figure out what is going on with that message.

By the way, there are a couple of columns in the "RetentionTimes" table that have null in them which is causing problems for Skyline when you try to view the Library Explorer.
You could run the following SQL statements to fix that:

ALTER TABLE RetentionTimes DROP COLUMN RedundantRefSpectraID;
UPDATE RetentionTimes Set bestSpectrum = 0 where bestSpectrum IS NOT NULL;

-- Nick