wfondrie / depthcharge

A deep learning toolkit for mass spectrometry
https://wfondrie.github.io/depthcharge/
Apache License 2.0
59 stars 18 forks source link

Error in reversing peptides with PeptideTokenizer.detokenize #58

Open andradesalazar opened 2 months ago

andradesalazar commented 2 months ago

Hi all,

Detokenizing peptides with mods e.g. PEP+79.996 with let's say reversed tokenized tensor [1,2,3] is not returning the expected behavior. In the current implementation here https://github.com/wfondrie/depthcharge/blob/main/depthcharge/tokenizers/peptides.py#L201 The tokens [1,2,3] get first detokenized and joined to P+79.996EP before getting reversed to PEP69.97+P which is then returned. I think they should be first detokenized without joining (i.e. join=False in detokenize()), then reversed, finally joined.

Best, Daniela