Add mass spectra centroidisation#2704
Add mass spectra centroidisation#2704eselmeister merged 4 commits intoeclipse-chemclipse:developfrom
Conversation
c6eeff7 to
a463721
Compare
| if(processingInfo.hasErrorMessages()) { | ||
| return processingInfo; | ||
| } | ||
| if(scanMSD instanceof IStandaloneMassSpectrum massSpectrum) { |
There was a problem hiding this comment.
Why don't you use XPassFilter.nominalize(...); here?
There was a problem hiding this comment.
Because this is designed for MALDI-ToF MS. Nominalizing would remove all the precision. Also, if you want to nominalize beforehand, you could just run that filter separately. It does not make sense to combine the two.
| } | ||
| massSpectrum.removeAllIons(); | ||
| for(IMassSpectrumPeak massSpectrumPeak : massSpectrum.getPeaks()) { | ||
| IIon ion = new Ion(massSpectrumPeak.getIon(), (float)massSpectrumPeak.getAbundance()); |
There was a problem hiding this comment.
The above XPassFilter does the trick already. If not used, getIon() could return a double with decimals here, that needs to be casted to Integer e.g. via AbstractIon.getIon(mz). But then it needs to be checked, that the intensities of e.g. 56.12 and 56.16 are summed.
There was a problem hiding this comment.
I don't want to round ions here. Just convert profile to centroid. The centroided one can then be used for identification next step.
|
OK, I got it. |
This converts profile to centroided spectra based on detected peaks. Oftentimes this process means peak picking and then converting the spectra in one go, but I want to separate the two as we may want to try multiple peak picking algorithms. I also want people to preview the picked peaks on the profile spectrum to judge the result. Centroidization will then also be an additional, destructive, shared step. We already have process methods to orchestrate everything into one again.