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
24 stars 6 forks source link

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

Closed jonasscheid closed 10 months ago

jonasscheid commented 10 months 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