Issue 959: Improve error message for BlibBuild failures

issues
Status:resolved
Assigned To:Brendan MacLean
Type:Todo
Area:Skyline
Priority:2
Milestone:23.1
Opened:2023-06-12 08:29 by Brendan MacLean
Changed:2023-07-18 07:18 by Matt Chambers
Resolved:2023-07-18 07:18 by Matt Chambers
Resolution:Fixed
Closed:
2023-06-12 08:29 Brendan MacLean
Title»Improve error message for BlibBuild failures
Assigned To»Matt Chambers
Type»Todo
Area»Skyline
Priority»2
Milestone»23.1
A user reported the following error to the support board:

System.IO.IOException: ERROR: No spectra were found for the new library.

Command-line: C:\Windows\system32\BlibBuild -s -A -H -o -c 0.95 -i spectral_library_PXD003533 -S "C:\Users\USER\AppData\Local\Temp\tmp63F3.tmp" "D:\PXD003533(189)\spectral_library_PXD003533.redundant.blib"
Working directory: D:\PXD003533(189)
위치: pwiz.Common.SystemUtil.ProcessRunner.Run(ProcessStartInfo psi, String stdin, IProgressMonitor progress, IProgressStatus& status, TextWriter writer, ProcessPriorityClass priorityClass) 파일 C:\proj\skyline_22_2\pwiz_tools\Shared\Common\SystemUtil\ProcessRunner.cs:줄 161
위치: pwiz.BiblioSpec.BlibBuild.BuildLibrary(LibraryBuildAction libraryBuildAction, IProgressMonitor progressMonitor, IProgressStatus& status, String& commandArgs, String& messageLog, String[]& ambiguous) 파일 C:\proj\skyline_22_2\pwiz_tools\Shared\BiblioSpec\BlibBuild.cs:줄 412
위치: pwiz.Skyline.Model.Lib.BiblioSpecLiteBuilder.BuildLibrary(IProgressMonitor progress) 파일 C:\proj\skyline_22_2\pwiz_tools\Skyline\Model\Lib\BiblioSpecLiteBuilder.cs:줄 161.

Clearly there is useful information in C:\Users\USER\AppData\Local\Temp\tmp63F3.tmp that is not captured in this message. It seems like we should probably dump the contents of the temp file into the message text to improve our ability to respond to this error report.

2023-07-14 07:10 Matt Chambers
I've been working on improving these messages. The tmpfile is the standard input being passed in as a file, so it's the filenames and score cutoffs. That is of course useful for reproducing the command but not clearly useful for understanding the cause of a "No spectra were found" error.

I think what happened here is the mzIdentML parser isn't executing the code that would give a status log message if no PSMs passed the score threshold. I will fix that. However, the easiest way to implement the fix so that it's visible from Skyline would be to immediately error when an input file has no matches passing the threshold. Currently it only does a status log message which I don't think would be visible from Skyline. I'm not sure if there's a historical reason for not erroring here. Perhaps because when it's importing file types that can contain multiple runs, we need to allow some of those runs to have no matches while other runs do have matches? This is the code:

void BuildParser::buildTables(PSM_SCORE_TYPE scoreType, string specFilename, bool showSpecProgress) {
    // return if no psms for this file
    if( psms_.size() == 0 ) {
        Verbosity::status("No matches passed score filter in %s. %d matches did not pass filter.", curSpecFileName_.c_str(), filteredOutPsmCount_ );
        curSpecFileName_.clear();
        if( fileProgress_ ) {
            if( fileProgressIncrement_ == 0 ){
                fileProgress_->increment();
            } else {
                fileProgress_->add(fileProgressIncrement_);
            }
        }
        return;
    }

2023-07-18 07:18 Matt Chambers
resolve as Fixed
Statusopen»resolved
Assigned ToMatt Chambers»Brendan MacLean
Fixed in https://github.com/ProteoWizard/pwiz/pull/2664

I decided to keep the non-fatal behavior of the "no matches passing threshold" log message, but I made it a warning and I made warnings show up in the dialog when Skyline runs BlibBuild and the command fails.