Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…5625 be a little more tolerant of data variants:

In SSL, accept "scan=<number>" as meaning just <number>
In mzML reader, accept MS2 scans that lack precursor values
  • Loading branch information
bspratt committed Jan 3, 2025
1 parent 64137c6 commit 2bd7ab8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pwiz_tools/BiblioSpec/src/PwizReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ void PwizReader::transferSpec(BiblioSpec::SpecData& returnData,

returnData.id = specInfo->scanNumber;
returnData.retentionTime = specInfo->retentionTime/60; // seconds to minutes
if (specInfo->msLevel > 1)
if (specInfo->msLevel > 1 && !specInfo->precursors.empty())
{
returnData.mz = specInfo->precursors[0].mz;
}
Expand Down
5 changes: 5 additions & 0 deletions pwiz_tools/BiblioSpec/src/SslReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class sslPSM : public PSM {
} catch (bad_lexical_cast) {
if (bal::istarts_with(value, "index="))
psm.specIndex = boost::lexical_cast<int>(value.substr(6));
else if (bal::istarts_with(value, "scan="))
{
psm.specKey = boost::lexical_cast<int>(trimLeadingZeros(value.substr(5)));
psm.specIndex = -1;
}
else
psm.specName = value;
}
Expand Down

0 comments on commit 2bd7ab8

Please sign in to comment.