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

New format of modifications from MaxQuant cause artmsProtein2SiteConversion to fail #166

Open
bpolacco opened this issue Sep 18, 2020 · 4 comments
Labels
Projects

Comments

@bpolacco
Copy link
Contributor

bpolacco commented Sep 18, 2020

I've been seeing new format for modifications from recent versions of MaxQuant that cause a failure of artmsProtein2SiteConversion. Instead of the short K(ph), MaxQuant is now using S(Phospho (STY)). I've been pre-converting these MaxQuant files using the function below. Note that this started as a converter for Spectronaut output which uses the similar S[Phospho (STY)] format--that's the reason for the [[(] character classes in the regular expression and the variable name specFormats and specModSequence.

convertModificationFormat <- function(specModSequence, mods=c("PH", "UB", "CAM", "MOX", "NAC")){
  result <- specModSequence
  specFormats <- list (PH='([STY])[[(]Phospho \\(STY\\)[])]',
                       UB='(K)[[(]GlyGly \\(K\\)[])]',
                       CAM = '([C])[[(]Carbamidomethyl \\(C\\)[])]',
                       MOX = '([M])[[(]Oxidation \\(M\\)[])]',
                       NAC =  '([A-Z_])[[(]Acetyl \\(Protein N-term\\)[])]')
  artmsFormats <- list (PH='\\1\\(ph\\)',
                        UB='\\1\\(gl\\)',
                        CAM = '\\1\\(cam\\)',
                        MOX = '\\1\\(ox\\)',
                        NAC = '\\1\\(ac\\)')
  stopifnot(names(specFormats)==names(artmsFormats))
  for (mod in mods){
    if (mod %in% names(specFormats)){
      result <- gsub(specFormats[[mod]], artmsFormats[[mod]], result)
    }else (stop("I don't know how to deal with requested mod: ", mod))
  }
  return (result)
}

I'm happy to put something like this in artMS as a pull request, but inserting this into artMS code will require a bit more restructuring of your code than I am comfortable doing without discussion on how you like to structure things. I'm thinking something like a checkpoint in artmsProtein2SiteConversion, and an attempt to convert on failure, followed by another checkpoint...
evidence_1000lines.txt

@biodavidjm
Copy link
Owner

Thanks @bpolacco, indeed this is a pretty important issue. Let me get back to this very soon.

@biodavidjm
Copy link
Owner

I tested and your code works well. Thank you very much. But I still cannot understand this bizarre change in MaxQuant. I am afraid this is a bug: just a wrong mapping. I bet they will correct it.

biodavidjm added a commit that referenced this issue Oct 22, 2020
+ Convert new MaxQuant format of PTMs to the old format
+ MSstats messages are not displayed by default when using artmsQuantification.
The user can enable MSstats messages by selecting "display_msstats = TRUE"
+ Prevent artmsWriteConfigYamlFile() from overwriting an existing configuration
file unless the user allows it (overwrite = TRUE)
+ printPDF now available in all functions printing plots to pdf, which means that
notebooks can be used and print all plots. Default is still printPDF = TRUE
+ Fix bugs

#166
#165
@biodavidjm biodavidjm added this to To do in artMS Jul 19, 2021
@vlkuzun
Copy link

vlkuzun commented Jul 22, 2021

Hi @bpolacco i would like to confirm that this pre-conversion also takes into consideration that it seems as though the new [Phospho (STY)] format recognises the phosphorylated amino acid is on the right side of the label [Phospho (STY)]? I had not used the previous MaxQuant ph iteration which i understand recognised phosphorylation on the left hand side amino acid?

@bpolacco
Copy link
Contributor Author

bpolacco commented Jul 26, 2021

I have not seen the case where the modified STY is to the right of the (Phospho (STY)). I may have confused with my example above K(Phospho (STY)) using K instead of S, T or Y as the modified amino acid (edit: just now edited to avoid further confusion). That was a mistake on my part -- I was working with ubiquitination as well as phosphorylation when I wrote that and confused them. As written, S(Phospho (STY)) will be translated to S(ph). See the PH modifications in example evidence file I shared with my comment. If you are seeing examples where [Phospho (STY)]S should translate to S(ph) instead that is something new, and you should share here (along with MaxQuant version info that produced that file if you have it). Thanks!

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

No branches or pull requests

3 participants