Skip to content

DIANNtoMSstatsPTMFormat puts carbamidomethyl cysteines in site labels #137

Open

Description

@swaraj-neu

Fixed carbamidomethylation (UniMod:4) gets located as a site along with the modification of interest, so cysteines show up in site labels. On the DIA-NN 1.x example (tinytest/raw_data/DIANN/report.tsv, UniMod:121 plus UniMod:4), with the settings from the man page, 4 of 36 labels contain a cysteine, e.g. BRD4_HUMAN_C356_C357_K362 and BRD2_HUMAN_C425_K427. This can also split one site across two labels, with and without a nearby cysteine, so it gets analysed as two separate sites.

The converter calls the site locator with mod_id = "UniMod" and clean_mod = TRUE (R/converters.R lines 108 to 116), so every UniMod tag is treated the same, and there's no argument to pick the modification of interest. Locating only that modification would fix it. Stripping (UniMod:4) before converting works as a workaround for now.

Repro (MSstatsPTM 2.14.0)

library(MSstatsPTM)
library(data.table)

dir   <- system.file("tinytest/raw_data/DIANN", package = "MSstatsPTM")
fasta <- system.file("extdata", "diann.fasta", package = "MSstatsPTM")
input <- fread(file.path(dir, "report.tsv"))
annot <- fread(file.path(dir, "annot.csv"))

cat("UniMod ids in the input:",
    paste(sort(unique(unlist(regmatches(
      input$Modified.Sequence,
      gregexpr("UniMod:[0-9]+", input$Modified.Sequence))))), collapse = ", "), "\n")

out <- DIANNtoMSstatsPTMFormat(input, annot, fasta_path = fasta,
                               protein_id_col = "Protein.Names",
                               fasta_protein_name = "entry_name",
                               use_log_file = FALSE, verbose = FALSE)
lab <- unique(as.character(out$PTM$ProteinName))

cat("residues reported as sites:\n")
print(table(substr(unlist(regmatches(lab, gregexpr("_[A-Z][0-9]+", lab))), 2, 2)))
cat("\nlabels containing a cysteine site:", sum(grepl("_C[0-9]+", lab)), "of", length(lab), "\n")
print(grep("_C[0-9]+", lab, value = TRUE))

stopifnot(any(grepl("_C[0-9]+", lab)))   # the bug: UniMod:4 located as a site

Output

UniMod ids in the input: UniMod:121, UniMod:4
residues reported as sites:
 C  K
 6 36
labels containing a cysteine site: 4 of 36
[1] "BRD4_HUMAN_C356_C357_K362" "BRD2_HUMAN_C425_K427"
[3] "BRD4_HUMAN_C429_K431"      "BRD4_HUMAN_K355_C356_C357"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions