Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isoforms - partially undefined order of reported modified peptides #15

Closed
lutzfischer opened this issue Oct 23, 2020 · 6 comments
Closed

Comments

@lutzfischer
Copy link

Hi,

We I noticed a problem (at least for us) in how isoforms reports modified peptides. If there are two or more modifications defined that have the same/overlapping specificities, then the order in which these get applied to any given residue is undefined.
E.g. given the peptide XXXKXXXX and two variable modification, a and b, that could happen on K the isoform-function will sometimes yields XXXaKXXXX, XXXbKXXXX and sometimes XXXbKXXXX, XXXaKXXXX (only differs when the python interpreter is restarted in between - just running it twice directly one after the other yields the same order) . On itself this is not a big problem - but we have to cap the total number of reported modified peptides. And having a non defined order then leads to different subsets of modified peptides being used.

I suspect the problem comes from the use of sets for encoding the possible modifications on each residue of a peptide.

@lutzfischer lutzfischer changed the title isorforms - partially undefined order of reported modified peptides isoforms - partially undefined order of reported modified peptides Oct 23, 2020
@levitsky
Copy link
Owner

Thanks for reporting. I have reproduced the issue and will shortly look into ensuring a fixed order of output.

@levitsky
Copy link
Owner

@lutzfischer I got rid of sets and also sorted the variable_mods dict just in case, so the order should now be more stable. Could you please check the latest version in master?

@lars-kolbowski
Copy link

lars-kolbowski commented Oct 29, 2020

Hi,
I checked out current master and tried it. The output is now reproducible, but it looks like you introduced a bug concerning terminal modifications with these changes.
When running e.g.:
parser.isoforms('AAA', fixed_mods={'n-': True, '-c': True})
I now get:

  File ".../pyteomics/parser.py", line 838, in isoforms
    parsed[i] = apply_mod(group, cmod)
  File ".../pyteomics/parser.py", line 795, in apply_mod
    group = list(label)
TypeError: 'NoneType' object is not iterable

@levitsky
Copy link
Owner

levitsky commented Nov 1, 2020

Ah, thanks for the catch! Indeed, I broke the fixed modifications with my change. They should be fixed now (haha).

@levitsky
Copy link
Owner

levitsky commented Nov 7, 2020

Hopefully this is resolved now, please report any problems with new isoforms.

@levitsky levitsky closed this as completed Nov 7, 2020
@lars-kolbowski
Copy link

yep, works fine now 👍 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants