pyopenms-docs icon indicating copy to clipboard operation
pyopenms-docs copied to clipboard

correction charge in mzML file

Open neel-lab opened this issue 1 year ago • 2 comments

What is the type of your request?

  • [ ] Incomplete / missing
  • [ ] Typo
  • [x] Unclear
  • [ ] Not reproducible

Include a description of your report

I am trying to use PrecursorCorrection function to correct for unassigned charge in my .raw file that is now converted to mzML using preoteowizard. I followed documentation at https://pyopenms.readthedocs.io/en/latest/apidocs/_autosummary/pyopenms/pyopenms.PrecursorCorrection.html

Here is the code I used: pc = oms.PrecursorCorrection() corrected_indices = pc.correctToNearestFeature(oms.FeatureMap(), centroided_exp, rt_tolerance_s=0, mz_tolerance=5, ppm=True, believe_charge=False, keep_original=False, all_matching_features=False, max_trace=2, debug_level=0)

I basically set believe_charge to False, and guessed what the other parameter values may be as there was no example in the documentation. The code runs without error but it does not rectify errors that exist in the original .raw file. Can you please provide a suggestion on what maybe my error. Thanks!

neel-lab avatar May 28 '24 20:05 neel-lab

Hi!

I think the confusion comes from the fact that this type of precursor correction uses isotopic trace information of complete MS1 features. For this to work, you actually have to fill the FeatureMap first (i.e. Run one of the feature finders on it first).

I am not sure if we currently have an MS1-agnostic corrector @timosachsenberg

jpfeuffer avatar May 29 '24 06:05 jpfeuffer

MSConvert features a simple charge state predictor algorithm that can be added as a filter for unassigned precursor charges: image

Might be worth a try.

timosachsenberg avatar May 29 '24 07:05 timosachsenberg