compomics / psm_utils

Common utilities for parsing and handling peptide-spectrum matches and search engine results in Python
https://psm-utils.readthedocs.io
Apache License 2.0
25 stars 7 forks source link

Updating metaValues of PeptideHits with numpy objects crashes in idxml writer #60

Closed jonasscheid closed 1 year ago

jonasscheid commented 1 year ago

After rescoring with ms2rescore the rescoring_features values can contain various types:

{<class 'numpy.int8'>, <class 'float'>, <class 'numpy.float32'>, <class 'numpy.float64'>, <class 'int'>, <class 'numpy.int64'>}

PeptideHit.setMetaValues however, does only allow in_1: int | float | bytes | str | List[int] | List[float] | List[bytes] as values. This then causes errors when writing / updating idXML files.

I suggest converting to float if value is not type str