-
Notifications
You must be signed in to change notification settings - Fork 100
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
Extension of bruker precursor information (2nd attempt) #3191
base: master
Are you sure you want to change the base?
Conversation
ac53357
to
3ab4cff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better! Still a bit of work to do though.
pwiz/data/msdata/Serializer_MGF.cpp
Outdated
@@ -132,6 +132,16 @@ void Serializer_MGF::Impl::write(ostream& os, const MSData& msd, | |||
os << " " << intensityParam.valueFixedNotation(); | |||
os << '\n'; | |||
|
|||
CVParam inverseReduceIonMobility = scan->cvParam(MS_inverse_reduced_ion_mobility); | |||
if (!inverseReduceIonMobility.empty()) | |||
os << "INVREION=" << inverseReduceIonMobility.valueFixedNotation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check whether some official product already writes it this way? Because according to the official MGF spec this is not a valid parameter. https://www.matrixscience.com/help/data_file_help.html
It should be ION_MOBILITY= and it has a weird format that reproduces the PEPMASS parameter for some reason (see the link). I don't see why 1/k0 needs a separate parameter if an official one already exists. Except maybe for being sure of what kind of ion mobility is being recorded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I´ll check this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope it´s done now. :-)
pwiz/data/msdata/Serializer_MGF.cpp
Outdated
|
||
CVParam collisionalCrossSectionalArea = scan->cvParam(MS_collisional_cross_sectional_area); | ||
if (!collisionalCrossSectionalArea.empty()) | ||
os << "COLLCROSSSA=" << collisionalCrossSectionalArea.valueFixedNotation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no official MGF parameter for this. I would be more comfortable with this in the TITLE string, unless a Bruker product is already writing MGFs this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, Is there an example of adding some parameters to the title string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a titleMaker filter that allows for easy customization of the MGF title string with a user-defined format. Although it doesn't support CCS currently, only instrument-level ion mobility metrics. If you don't want to use that, you can add "ccs=" to the title string above this, before the line:
if (!scanTimeParam.empty())
os << "RTINSECONDS=" << scanTimeParam.timeInSeconds() << '\n';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that sounds good, I'll implement it that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be finished.
pwiz/data/msdata/Serializer_MGF.cpp
Outdated
static unsigned int precision(T) { return 10; } | ||
// we want the numbers always to be in fixed format | ||
static int floatfield(T) { return boost::spirit::karma::real_policies<T>::fmtflags::fixed; } | ||
template <typename T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert whitespace only change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I´ll fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed.
pwiz/data/msdata/Serializer_MGF.cpp
Outdated
if (continueOnError) | ||
{ | ||
{ | ||
SpectrumPtr s; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert whitespace only change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing whitespace changes here. You know how to review the diff in GitHub? You can also review it locally if you set your diff engine to show whitespace changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, sorry, but unfortunately it's not finished yet. Yes, It's easy to see whitespace changes, but undoing them without removing other important things is a bit difficult for me. But I´m on it. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespaces should now be removed.
@@ -535,7 +535,7 @@ void write_precursors(XMLWriter& xmlWriter, const vector<PrecursorInfo>& precurs | |||
attributes.add("activationMethod", it->activation); | |||
if (it->windowWideness != 0) | |||
attributes.add("windowWideness", it->windowWideness); | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert whitespace only changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Okay, thank you very much. I really appreciate that. I would try to fix the things you mentioned. |
bal::trim(value); | ||
scan.cvParams.push_back(CVParam(MS_inverse_reduced_ion_mobility, value, MS_volt_second_per_square_centimeter)); | ||
} | ||
else if (name == "COLLCROSSSA") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When moving CCS to the title, it can be parsed back in the name == TITLE
block above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -862,21 +854,16 @@ void TimsSpectrum::getIsolationData(std::vector<IsolationInfo>& isolationInfo) c | |||
if (HasPasefPrecursorInfo()) | |||
{ | |||
const auto& info = GetPasefPrecursorInfo(); | |||
isolationInfo.resize(1, IsolationInfo{ | |||
info.isolationMz, IsolationMode_On, info.collisionEnergy, | |||
info.intensity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You reverted your intensity population here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for finding this. I will fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
913253a
to
bb1a8ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add ion mobility and CCS cvParams in Serializer_MGF_Test so this new code gets tested. Maybe for just one of the spectra there so it gets tested with an without.
@chambm Thank´s for your review and comment. yes, okay, I´ll write some tests. |
You don't need to add any new test, just update the existing one in Serializer_MGF_Test by adding the cvParams to one of the spectra there. |
@chambm okay. |
@@ -228,14 +228,17 @@ struct PWIZ_API_DECL DiffConfig : public pwiz::data::BaseDiffConfig | |||
|
|||
bool ignoreDataProcessing; | |||
|
|||
bool ignoreSpectrumTitle; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary? I would expect the new CCS-in-title code to round trip the CCS so the title will be preserved and not different. What diffs were you getting without this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, unfortunately it is different. The serializer writes it into the title string, but the reference does not contain the text ‘ccs=...’. But this reference is used for both - reading and writing.
The other cases of code where the title is extended too seem not to run through the test, so it was not a problem there.
@@ -379,6 +379,9 @@ class SpectrumList_MGFImpl : public SpectrumList_MGF | |||
} | |||
} | |||
|
|||
if(ccsStr.empty()) | |||
ccsStr = title.substr(start, title.length() - start); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be simplified to:
const size_t end = title.length();
for(int i=0; i< sizeof(endTags)/sizeof(endTags[0]); i++)
{
const size_t tmpEnd = title.find(endTags[i], start);
if(tmpEnd != string::npos)
{
end = tmpEnd;
break;
}
}
ccsStr = title.substr(start, end - start);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, looks good, I change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Extension of the analysis of Bruker files (precursor information) based on the timsconvert Python code
MS_inverse_reduced_ion_mobility, MS_collisional_cross_sectional_area, MS_peak_intensity.
lowest observed mz and highest observed mz included