Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- fixed BiblioSpec to use spectrumNativeID in MSFragger pepXML #2856

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 13 additions & 7 deletions pwiz_tools/BiblioSpec/src/PepXMLreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,22 @@ void PepXMLreader::startElement(const XML_Char* name, const XML_Char** attr)
}
// if morpheus or msfragger type
else if (analysisType_ == MORPHEUS_ANALYSIS || analysisType_ == MSFRAGGER_ANALYSIS || parentAnalysisType_ == MSFRAGGER_ANALYSIS) {
spectrumName = getRequiredAttrValue("spectrum", attr);
spectrumName = getAttrValue("spectrumNativeID", attr);
scanNumber = getIntRequiredAttrValue("start_scan", attr);
scanIndex = scanNumber - 1;

// HACK: remove zero padding of scan numbers in the spectrum attribute title because MSFragger MGF files don't have padding
if (lookUpBy_ == NAME_ID && (analysisType_ == MSFRAGGER_ANALYSIS || parentAnalysisType_ == MSFRAGGER_ANALYSIS))
{
namespace bxp = boost::xpressive;
auto scanNumberPaddingRegex = bxp::sregex::compile("(.*?\\.)0*(\\d+\\.)0*(\\d+\\.\\d+)");
spectrumName = bxp::regex_replace(spectrumName, scanNumberPaddingRegex, "$1$2$3");
if (!spectrumName.empty()) {
lookUpBy_ = NAME_ID;
}
else {
spectrumName = getRequiredAttrValue("spectrum", attr);
// HACK: remove zero padding of scan numbers in the spectrum attribute title because MSFragger MGF files don't have padding
if (lookUpBy_ == NAME_ID && (analysisType_ == MSFRAGGER_ANALYSIS || parentAnalysisType_ == MSFRAGGER_ANALYSIS))
{
namespace bxp = boost::xpressive;
auto scanNumberPaddingRegex = bxp::sregex::compile("(.*?\\.)0*(\\d+\\.)0*(\\d+\\.\\d+)");
spectrumName = bxp::regex_replace(spectrumName, scanNumberPaddingRegex, "$1$2$3");
}
}
}
// this should never happen, error should have been thrown earlier
Expand Down
5 changes: 3 additions & 2 deletions pwiz_tools/BiblioSpec/tests/Jamfile.jam
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ blib-test-build comet : -o : output/comet.blib : comet.check zbuild.skip-lines :
blib-test-build comet-prg2012-wiff : -o -c@0 : output/comet-prg2012-wiff.blib : comet-prg2012-wiff.check zbuild.skip-lines : $(TEST_INPUTS_PATH)/201208-378803-cm.pep.xml : <vendor-api-support>off:<build>no ;
blib-test-build msfragger-tims : -o : output/msfragger-tims.blib : msfragger-tims.check : "$(TEST_INPUTS_PATH)/Hela$(.percent)20QC_PASEF_Slot1-5_01_57_cutout_2min.pepXML" ;
blib-test-build msfragger-thermo : -o : output/msfragger-thermo.blib : msfragger-thermo.check : $(TEST_INPUTS_PATH)/BSA_min_21.pepXML ;
blib-test-build peptideprophet-msfragger-thermo-mzml : -o : output/peptideprophet-msfragger-thermo-mzml.blib : peptideprophet-msfragger-thermo-mzml.check : $(TEST_INPUTS_PATH)/peptideprophet-msfragger-thermo-mzml.pep.xml ;
blib-test-build peptideprophet-msfragger-bruker-mgf : -o : output/peptideprophet-msfragger-bruker-mgf.blib : peptideprophet-msfragger-bruker-mgf.check : $(TEST_INPUTS_PATH)/peptideprophet-msfragger-bruker-mgf.pep.xml ;
blib-test-build-basic peptideprophet-msfragger-thermo-mzml : -o : $(TEST_INPUTS_PATH)/peptideprophet-msfragger-thermo-mzml.pep.xml ;
blib-test-build-basic peptideprophet-msfragger-thermo-mzml-nativeid : -o : $(TEST_INPUTS_PATH)/peptideprophet-msfragger-thermo-mzml-nativeid.pep.xml ;
blib-test-build-basic peptideprophet-msfragger-bruker-mgf : -o : $(TEST_INPUTS_PATH)/peptideprophet-msfragger-bruker-mgf.pep.xml ;
blib-test-build-basic msfragger-check-parent-path-first : -o : $(TEST_INPUTS_PATH)/msfragger-check-parent-path-first.pepXML ;
blib-test-build-basic msfragger-check-parent-path-first-with-missing-file : -o -e@inputs$(.slash)msfragger-check-parent-path-first : $(TEST_INPUTS_PATH)/msfragger-check-parent-path-first-with-missing-file.pepXML ;

Expand Down