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

Assigning peptide N- or C-termini labels when calculating mw/mz #50

Open
tobimaile opened this issue Apr 27, 2022 · 4 comments
Open

Assigning peptide N- or C-termini labels when calculating mw/mz #50

tobimaile opened this issue Apr 27, 2022 · 4 comments

Comments

@tobimaile
Copy link

Hey there!

Awesome package, thank you!

I was wondering if aaShift within mz/mw could be extended for a function to label peptide-termini besides specific aminoacids?

This would be very useful for example when adding labels to the termini of peptides.

In the case of TMT-tags, they would be even cumulative with N-terminus and specific aminoacids such as K (a N-terminal K would carry two TMT-labels, one on the amino group of the free peptide terminus and one on free amino group in the sidechain).

Cheers,
Tobias

@jspaezp
Copy link
Contributor

jspaezp commented Dec 15, 2022

Hey there!

Sorry for not seeing this before ... but as an alternative you could make a helper function that combines aaComp with your tag of interest.

LMK if that would help
best,
Sebastian

@tobimaile
Copy link
Author

No worries, I found the NTerm- and CTerm-designations in the aaShift function and they seem to work very well.
The one thing that still causes some troubles is when you want to add PTMs to only one amino acid in a sequence but there are multiples of that specific amino acid present. It might be really helpful to add another function within aaShift to specify the number of occurrences of a specific shift.
E.g. the sequence has several S, T, Y occurrences but you only look for one of these being phosphorylated:

PEPTIDESS: You label for "S = 79.966331", but you are looking for only one phospho group. Labeling on the termini does not work in this case because you do not want to add phospho as a PTM to all your peptides.
So "S = 79.966331, Occurrence = 1" might be a good solution to this problem.

@jspaezp
Copy link
Contributor

jspaezp commented Sep 21, 2023

Well in the meantime you could do something like this:

> peps <- c("PEPTIDEPINK", "PEPINK")
> mw(peps) + (grepl("STY", peps) * 79.966331)

in my experience implementing more than one is kind of tricky and not very prone to vectorization, so we would need to discuss what would be the desired behavior before implementing something. LMK if you have a more specific behavior ...

maybe something like ...

aaShift(peps, ptms = list('S'=79.96, 'M'=18))
# this would give the masses assuming all serines are phosphorylated and all methionines are oxidized.
aaShift(peps, ptms = list('S'=79.96, 'M'=18), max_per_aa = 1)
# this would only shift the mass of 1 serine and 1 methionine MAX if preset in the peptide...

That would be easy to implement but I am not sure how useful it would be.

@tobimaile
Copy link
Author

Those are great options, thank you!
I found an option by using mutate with ifelse-function as I am building mass lists using "mz" ("Sequence" denoting my column holding the amino acid sequence):

mutate(p1_mz2 = ifelse(grepl("S|T|Y", my_data$Sequence),
                         mz(Peptide, charge = 2, 
                            label = "none",
                            aaShift = c(Nterm = 79.966331), 
                            cysteins = 57.021464), 
                         NA))

This seems to work quite well, for multiple phosphorylations regardless of aminoacid, a nested ifelse command with counting STY residues within the sequence would be possible as well.

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

2 participants