mobiusklein / ms_deisotope

A library for deisotoping and charge state deconvolution of complex mass spectra
https://mobiusklein.github.io/ms_deisotope
Apache License 2.0
33 stars 14 forks source link

Wrong case for keys in "inlet_map" #16

Closed domdfcoding closed 4 years ago

domdfcoding commented 4 years ago

Our version of Agilent MassHunter produces ".d" files where the value for the inlet is "ESI", but the key in the inlet_map dictionary (ms_deisotope/data_source/_vendor/AgilentD.py, line 161) is "Esi", so the lookup fails.

The ionization_map dictionary in the same file has "ESI" in capitals, which makes me think this is just a typo. As far as I can tell the same value gets used for the lookups in both dictionaries, so the keys should match in both dicts, and indeed the rest of the keys do.

Happy to submit a pull request for this if it will help.

mobiusklein commented 4 years ago

Thank you for pointing that out. The Agilent reader is probably the least exercised of the readers I have implemented, particularly the instrument metadata layer.

I believe you're correct about the typo. The way the logic flows, any key from ion_mode_map has to have a match in ionization_map and inlet_map. However, because I can't test this currently, lacking access to both the Agilent DLLs and a convenient data file, I've made all of the dictionaries in AgilentD case-insensitive instead.

If you have the system setup and wouldn't mind testing, that would be appreciated. The fix is in commit aef9ce70707ff7a0cab2347fa7e354fcb01ca870 on master

mobiusklein commented 4 years ago

It turns out that AgilentD hadn't been updated to include new abstract methods. Please use commit 3e9dffe47d82fd0408f7508118a7e9ae497dcf05 on master instead.

mobiusklein commented 4 years ago

I've set up the Agilent vendor libraries locally and I think I've tested sufficiently to close this. If I haven't, please feel free to re-open.