[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CVG39T842R3374V67HHHZ0":3,"skill-same:01M7CVG39T842R3374V67HHHZ0":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7CVG39T842R3374V67HHHZ0","bio-proteomics-ptm-analysis",null,"Frames PTM\u002Fphosphoproteomics analysis as three stacked inference layers on a biased enrichment - chemistry selection, site localization (FLR), and protein-level-adjusted quantification with MSstatsPTM - plus kinase-activity and functional triage. Covers MaxQuant Phospho (STY)Sites multiplicity expansion, localization-probability filtering (class I, Ascore, ptmRS, DIA EG.PTMLocalizationProbabilities, DIA-NN PTM.Site.Confidence), false localization rate (LuciPHOr\u002FDeepFLR), motif analysis with experiment-matched backgrounds, diGly\u002FK-GG ubiquitin specificity, acetyl\u002Fglyco traps, and KSEA\u002FPTM-SEA. Use when localizing and quantifying phosphorylation, acetylation, ubiquitination, or glycosylation sites from enrichment-based runs and deciding whether an apparent site change is real after subtracting protein abundance. Peptide ID and open\u002Fvariable-mod search is peptide-identification; underlying protein-level quant is quantification and differential-abundance; DIA acquisition mechanics is dia-analysis.","mrsonord2240\u002Fopenscience-specialists","mrsonord2240","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76487430?v=4","01M7CTEM40S43GSJZ9A3YCCXZK","Samuel Nord","01M7CTEM4K69JD1GBYNHVJ9ZP4",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmass-spec-proteomics-analyst\u002Fversions\u002F1.0.1\u002Fpackage\u002Fskills\u002Fbio-proteomics-ptm-analysis\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-proteomics-ptm-analysis\ndescription: Frames PTM\u002Fphosphoproteomics analysis as three stacked inference layers on a biased enrichment - chemistry selection, site localization (FLR), and protein-level-adjusted quantification with MSstatsPTM - plus kinase-activity and functional triage. Covers MaxQuant Phospho (STY)Sites multiplicity expansion, localization-probability filtering (class I, Ascore, ptmRS, DIA EG.PTMLocalizationProbabilities, DIA-NN PTM.Site.Confidence), false localization rate (LuciPHOr\u002FDeepFLR), motif analysis with experiment-matched backgrounds, diGly\u002FK-GG ubiquitin specificity, acetyl\u002Fglyco traps, and KSEA\u002FPTM-SEA. Use when localizing and quantifying phosphorylation, acetylation, ubiquitination, or glycosylation sites from enrichment-based runs and deciding whether an apparent site change is real after subtracting protein abundance. Peptide ID and open\u002Fvariable-mod search is peptide-identification; underlying protein-level quant is quantification and differential-abundance; DIA acquisition mechanics is dia-analysis.\ntool_type: mixed\nprimary_tool: MSstatsPTM\n---\n\n## Version Compatibility\n\nReference examples tested with: MSstatsPTM 2.8.1, MSstatsTMT 2.14.2 (the TMT route), KSEAapp 2.0, pandas 2.2+, numpy 1.26+, scipy 1.12+ (checked 2026-09-15 on R 4.4.3)\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# PTM and Phosphoproteomics Analysis -- Three Inference Layers Stacked on a Biased Extraction\n\n**\"Find the regulated phosphosites in my enriched samples\"** -> Localize each modification, then test whether its abundance change survives subtracting the protein-level change -- because a PTM result is three separate inferences (enrichment, localization, quantification) and each fails silently if the layer below is treated as solved.\n- R: `MSstatsPTM::groupComparisonPTM()` for protein-adjusted site testing (the load-bearing tool)\n- Python: `pandas` to expand MaxQuant `Phospho (STY)Sites` multiplicity and filter localization probability\n- R: `KSEAapp` \u002F PTM-SEA (`ssGSEA2.0`) for kinase-activity inference from the site fold-changes\n\nScope: this skill OWNS enrichment-chemistry framing, site localization and FLR, multiplicity-resolved site quant, protein-level adjustment (label-free AND TMT\u002Fisobaric), motif analysis, and kinase-activity inference. Peptide identification and open\u002Fvariable-mod search route to peptide-identification; the underlying protein-level (unenriched) quant routes to quantification and differential-abundance; DIA acquisition mechanics route to dia-analysis. OUT OF SCOPE: intact-glycopeptide glycan-composition search (pGlyco3\u002FMSFragger-Glyco) and absolute occupancy from three-ratio SILAC are noted but not implemented here.\n\n## The Single Most Important Modern Insight -- A PTM Result Is Three Inferences, Not One\n\n1. **Enrichment IS the experiment, and the chemistry is a filter confounded with biology.** The data only contain what the chemistry captured. TiO2 and Fe-IMAC give partially-overlapping phosphoproteomes; anti-K-GG enriches ubiquitin, NEDD8, and ISG15 indistinguishably; a lectin reports only its cognate glycoforms. A between-method or between-lab \"biological difference\" must FIRST be excluded as a chemistry artifact before it is called biology.\n2. **Identifying a peptide is NOT localizing the modification.** A phosphopeptide with two S\u002FT and one phosphate has isobaric positional isomers of identical precursor mass and identical peptide-level score; the localization is a SECOND inference decided only by site-determining fragment ions, with its own error rate (false localization rate, FLR). Target-decoy peptide FDR cannot estimate FLR: a wrong localization is the correct sequence with the mod one residue over, not a decoy sequence (Fermin 2013). A 1% peptide FDR does NOT yield a 1% site FDR -- report them separately.\n3. **A change in phosphopeptide abundance is NOT a change in phosphorylation (the biggest quant trap).** Observed PTM signal ~ (site occupancy) x (protein abundance) x (enrichment\u002Fionization factor), so `log2FC(PTM_observed) = log2FC(occupancy) + log2FC(protein)`. Without a paired global (unenriched) proteome run on the SAME samples to subtract `log2FC(protein)`, every protein-abundance change masquerades as a regulated site. Because co-regulated proteins move together, the false positives are pathway-coherent and look biologically convincing -- the worst kind of artifact. This is the entire reason MSstatsPTM exists (Kohler 2023).\n4. **Most identified sites have no known function.** Fewer than ~5% of phosphosites are functionally annotated; a fold-change alone says nothing about regulatory relevance. Functional triage (conservation, stoichiometry, Ochoa functional score, confident kinase assignment) is a separate fourth layer on top of the quant (Ochoa 2020).\n\nBottom line: report THREE numbers, not one -- peptide\u002FPSM FDR, per-site localization probability with its threshold, and an empirically estimated global FLR -- and never call a site \"regulated\" from a phospho-only run without protein-level adjustment.\n\n## Tool Taxonomy\n\n### Enrichment chemistry (phospho)\n\n| Method | Citation | Mechanism \u002F bias | When |\n|---|---|---|---|\n| TiO2 (MOAC) | Larsen 2005 | Metal-oxide Lewis-acid surface; skews mono-phospho; needs hydroxy-acid additive | General single-method depth; EasyPhos basis |\n| Fe(III)-IMAC | Ruprecht 2015 | Chelated Fe3+ coordinates phosphate; multidentate avidity skews MULTI-phospho | Hierarchical\u002Fprocessive signaling; the mono\u002Fmulti divergence is STRONGEST here vs TiO2 |\n| Ti4+\u002FZr4+-IMAC | Matheron 2014 | Chelated metal ION on immobilized phosphonate (NOT bulk oxide); bias vs TiO2 is SMALL | Modern automated workflows; metal identity matters more than IMAC-vs-MOAC |\n| SIMAC (sequential) | Thingholm 2008 | IMAC acidic elution = mono, basic = multi, then TiO2 on mono fraction | Recovering both populations IMAC alone biases |\n\nNaming trap: Ti4+\u002FZr4+-IMAC (chelated ions) is DIFFERENT chemistry from TiO2\u002FZrO2 (bulk oxide). Glycolic acid is the modern additive standard (load 80% ACN \u002F 5% TFA \u002F 0.1 M glycolic acid).\n\n### Other-PTM enrichment and identity traps\n\n| PTM | Reagent \u002F mass | Citation | Headline trap |\n|---|---|---|---|\n| Ubiquitin (diGly, K-GG, +114.0429) | Anti-K-GG antibody | Xu 2010; Kim 2011 | NOT ubiquitin-specific: K-GG = ubiquitin + NEDD8 (~6% at basal) + ISG15 (rises under interferon). UbiSite (Akimov 2018) is the ubiquitin-specific alternative |\n| Ubiquitin alkylation artifact | use chloroacetamide | Nielsen 2008 | Iodoacetamide creates a +114.0429 lysine adduct mimicking ubiquitination; chloroacetamide does not |\n| Acetyl-K (+42.0106) | Anti-acetyllysine cocktail | Svinkina 2015 | Isobaric with trimethyl +42.0470 (0.0364 Da, needs high-res); acetyl blocks trypsin -> allow >=4 missed cleavages |\n| Glyco N-linked | PNGase F (released) or intact | Riley 2021 | Released loses the glycan; N->D tag +0.984 is isobaric with deamidation -- use PNGase F in H2-18O (+2.988) to disambiguate; N-X-S\u002FT (X!=Pro) sequon is necessary not sufficient |\n\n### Localization scoring\n\n| Tool | Citation | Mechanism | Note |\n|---|---|---|---|\n| Ascore | Beausoleil 2006 | Cumulative binomial of site-determining ions; DIFFERENCE between best and 2nd-best localization, peak-depth sweep | Ascore >=19 ~ p 0.01 PAIRWISE per-PSM, NOT a dataset FLR |\n| PhosphoRS \u002F ptmRS | Taus 2011 | Per-isomer cumulative binomial, tolerance-aware (correct for high-res), per-site probs sum to 100% | In Proteome Discoverer |\n| PTMProphet | Shteynberg (TPP) | EM\u002FBayesian mixture; per-site probs combinable across PSMs to a global FLR | TPP\u002FFragPipe |\n| MaxQuant Localization prob | Cox\u002FMann (Andromeda) | Normalized posterior on the site (fixed peak depth) | column `Localization prob`; >=0.75 = class I |\n| DIA localization | Bekker-Jensen 2020 | XIC peak-shape correlation substitutes for missing precursor isolation | Spectronaut `EG.PTMLocalizationProbabilities`; DIA-NN `PTM.Site.Confidence` |\n| DeepFLR | Zong 2023 | Deep-learning spectrum predictor + target-decoy FLR | SOTA direction; DDA + DIA |\n\n### Site-FDR \u002F FLR (the layer most pipelines skip)\n\n| Tool | Citation | Mechanism |\n|---|---|---|\n| LuciPHOr | Fermin 2013 (MCP) | Decoy localizations on non-modifiable residues; rate decoys win = empirical FLR |\n| LuciPHOr2 | Fermin 2015 (Bioinformatics) | Generic-PTM successor (do NOT swap the two journals) |\n| Decoy amino-acid FLR | Ramsbottom\u002FJones 2022 | Add a non-modifiable residue to the candidate set; global FLR ~ decoy-site-hits \u002F target-site-hits, frequency-corrected |\n\n### Kinase-activity inference\n\n| Tool | Citation | Mechanism | Limitation |\n|---|---|---|---|\n| KSEA | Casado 2013 | z-score of a kinase's substrate fold-changes | sqrt(m) favors well-annotated kinases; inherits PhosphoSitePlus bias |\n| PTM-SEA \u002F PTMsigDB | Krug 2019 | ssGSEA2.0 on site-level +\u002F-7 flanking-sequence signatures | robust to isoform drift; PERT signatures score \"looks like EGF stim\" |\n| RoKAI | Yilmaz 2021 | Network-smooth profiles before z-score so unobserved sites borrow neighbor signal | attacks missingness; feeds KSEA |\n\nBenchmark result (Mueller-Dott 2025): across ~19 methods, simple z-score (KSEA\u002FRoKAI) matched or beat sophisticated methods. Performance is PRIOR-limited, not algorithm-limited; all methods inherit PhosphoSitePlus curation bias toward CK2\u002FCDK1\u002FPKA\u002FMAPK, and the dark kinome is structurally invisible. Spend effort on the substrate prior, not the estimator.\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended | Why |\n|---|---|---|\n| Phospho-only run, want regulated sites | Acquire a PAIRED global proteome -> MSstatsPTM `groupComparisonPTM` -> require significance in `ADJUSTED.Model` | Unadjusted site changes are confounded with protein abundance |\n| No global proteome available | Report site changes as UNADJUSTED (`PTM.Model`; `ADJUSTED.Model` is absent) and flag the confound explicitly; optionally `use_unmod \u003C- TRUE` (passed as `use_unmod_peptides`) uses unmodified peptides co-enriched in the PTM runs as a weak protein proxy, which needs those unmodified rows kept in the evidence -- label those results proxy-adjusted | Cannot separate occupancy from abundance; do not claim \"regulation\" |\n| TMT \u002F isobaric plexes (enriched + global) | Same MSstatsPTM route with `labeling_type = 'TMT'`, `dataSummarizationPTM_TMT`, `groupComparisonPTM(data.type = 'TMT')`, and a `Condition = 'Norm'` reference channel in EVERY plex | The adjustment is identical; only the converter, the summarization function and the test branch differ |\n| More than one TMT plex | Refuse to compare until each plex carries the pooled reference channel; `reference_norm = TRUE` bridges them | Reporter ratios are meaningful only within a plex |\n| Between-method phospho difference | Suspect chemistry (TiO2 vs Fe-IMAC mono\u002Fmulti bias) BEFORE biology | Enrichment is a confounded filter |\n| Multiply-phospho peptides present | Localize per-site (Ascore\u002FptmRS) AND report empirical global FLR | Peptide FDR != site FDR |\n| \"Ubiquitination\" sites | Confirm chloroacetamide alkylation; treat K-GG as ub + NEDD8 + ISG15; consider UbiSite | Iodoacetamide artifact + NEDD8\u002FISG15 confound |\n| Which kinases moved? | KSEA or PTM-SEA with a curated prior; do not over-interpret dark-kinome silence | Prior-limited; simple z-score suffices |\n| Motif logo from the hits | Background = experiment-matched S\u002FT\u002FY from the identified proteins (NOT whole proteome) | Whole-proteome background rediscovers disordered-region composition bias |\n\nDefault when uncertain: localize with the search engine's probability (class I >=0.75), expand MaxQuant multiplicity, run MSstatsPTM with a paired global proteome, and call only `ADJUSTED.Model` hits regulated.\n\n## Expand the MaxQuant Site Table Before Any Quant\n\n**Goal:** Produce a long, multiplicity-resolved, class-I-filtered phosphosite intensity matrix from `Phospho (STY)Sites.txt`.\n\n**Approach:** Each site row spreads its quant across `Intensity___1\u002F___2\u002F___3` (singly\u002Fdoubly\u002Ftriply-phospho forms, THREE underscores); the collapsed base `Intensity` mixes phospho-states and can mask a switch between forms. Per-run columns are `Intensity \u003Cexperiment>___\u003Cn>`; the aggregated `Intensity___\u003Cn>` (no experiment name) is the sum over runs and must NOT be melted as a run. Drop Reverse\u002Fcontaminant, filter `Localization prob`, then melt the per-run, per-multiplicity columns into rows.\n\n```python\nimport os\nimport re\nimport pandas as pd\nimport numpy as np\n\n# Filename has a SPACE in the modification name in current MaxQuant; accept either form.\nsites_file = next(f for f in ['Phospho (STY)Sites.txt', 'Phospho(STY)Sites.txt'] if os.path.exists(f))\nphospho = pd.read_csv(sites_file, sep='\\t', low_memory=False)\n\n# Newer MaxQuant uses 'Potential contaminant'; older uses 'Contaminant'.\ncontaminant_col = 'Potential contaminant' if 'Potential contaminant' in phospho.columns else 'Contaminant'\nphospho = phospho[(phospho['Reverse'] != '+') & (phospho[contaminant_col] != '+')]\n\nCLASS_I_PROB = 0.75  # Olsen 2006 class-I convention; comparability standard, not a calibrated FLR\nphospho = phospho[phospho['Localization prob'] >= CLASS_I_PROB].copy()\n\ngene = phospho['Gene names'].where(phospho['Gene names'].notna(), phospho['Protein'])\nphospho['site_id'] = gene.str.split(';').str[0] + '_' + phospho['Amino acid'] + phospho['Position'].astype(int).astype(str)\n\n# Per-run multiplicity columns 'Intensity \u003Crun>___\u003Cn>' (THREE underscores); the space after 'Intensity'\n# excludes the aggregated 'Intensity___\u003Cn>' sum-over-runs columns.\nmult_cols = [c for c in phospho.columns if re.fullmatch(r'Intensity .+___[123]', c)]\nlong = phospho.melt(id_vars=['site_id', 'Amino acid', 'Position', 'Localization prob'], value_vars=mult_cols, var_name='run_multiplicity', value_name='intensity')\nlong['multiplicity'] = long['run_multiplicity'].str.split('___').str[-1]\nlong['run'] = long['run_multiplicity'].str.replace(r'___[123]$', '', regex=True).str.replace(r'^Intensity ', '', regex=True)\nlong = long[long['intensity'] > 0]\nlong['log2_intensity'] = np.log2(long['intensity'])\n```\n\n## Protein-Level Adjustment with MSstatsPTM\n\n**Goal:** Decide whether each site change is real after subtracting the matched protein-abundance change.\n\n**Approach:** MSstatsPTM carries TWO datasets -- a PTM dataset (enriched) and a PROTEIN dataset (global\u002Funenriched). `groupComparisonPTM` fits independent linear models to each and returns a list of THREE: `PTM.Model` (unadjusted), `PROTEIN.Model`, and `ADJUSTED.Model`. The adjustment is `dFC_adj = dFC_PTM - dFC_protein` with `SE_adj = sqrt(SE_PTM^2 + SE_protein^2)`, so adjustment ADDS uncertainty -- a site can be significant unadjusted yet lose significance after adjustment. A confident regulation call requires significance in `ADJUSTED.Model`.\n\n```r\nlibrary(MSstatsPTM)\nrd \u003C- function(f) read.table(f, sep = '\\t', header = TRUE, quote = '')\n\nuse_unmod \u003C- FALSE   # TRUE only when no global run exists (weak proxy, see Decision Tree)\n\n# The converter uses the best-localized sequence as is and keeps unmodified peptides from the\n# enriched runs, so apply the class-I rule to the enriched evidence FIRST: keep rows carrying the\n# modification whose best site probability (from 'Phospho (STY) Probabilities') is >= 0.75.\n# The use_unmod proxy needs the unmodified rows, so keep those too when it is on.\nev \u003C- rd('evidence_phospho.txt')\nsite_prob \u003C- vapply(regmatches(ev$Phospho..STY..Probabilities,\n                               gregexpr('(?\u003C=\\\\()[0-9.]+(?=\\\\))', ev$Phospho..STY..Probabilities, perl = TRUE)),\n                    function(p) if (length(p)) max(as.numeric(p)) else NA_real_, numeric(1))\nis_mod \u003C- grepl('Phospho \\\\(STY\\\\)', ev$Modified.sequence)\nkeep \u003C- is_mod & !is.na(site_prob) & site_prob >= 0.75\nif (use_unmod) keep \u003C- keep | !is_mod\nev \u003C- ev[keep, ]\n\n# Converters are \u003CTool>toMSstatsPTMFormat and return a list with $PTM and $PROTEIN.\n# MaxQtoMSstatsPTMFormat reads the MaxQuant 'evidence.txt' (NOT the Phospho (STY)Sites\n# table -- the pandas multiplicity-expansion above is a SEPARATE workflow); the FASTA maps\n# peptides back to site coordinates. $PROTEIN is built ONLY when `evidence_prot` (the GLOBAL\n# run's evidence) is given together with its proteinGroups and annotation.\ninput \u003C- MaxQtoMSstatsPTMFormat(\n  evidence = ev,\n  annotation = read.csv('annotation_ptm.csv'),\n  fasta_path = 'uniprot_human.fasta',\n  evidence_prot = rd('evidence_global.txt'),\n  proteinGroups = rd('proteinGroups_global.txt'),\n  annotation_protein = read.csv('annotation_protein.csv'),\n  mod_id = '\\\\(Phospho \\\\(STY\\\\)\\\\)',\n  which_proteinid_ptm = 'Proteins',\n  which_proteinid_protein = 'Proteins',\n  use_unmod_peptides = use_unmod\n)\nstopifnot('PROTEIN' %in% names(input))   # no protein dataset -> nothing to adjust against\n\n# append defaults to TRUE and requires a log file, so set it FALSE when use_log_file = FALSE\nsummarized \u003C- dataSummarizationPTM(input, use_log_file = FALSE, append = FALSE)\n\n# data.type is 'LabelFree' (DDA\u002FDIA label-free) or 'TMT' -- NOT the converter's labeling_type 'LF'.\n# Pass an explicit contrast: the default pairwise Label is 'Control vs Treatment' (log2FC = Control - Treatment).\n# Columns must follow the sorted Condition levels.\ncontrast \u003C- matrix(c(-1, 1), nrow = 1, dimnames = list('Treatment vs Control', c('Control', 'Treatment')))\nresult \u003C- groupComparisonPTM(summarized, data.type = 'LabelFree', contrast.matrix = contrast)\n\n# Three models; the adjusted one is the deliverable. Keep site rows only (Protein_\u003Cresidue>\u003Cposition>).\nadjusted \u003C- result$ADJUSTED.Model\nadjusted \u003C- adjusted[grepl('_[STY][0-9]+', adjusted$Protein), ]\n\n# A claim of \"changed more than 2-fold\" needs the threshold INSIDE the test (TREAT-style), not\n# adj.pvalue \u003C 0.05 & |log2FC| > 1 as a post-hoc double filter, whose FDR refers to log2FC != 0.\nlfc \u003C- 1\nadjusted$pvalue_lfc \u003C- pt((abs(adjusted$log2FC) - lfc) \u002F adjusted$SE, adjusted$DF, lower.tail = FALSE)\nadjusted$adj.pvalue_lfc \u003C- p.adjust(adjusted$pvalue_lfc, method = 'BH')\nregulated \u003C- adjusted[!is.na(adjusted$adj.pvalue_lfc) & adjusted$adj.pvalue_lfc \u003C 0.05, ]\n\n# How much of each call was protein-driven: compare PTM.Model vs ADJUSTED.Model.\n```\n\n### TMT \u002F isobaric plexes -- same adjustment, three different calls\n\n**Goal:** The same protein-adjusted site testing when the enriched and global runs are isobaric-labelled plexes (the dominant platform for large-cohort phosphoproteomics).\n\n**Approach:** Only three things change. `labeling_type = 'TMT'` on the converter (default `'LF'`), `dataSummarizationPTM_TMT` instead of `dataSummarizationPTM` -- a different FUNCTION, not a flag -- and `data.type = 'TMT'` in `groupComparisonPTM`. The annotation is the MSstatsTMT one: `Run`, `Fraction`, `TechRepMixture`, `Channel`, `Condition`, `Mixture`, `BioReplicate` (`Raw.file` is also accepted). Mismatching the two halves fails loudly in BOTH directions, but neither message says \"wrong labeling type\": a label-free annotation with `labeling_type = 'TMT'` gives *`Extra columns included in the annotation file that are not required ... Run, Raw.file, Fraction, TechRepMixture, Channel, Condition, Mixture, BioReplicate`* -- read that list as the spec for the TMT annotation -- and TMT evidence left on the default `'LF'` gives the much less obvious *`A non-empty vector of column names for 'by' is required`*. EVERY plex needs a pooled reference channel carried as `Condition = 'Norm'`; `reference_norm = TRUE` (default) uses it to put plexes on a common scale -- the IRS bridge -- and `remove_norm_channel = TRUE` (default) drops it before testing. Without one, cross-plex comparison is invalid and no amount of downstream modelling repairs it.\n\nTwo TMT-specific traps for the ADJUSTMENT itself, not just for the quant:\n\n1. **Ratio compression biases the subtraction, it does not merely attenuate it.** Co-isolated precursors pull every reporter ratio toward 1, and the PTM and PROTEIN datasets are not compressed equally -- enriched phosphopeptide runs are a sparser, differently-interfered precursor space than the global run. So `dFC_adj = dFC_PTM - dFC_protein` subtracts two differently-shrunken numbers. Use MS3\u002FSPS or FAIMS to reduce it, and read TMT effect sizes as lower bounds; the SIGN and ranking survive, the magnitude does not.\n2. **Label the enriched and global aliquots in the SAME plex** where the design allows. Split across plexes, each dataset carries its own reference-channel normalization and the site-to-protein subtraction inherits both.\n\n```r\nlibrary(MSstatsPTM)\nrd \u003C- function(f) read.table(f, sep = '\\t', header = TRUE, quote = '')\n\n# Class-I pre-filter on the ENRICHED evidence, exactly as in the label-free route above.\nev \u003C- rd('evidence_phospho_tmt.txt')\nsite_prob \u003C- vapply(regmatches(ev$Phospho..STY..Probabilities,\n                               gregexpr('(?\u003C=\\\\()[0-9.]+(?=\\\\))', ev$Phospho..STY..Probabilities, perl = TRUE)),\n                    function(p) if (length(p)) max(as.numeric(p)) else NA_real_, numeric(1))\nev \u003C- ev[grepl('Phospho \\\\(STY\\\\)', ev$Modified.sequence) & !is.na(site_prob) & site_prob >= 0.75, ]\n\n# TMT annotation: Run, Fraction, TechRepMixture, Channel, Condition, Mixture, BioReplicate.\n# Channel is 'channel.1' ... 'channel.N' and maps to the evidence's\n# 'Reporter intensity corrected \u003Cn>' columns; the CORRECTED ones, not the raw reporters.\n# Give the pooled reference channel Condition = 'Norm' in EVERY plex.\ninput \u003C- MaxQtoMSstatsPTMFormat(\n  evidence = ev,\n  annotation = read.csv('annotation_ptm_tmt.csv'),\n  fasta_path = 'uniprot_human.fasta',\n  evidence_prot = rd('evidence_global_tmt.txt'),\n  proteinGroups = rd('proteinGroups_global.txt'),\n  annotation_protein = read.csv('annotation_protein_tmt.csv'),\n  labeling_type = 'TMT',          # the single converter switch; default is 'LF'\n  mod_id = '\\\\(Phospho \\\\(STY\\\\)\\\\)',\n  which_proteinid_ptm = 'Proteins',\n  which_proteinid_protein = 'Proteins',\n  use_unmod_peptides = FALSE)\nstopifnot('PROTEIN' %in% names(input))\n\n# TMT summarization is its own function. reference_norm \u002F reference_norm.PTM (default TRUE) apply\n# the 'Norm'-channel bridge; remove_norm_channel (default TRUE) drops that channel afterwards, so\n# the contrast below names only the biological conditions.\nsummarized \u003C- dataSummarizationPTM_TMT(input, use_log_file = FALSE, append = FALSE)\n\ncontrast \u003C- matrix(c(-1, 1), nrow = 1, dimnames = list('Treatment vs Control', c('Control', 'Treatment')))\nresult \u003C- groupComparisonPTM(summarized, data.type = 'TMT', contrast.matrix = contrast)\n\nadjusted \u003C- result$ADJUSTED.Model\nadjusted \u003C- adjusted[grepl('_[STY][0-9]+', adjusted$Protein), ]\n# From here the TREAT-style threshold, the PTM.Model-vs-ADJUSTED.Model comparison and the KSEA\n# block below are identical to the label-free route -- only the three calls above differ.\n```\n\nStarting from `Phospho (STY)Sites.txt` instead of `evidence.txt` (the `sites_data =` argument) is the one place `TMT_keyword` matters: there the converter builds column names as `Reporter.intensity.corrected.\u003Cn>.\u003CTMT_keyword>\u003Cmixture>`, so `TMT_keyword` must match how the site table's reporter columns were named. It is ignored on the `evidence =` route shown above.\n\n## Motif Analysis with the Correct Background\n\n**Goal:** Find kinase\u002Fwriter motifs around the modified residue without rediscovering amino-acid composition bias.\n\n**Approach:** Use the `Sequence window` (+\u002F-15 residues, 31-mer) MaxQuant already provides, centered on the site. The background MUST be an experiment-matched S\u002FT\u002FY set drawn from the identified proteins (or a central-residue-preserving shuffle), NOT the whole proteome or IUPAC-random -- those just report the composition of phospho-rich disordered regions. motif-x and MoMo p-values are only valid when the background is built this way.\n\n```python\nfrom collections import Counter\nimport pandas as pd\nfrom scipy.stats import fisher_exact, false_discovery_control\n\n# 'Sequence window' is a 31-mer (+\u002F-15) centered on the modified residue.\nWINDOW_HALF = 7  # +\u002F-7 flanking is the standard kinase-motif window\n# foreground: e.g. the regulated-up class-I sites; here all class-I sites from the expansion block\nforeground = [w[15 - WINDOW_HALF: 16 + WINDOW_HALF] for w in phospho['Sequence window'].dropna() if len(w) >= 31]\n\ndef matched_background(fasta, accessions, residues='ST'):\n    '''Every S\u002FT (or Y) window in the IDENTIFIED proteins, central residue preserved.\n    fasta: {accession: sequence}; accessions: proteins identified in this experiment.'''\n    windows = []\n    for acc in accessions:\n        seq = fasta[acc]\n        for i, aa in enumerate(seq):\n            if aa in residues:\n                windows.append(''.join(seq[j] if 0 \u003C= j \u003C len(seq) else '_' for j in range(i - WINDOW_HALF, i + WINDOW_HALF + 1)))\n    return windows\n\ndef position_frequencies(windows):\n    counts = {i: Counter() for i in range(-WINDOW_HALF, WINDOW_HALF + 1)}\n    for w in windows:\n        for offset, aa in zip(range(-WINDOW_HALF, WINDOW_HALF + 1), w):\n            if aa not in '_X':\n                counts[offset][aa] += 1\n    return counts\n\ndef motif_enrichment(fg_windows, bg_windows):\n    '''One-sided Fisher test per (position, residue), BH-adjusted across all tests.'''\n    fg, bg = position_frequencies(fg_windows), position_frequencies(bg_windows)\n    rows = []\n    for offset in fg:\n        if offset == 0:\n            continue\n        n_fg, n_bg = sum(fg[offset].values()), sum(bg[offset].values())\n        for aa, k in fg[offset].items():\n            _, p = fisher_exact([[k, n_fg - k], [bg[offset][aa], n_bg - bg[offset][aa]]], alternative='greater')\n            rows.append({'offset': offset, 'aa': aa, 'fg': k, 'fg_total': n_fg, 'bg': bg[offset][aa], 'bg_total': n_bg, 'p': p})\n    table = pd.DataFrame(rows)\n    table['q'] = false_discovery_control(table['p'], method='bh')\n    return table.sort_values('p')\n```\n\nFor a publication-grade enrichment logo, hand the foreground and a matched background to a dedicated tool (motif-x \u002F MoMo) and render with data-visualization\u002Fsequence-logos.\n\n## Kinase Activity with KSEAapp\n\n**Goal:** Score kinase activity from the protein-adjusted site fold-changes.\n\n**Approach:** `KSEAapp::KSEA.Scores` merges the site table with a kinase-substrate prior on gene symbol + residue and returns a z-score per kinase with its substrate count `m`. The prior (`KSData`: PhosphoSitePlus + NetworKIN table with `KINASE`, `SUB_GENE`, `SUB_MOD_RSD`, `Source`, `networkin_score` columns) must be the full file from github.com\u002Fcasecpb\u002FKSEA; the package's `data(KSData)` is an abbreviated demonstration subset. `PX` needs six columns in this exact order, and `FC` is a LINEAR ratio (the function takes log2 itself), treatment over control.\n\n```r\nlibrary(KSEAapp)\nKSData \u003C- read.csv('PSP&NetworKIN_Kinase_Substrate_Dataset.csv')   # user-supplied prior\npg \u003C- rd('proteinGroups_global.txt')\ngene_symbol \u003C- setNames(sub(';.*', '', pg$Gene.names), sub(';.*', '', pg$Protein.IDs))\n\n# log2FC = +\u002F-Inf (site measured in one condition only) gives FC = 0 or Inf, and one such row\n# turns every kinase z-score NaN; filter on log2FC, not on the linear FC (0 is finite)\nks \u003C- adjusted[is.finite(adjusted$log2FC), ]\nif (nrow(ks) == 0)\n  stop('No site has a finite log2FC -- every row of the adjusted table is +\u002F-Inf or NA, i.e. every ',\n       'site was quantified in one condition only. KSEA scores fold changes, not presence\u002Fabsence; ',\n       'report those sites as detected-in-one-condition instead.')\nPX \u003C- data.frame(\n  Protein = sub('_[STY][0-9]+$', '', ks$Protein),\n  Gene = gene_symbol[sub('_[STY][0-9]+$', '', ks$Protein)],   # HUGO symbol; merge key with SUB_GENE\n  Peptide = rep('NULL', nrow(ks)),   # rep(), not the bare literal: a length-1 value against\n                                     # zero-length columns is 'differing number of rows: 0, 1'\n  Residue.Both = sub('^.*_', '', ks$Protein),                  # e.g. S473; merge key with SUB_MOD_RSD\n  p = ks$adj.pvalue,\n  FC = 2^ks$log2FC)   # Treatment\u002FControl because the contrast above is 'Treatment vs Control'\nPX \u003C- PX[!is.na(PX$Gene), ]\nif (nrow(PX) == 0)\n  stop('PX is empty after dropping sites with no gene symbol: proteinGroups_global.txt carried no ',\n       '`Gene names` for any tested protein. Check the search FASTA had gene annotation, or map the ',\n       'accessions to HUGO symbols yourself before building PX.')\n\n# Check PRIOR COVERAGE before calling. KSEA.Scores merges on SUB_GENE + SUB_MOD_RSD and then\n# aggregates, so a prior overlapping this site list in 0 or 1 place dies inside the package with\n# `no rows to aggregate` -- a message that says nothing about coverage. Curated priors cover only a\n# small fraction of any real site list, so this is the common failure, not an exotic one.\nprior \u003C- KSData[grep('PhosphoSitePlus', KSData$Source), ]   # the subset NetworKIN = FALSE will use\ncovered \u003C- sum(paste(PX$Gene, PX$Residue.Both) %in% paste(prior$SUB_GENE, prior$SUB_MOD_RSD))\ncat('sites in PX:', nrow(PX), '| covered by the prior:', covered, '\\n')\nif (covered \u003C 2)\n  stop('The kinase-substrate prior covers ', covered, ' of ', nrow(PX), ' sites, so KSEA has ',\n       'nothing to score. Check that KSData is the FULL PhosphoSitePlus+NetworKIN table (not the ',\n       'abbreviated data(KSData)), that Gene holds HUGO symbols matching SUB_GENE, and that ',\n       'Residue.Both is formatted like SUB_MOD_RSD (S473, not pS473 or Ser473).')\n\n# NetworKIN = FALSE: PhosphoSitePlus-curated pairs only; TRUE adds predictions above NetworKIN.cutoff\n# (and then coverage should be counted against that subset instead).\nkinase_scores \u003C- KSEA.Scores(KSData, PX, NetworKIN = FALSE, NetworKIN.cutoff = 3)\nkinase_scores[order(kinase_scores$z.score), c('Kinase.Gene', 'm', 'z.score', 'FDR')]\n```\n\nIf the contrast Label reads `Control vs Treatment`, use `FC = 2^(-log2FC)`, or every kinase's sign inverts.\n\n## A Note on Home-Grown Ascore\n\nThe function below is an ILLUSTRATIVE approximation, NOT real Ascore. Real Ascore (Beausoleil 2006) competes the best localization against the second-best, sweeps peak depth 1-10 per 100 Th, and restricts to site-determining ions -- none of which this captures. Use the search engine's own localization probability (MaxQuant `Localization prob`, ptmRS, PTMProphet) for real work, or pyOpenMS `AScore` (introspect the exact API before relying on it). The home-grown form is here only to show the binomial intuition.\n\n```python\nimport numpy as np\nfrom scipy.stats import binom\n\ndef illustrative_localization_score(matched_site_ions, total_ions, depth_p=0.04):\n    '''Binomial intuition only; NOT Ascore (no best-vs-second competition or depth sweep).'''\n    if total_ions == 0 or matched_site_ions == 0:\n        return 0.0\n    p_random = 1 - binom.cdf(matched_site_ions - 1, total_ions, depth_p)\n    return -10 * np.log10(p_random) if p_random > 0 else 100.0\n```\n\n## Per-Method Failure Modes\n\n### Skipping protein-level adjustment\n**Trigger:** Differential testing on a phospho-only run with no paired global proteome. **Mechanism:** `log2FC(PTM_observed) = log2FC(occupancy) + log2FC(protein)`; the two terms are inseparable. **Symptom:** Pathway-coherent \"regulated sites\" that are pure protein-abundance changes (cyclins\u002Fhistones in cell cycle, stabilized substrates under drug). **Fix:** Run a matched global proteome and adjust via MSstatsPTM; route the protein-level quant to quantification.\n\n### Collapsing the MaxQuant multiplicity\n**Trigger:** Quantifying on base `Intensity` instead of `Intensity___1\u002F___2\u002F___3`. **Mechanism:** The collapsed column mixes singly\u002Fdoubly\u002Ftriply-phospho forms of the same site. **Symptom:** A switch between forms is masked: the singly-phospho form dropping while the doubly-phospho form rises reads as no change (synthetic test: collapsed +0.16 log2, ___1 -1.40, ___2 +1.56). **Fix:** Expand multiplicity to long form (Perseus \"Expand site table\" or the melt above) before any stats.\n\n### Treating identification as localization\n**Trigger:** Reporting sites at peptide FDR without a localization threshold. **Mechanism:** Isobaric positional isomers share precursor mass and peptide score; CID\u002Fion-trap neutral loss (-98 Da) starves site-determining ions. **Symptom:** A 1% peptide FDR result with a much higher true site error. **Fix:** Filter localization probability (class I >=0.75) in EVERY route, including the evidence fed to MSstatsPTM; report an empirical global FLR (LuciPHOr2\u002FDeepFLR), prefer HCD\u002FEThcD. Empirical FLR needs the spectra (mzML); from MaxQuant txt tables alone, report only the model-based expected FLR `mean(1 - Localization prob)` over the accepted sites and label it as such -- it misses mis-assignment sources the search model does not know about.\n\n### diGly read as ubiquitin\n**Trigger:** Calling the K-GG proteome \"ubiquitination\". **Mechanism:** NEDD8 and ISG15 share the LRLRGG C-terminus and leave the identical +114.0429 remnant; iodoacetamide adds a fourth source. **Symptom:** Inflated\u002Ffalse ubiquitin sites, worst under interferon (ISG15) or with iodoacetamide. **Fix:** Ask which alkylation reagent was used; chloroacetamide for future experiments; treat K-GG as ub+NEDD8+ISG15; use UbiSite for ubiquitin-specific mapping. For data already acquired, flag K-GG on the peptide C-terminal lysine (a GG-modified K blocks trypsin, so a C-terminal GG-K is suspect): `ev['Modified sequence'].str.contains(r'K\\(GlyGly \\(K\\)\\)_$')`.\n\n### Motif logo against the wrong background\n**Trigger:** Whole-proteome or IUPAC-random background. **Mechanism:** Phosphosites sit in disordered, Ser\u002FPro\u002Facidic-rich regions; that composition dominates the enrichment. **Symptom:** \"Enriched\" proline\u002Fserine motifs that are region bias, not kinase preference. **Fix:** Experiment-matched S\u002FT\u002FY background or central-residue-preserving shuffle (MoMo default).\n\n### Over-reading kinase-activity output\n**Trigger:** Naming the top KSEA\u002Fatlas kinase as the responsible enzyme. **Mechanism:** Substrate priors are PhosphoSitePlus-curated (CK2\u002FCDK1\u002FPKA\u002FMAPK heavy); atlas hits are biochemical preference ignoring expression\u002Flocalization\u002Ftiming. **Symptom:** Always-the-usual-suspects kinase lists; dark-kinome activity invisible. **Fix:** Use a curated prior, report z-scores with their substrate counts, do not infer absence from silence.\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|---|---|---|\n| Localization prob class I >= 0.75 | Olsen 2006 | Best site holds >3x the posterior of all alternatives (single-phospho); a comparability standard, not a calibrated error rate |\n| Class II 0.5-0.75; class III 0.25-0.5 | Olsen 2006 | Partial \u002F poor localization |\n| Ascore >= 19 (p~0.01); loose >13 | Beausoleil 2006 | Pairwise per-PSM best-vs-next confidence; NOT a dataset FLR |\n| DIA directDIA localization >= 0.99 | Bekker-Jensen 2020 | Stricter than library-based (0.75) to match DDA error rates |\n| DIA-NN site matrix 0.90 \u002F 0.99 | DIA-NN docs | phosphosites_90\u002F99.tsv; class-I-equivalent stringency is HIGHER than MaxQuant 0.75 |\n| Acetyl missed cleavages >= 4 | -- | Acetyl-K blocks trypsin; pair LysC + trypsin |\n| Kinase atlas motif match >= 90th percentile | Johnson 2023 | Strong motif preference, NOT proof the kinase acted |\n| Report peptide FDR and site FLR separately | Fermin 2013 | 1% peptide FDR != 1% site FDR; true site error is typically several-fold higher |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|---|---|---|\n| FileNotFoundError on the sites table | Filename has a SPACE: `Phospho (STY)Sites.txt` | Accept either spaced or no-space form |\n| Form switch hidden (no change on a site that switched singly\u002Fdoubly) | Quantified base `Intensity`, mixing multiplicities | Use `Intensity \u003Crun>___1\u002F___2\u002F___3` (three underscores) |\n| Extra \"run\" named `Intensity` in the long table, ~2.7 log2 above the others | Melt also matched the aggregated `Intensity___1\u002F2\u002F3` columns | Select `Intensity \u003Crun>___n` (note the space) |\n| `Assertion on '!(append & !use_log_file)' failed` | `dataSummarizationPTM` defaults `append = TRUE` | `dataSummarizationPTM(input, use_log_file = FALSE, append = FALSE)` |\n| `object 'ptm_model' not found` in `groupComparisonPTM` | `data.type = 'LF'` matches neither branch | `data.type = 'LabelFree'` (or `'TMT'`) |\n| `Extra columns included in the annotation file that are not required ... Run, Raw.file, Fraction, TechRepMixture, Channel, Condition, Mixture, BioReplicate` | a label-free annotation passed with `labeling_type = 'TMT'` | Use the TMT annotation columns the message itself lists |\n| `A non-empty vector of column names for 'by' is required` from `MaxQtoMSstatsPTMFormat` | TMT evidence left on the default `labeling_type = 'LF'`; the message never mentions labeling | `labeling_type = 'TMT'`, then `dataSummarizationPTM_TMT` and `data.type = 'TMT'` |\n| `names(input)` is only `PTM`; `ADJUSTED.Model` missing | `evidence_prot` not passed to `MaxQtoMSstatsPTMFormat` | Pass the global run's evidence as `evidence_prot`; `stopifnot('PROTEIN' %in% names(input))` |\n| `z.score` NaN for every kinase from `KSEA.Scores` | a site with log2FC -Inf\u002FInf (missing in one condition) entered PX; FC = 0 passes `is.finite(FC)` | drop rows with non-finite `log2FC` before building PX |\n| `arguments imply differing number of rows: 0, 1` while building PX | the non-finite-`log2FC` filter emptied the table, and `Peptide = 'NULL'` is a length-1 literal against zero-length columns | guard `nrow(ks) == 0` with a message about one-condition sites, and use `rep('NULL', nrow(ks))` |\n| `no rows to aggregate` from `KSEA.Scores` | the prior overlaps the site list in 0 or 1 place -- usually the abbreviated `data(KSData)`, a non-HUGO `Gene` column, or residues written `pS473`\u002F`Ser473` | count `paste(Gene, Residue.Both)` against `paste(SUB_GENE, SUB_MOD_RSD)` before calling and stop with the coverage number |\n| `Can't assign 4 names to a 0-column data.table` with `use_unmod_peptides = TRUE` | the evidence pre-filter removed every unmodified row | set `use_unmod \u003C- TRUE` so unmodified rows are kept; the class-I rule applies to modified rows only |\n| Site signs inverted in KSEA \u002F up-down calls | Default pairwise Label `Control vs Treatment` means log2FC = Control - Treatment | Check `adjusted$Label` or pass an explicit `contrast.matrix` |\n| Protein names without a site suffix in `ADJUSTED.Model` | Unmodified peptides from the enriched runs entered `$PTM` | Pre-filter evidence to modified rows; drop rows without `_\u003Cresidue>\u003Cposition>` |\n| KeyError \u002F NaN on `Gene names` | Column is FASTA-dependent, absent without gene annotation | Guard with `.notna()` and fall back to `Protein` |\n| All sites \"regulated\" and pathway-coherent | No protein-level adjustment | Require significance in MSstatsPTM `ADJUSTED.Model` |\n| `PTM.Q.Value` \u002F `PhosphoSite` not found (DIA-NN) | Those columns do not exist | Use `PTM.Site.Confidence` and `Site.Occupancy.Probabilities` |\n| False \"ubiquitination\" sites | Iodoacetamide +114.0429 lysine artifact | Alkylate with chloroacetamide |\n| Acetyl confused with trimethyl | +42.0106 vs +42.0470 isobaric at nominal mass | Require high-res MS; check 0.0364 Da split |\n\n## References\n\n- Beausoleil SA, Villen J, Gerber SA, Rush J, Gygi SP. A probability-based approach for high-throughput protein phosphorylation analysis and site localization. *Nat Biotechnol* 2006;24(10):1285-1292.\n- Taus T, Kocher T, Pichler P, et al. Universal and confident phosphorylation site localization using phosphoRS. *J Proteome Res* 2011;10(12):5354-5362.\n- Olsen JV, Blagoev B, Gnad F, et al. Global, in vivo, and site-specific phosphorylation dynamics in signaling networks. *Cell* 2006;127(3):635-648.\n- Fermin D, Walmsley SJ, Gingras AC, Choi H, Nesvizhskii AI. LuciPHOr: algorithm for phosphorylation site localization with false localization rate estimation using modified target-decoy approach. *Mol Cell Proteomics* 2013;12(11):3409-3419.\n- Fermin D, Avtonomov D, Choi H, Nesvizhskii AI. LuciPHOr2: site localization of generic PTMs from tandem mass spectrometry data. *Bioinformatics* 2015;31(7):1141-1143.\n- Bekker-Jensen DB, Bernhardt OM, Hogrebe A, et al. Rapid and site-specific deep phosphoproteome profiling by data-independent acquisition without the need for spectral libraries. *Nat Commun* 2020;11:787.\n- Kohler D, Tsai TH, Verschueren E, et al. MSstatsPTM: Statistical Relative Quantification of Posttranslational Modifications in Bottom-Up Mass Spectrometry-Based Proteomics. *Mol Cell Proteomics* 2023;22(1):100477.\n- Ochoa D, Jarnuczak AF, Vieitez C, et al. The functional landscape of the human phosphoproteome. *Nat Biotechnol* 2020;38(3):365-373.\n- Casado P, Rodriguez-Prados JC, Cosulich SC, et al. Kinase-Substrate Enrichment Analysis Provides Insights into the Heterogeneity of Signaling Pathway Activation in Leukemia Cells. *Sci Signal* 2013;6(268):rs6.\n- Krug K, Mertins P, Zhang B, et al. A Curated Resource for Phosphosite-specific Signature Analysis. *Mol Cell Proteomics* 2019;18(3):576-593.\n- Yilmaz S, Ayati M, Schlatzer D, et al. Robust inference of kinase activity using functional networks. *Nat Commun* 2021;12:1177.\n- Larsen MR, Thingholm TE, Jensen ON, Roepstorff P, Jorgensen TJD. Highly selective enrichment of phosphorylated peptides from peptide mixtures using titanium dioxide microcolumns. *Mol Cell Proteomics* 2005;4(7):873-886.\n- Ruprecht B, Koch H, Medard G, et al. Comprehensive and reproducible phosphopeptide enrichment using iron immobilized metal ion affinity chromatography (Fe-IMAC) columns. *Mol Cell Proteomics* 2015;14(1):205-215.\n- Matheron L, van den Toorn H, Heck AJR, Mohammed S. Characterization of biases in phosphopeptide enrichment by Ti(IV)-IMAC and TiO2 using a massive synthetic library and human cell digests. *Anal Chem* 2014;86(16):8312-8320.\n- Thingholm TE, Jensen ON, Robinson PJ, Larsen MR. SIMAC (sequential elution from IMAC), a phosphoproteomics strategy for the rapid separation of monophosphorylated from multiply phosphorylated peptides. *Mol Cell Proteomics* 2008;7(4):661-671.\n- Svinkina T, Gu H, Silva JC, et al. Deep, Quantitative Coverage of the Lysine Acetylome Using Novel Anti-acetyl-lysine Antibodies and an Optimized Proteomic Workflow. *Mol Cell Proteomics* 2015;14(9):2429-2440.\n- Xu G, Paige JS, Jaffrey SR. Global analysis of lysine ubiquitination by ubiquitin remnant immunoaffinity profiling. *Nat Biotechnol* 2010;28(8):868-873.\n- Kim W, Bennett EJ, Huttlin EL, et al. Systematic and Quantitative Assessment of the Ubiquitin-Modified Proteome. *Mol Cell* 2011;44(2):325-340.\n- Nielsen ML, Vermeulen M, Bonaldi T, Cox J, Moroder L, Mann M. Iodoacetamide-induced artifact mimics ubiquitination in mass spectrometry. *Nat Methods* 2008;5(6):459-460.\n- Akimov V, Barrio-Hernandez I, Hansen SVF, et al. UbiSite approach for comprehensive mapping of lysine and N-terminal ubiquitination sites. *Nat Struct Mol Biol* 2018;25(7):631-640.\n- Riley NM, Bertozzi CR, Pitteri SJ. A Pragmatic Guide to Enrichment Strategies for Mass Spectrometry-Based Glycoproteomics. *Mol Cell Proteomics* 2021;20:100029.\n- Johnson JL, Yaron TM, Huntsman EM, et al. An atlas of substrate specificities for the human serine\u002Fthreonine kinome. *Nature* 2023;613(7945):759-766.\n- Mueller-Dott S, Jaehnig EJ, et al. Comprehensive evaluation of phosphoproteomic-based kinase activity inference. *Nat Commun* 2025;16:4771.\n- Zong Y, Wang Y, Yang Y, et al. DeepFLR facilitates false localization rate control in phosphoproteomics. *Nat Commun* 2023;14:2269.\n- Ramsbottom KA, Prakash A, Riverol YP, et al. Method for independent estimation of the false localization rate for phosphoproteomics. *J Proteome Res* 2022;21(7):1603-1615.\n\n## Related Skills\n\n- peptide-identification - Identify modified peptides and run open\u002Fvariable-mod search\n- quantification - Underlying protein-level quant feeding the MSstatsPTM PROTEIN dataset\n- differential-abundance - Moderated testing on the protein-level intensity matrix\n- pathway-analysis\u002Fgsea - Enrichment scoring of regulated-site protein lists and PTM-SEA-style signatures\n- data-visualization\u002Fsequence-logos - Render motif logos from the foreground\u002Fbackground windows\n","## Version Compatibility\n\nReference examples tested with: MSstatsPTM 2.8.1, MSstatsTMT 2.14.2 (the TMT route), KSEAapp 2.0, pandas 2.2+, numpy 1.26+, scipy 1.12+ (checked 2026-09-15 on R 4.4.3)\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# PTM and Phosphoproteomics Analysis -- Three Inference Layers Stacked on a Biased Extraction\n\n**\"Find the regulated phosphosites in my enriched samples\"** -> Localize each modification, then test whether its abundance change survives subtracting the protein-level change -- because a PTM result is three separate inferences (enrichment, localization, quantification) and each fails silently if the layer below is treated as solved.\n- R: `MSstatsPTM::groupComparisonPTM()` for protein-adjusted site testing (the load-bearing tool)\n- Python: `pandas` to expand MaxQuant `Phospho (STY)Sites` multiplicity and filter localization probability\n- R: `KSEAapp` \u002F PTM-SEA (`ssGSEA2.0`) for kinase-activity inference from the site fold-changes\n\nScope: this skill OWNS enrichment-chemistry framing, site localization and FLR, multiplicity-resolved site quant, protein-level adjustment (label-free AND TMT\u002Fisobaric), motif analysis, and kinase-activity inference. Peptide identification and open\u002Fvariable-mod search route to peptide-identification; the underlying protein-level (unenriched) quant routes to quantification and differential-abundance; DIA acquisition mechanics route to dia-analysis. OUT OF SCOPE: intact-glycopeptide glycan-composition search (pGlyco3\u002FMSFragger-Glyco) and absolute occupancy from three-ratio SILAC are noted but not implemented here.\n\n## The Single Most Important Modern Insight -- A PTM Result Is Three Inferences, Not One\n\n1. **Enrichment IS the experiment, and the chemistry is a filter confounded with biology.** The data only contain what the chemistry captured. TiO2 and Fe-IMAC give partially-overlapping phosphoproteomes; anti-K-GG enriches ubiquitin, NEDD8, and ISG15 indistinguishably; a lectin reports only its cognate glycoforms. A between-method or between-lab \"biological difference\" must FIRST be excluded as a chemistry artifact before it is called biology.\n2. **Identifying a peptide is NOT localizing the modification.** A phosphopeptide with two S\u002FT and one phosphate has isobaric positional isomers of identical precursor mass and identical peptide-level score; the localization is a SECOND inference decided only by site-determining fragment ions, with its own error rate (false localization rate, FLR). Target-decoy peptide FDR cannot estimate FLR: a wrong localization is the correct sequence with the mod one residue over, not a decoy sequence (Fermin 2013). A 1% peptide FDR does NOT yield a 1% site FDR -- report them separately.\n3. **A change in phosphopeptide abundance is NOT a change in phosphorylation (the biggest quant trap).** Observed PTM signal ~ (site occupancy) x (protein abundance) x (enrichment\u002Fionization factor), so `log2FC(PTM_observed) = log2FC(occupancy) + log2FC(protein)`. Without a paired global (unenriched) proteome run on the SAME samples to subtract `log2FC(protein)`, every protein-abundance change masquerades as a regulated site. Because co-regulated proteins move together, the false positives are pathway-coherent and look biologically convincing -- the worst kind of artifact. This is the entire reason MSstatsPTM exists (Kohler 2023).\n4. **Most identified sites have no known function.** Fewer than ~5% of phosphosites are functionally annotated; a fold-change alone says nothing about regulatory relevance. Functional triage (conservation, stoichiometry, Ochoa functional score, confident kinase assignment) is a separate fourth layer on top of the quant (Ochoa 2020).\n\nBottom line: report THREE numbers, not one -- peptide\u002FPSM FDR, per-site localization probability with its threshold, and an empirically estimated global FLR -- and never call a site \"regulated\" from a phospho-only run without protein-level adjustment.\n\n## Tool Taxonomy\n\n### Enrichment chemistry (phospho)\n\n| Method | Citation | Mechanism \u002F bias | When |\n|---|---|---|---|\n| TiO2 (MOAC) | Larsen 2005 | Metal-oxide Lewis-acid surface; skews mono-phospho; needs hydroxy-acid additive | General single-method depth; EasyPhos basis |\n| Fe(III)-IMAC | Ruprecht 2015 | Chelated Fe3+ coordinates phosphate; multidentate avidity skews MULTI-phospho | Hierarchical\u002Fprocessive signaling; the mono\u002Fmulti divergence is STRONGEST here vs TiO2 |\n| Ti4+\u002FZr4+-IMAC | Matheron 2014 | Chelated metal ION on immobilized phosphonate (NOT bulk oxide); bias vs TiO2 is SMALL | Modern automated workflows; metal identity matters more than IMAC-vs-MOAC |\n| SIMAC (sequential) | Thingholm 2008 | IMAC acidic elution = mono, basic = multi, then TiO2 on mono fraction | Recovering both populations IMAC alone biases |\n\nNaming trap: Ti4+\u002FZr4+-IMAC (chelated ions) is DIFFERENT chemistry from TiO2\u002FZrO2 (bulk oxide). Glycolic acid is the modern additive standard (load 80% ACN \u002F 5% TFA \u002F 0.1 M glycolic acid).\n\n### Other-PTM enrichment and identity traps\n\n| PTM | Reagent \u002F mass | Citation | Headline trap |\n|---|---|---|---|\n| Ubiquitin (diGly, K-GG, +114.0429) | Anti-K-GG antibody | Xu 2010; Kim 2011 | NOT ubiquitin-specific: K-GG = ubiquitin + NEDD8 (~6% at basal) + ISG15 (rises under interferon). UbiSite (Akimov 2018) is the ubiquitin-specific alternative |\n| Ubiquitin alkylation artifact | use chloroacetamide | Nielsen 2008 | Iodoacetamide creates a +114.0429 lysine adduct mimicking ubiquitination; chloroacetamide does not |\n| Acetyl-K (+42.0106) | Anti-acetyllysine cocktail | Svinkina 2015 | Isobaric with trimethyl +42.0470 (0.0364 Da, needs high-res); acetyl blocks trypsin -> allow >=4 missed cleavages |\n| Glyco N-linked | PNGase F (released) or intact | Riley 2021 | Released loses the glycan; N->D tag +0.984 is isobaric with deamidation -- use PNGase F in H2-18O (+2.988) to disambiguate; N-X-S\u002FT (X!=Pro) sequon is necessary not sufficient |\n\n### Localization scoring\n\n| Tool | Citation | Mechanism | Note |\n|---|---|---|---|\n| Ascore | Beausoleil 2006 | Cumulative binomial of site-determining ions; DIFFERENCE between best and 2nd-best localization, peak-depth sweep | Ascore >=19 ~ p 0.01 PAIRWISE per-PSM, NOT a dataset FLR |\n| PhosphoRS \u002F ptmRS | Taus 2011 | Per-isomer cumulative binomial, tolerance-aware (correct for high-res), per-site probs sum to 100% | In Proteome Discoverer |\n| PTMProphet | Shteynberg (TPP) | EM\u002FBayesian mixture; per-site probs combinable across PSMs to a global FLR | TPP\u002FFragPipe |\n| MaxQuant Localization prob | Cox\u002FMann (Andromeda) | Normalized posterior on the site (fixed peak depth) | column `Localization prob`; >=0.75 = class I |\n| DIA localization | Bekker-Jensen 2020 | XIC peak-shape correlation substitutes for missing precursor isolation | Spectronaut `EG.PTMLocalizationProbabilities`; DIA-NN `PTM.Site.Confidence` |\n| DeepFLR | Zong 2023 | Deep-learning spectrum predictor + target-decoy FLR | SOTA direction; DDA + DIA |\n\n### Site-FDR \u002F FLR (the layer most pipelines skip)\n\n| Tool | Citation | Mechanism |\n|---|---|---|\n| LuciPHOr | Fermin 2013 (MCP) | Decoy localizations on non-modifiable residues; rate decoys win = empirical FLR |\n| LuciPHOr2 | Fermin 2015 (Bioinformatics) | Generic-PTM successor (do NOT swap the two journals) |\n| Decoy amino-acid FLR | Ramsbottom\u002FJones 2022 | Add a non-modifiable residue to the candidate set; global FLR ~ decoy-site-hits \u002F target-site-hits, frequency-corrected |\n\n### Kinase-activity inference\n\n| Tool | Citation | Mechanism | Limitation |\n|---|---|---|---|\n| KSEA | Casado 2013 | z-score of a kinase's substrate fold-changes | sqrt(m) favors well-annotated kinases; inherits PhosphoSitePlus bias |\n| PTM-SEA \u002F PTMsigDB | Krug 2019 | ssGSEA2.0 on site-level +\u002F-7 flanking-sequence signatures | robust to isoform drift; PERT signatures score \"looks like EGF stim\" |\n| RoKAI | Yilmaz 2021 | Network-smooth profiles before z-score so unobserved sites borrow neighbor signal | attacks missingness; feeds KSEA |\n\nBenchmark result (Mueller-Dott 2025): across ~19 methods, simple z-score (KSEA\u002FRoKAI) matched or beat sophisticated methods. Performance is PRIOR-limited, not algorithm-limited; all methods inherit PhosphoSitePlus curation bias toward CK2\u002FCDK1\u002FPKA\u002FMAPK, and the dark kinome is structurally invisible. Spend effort on the substrate prior, not the estimator.\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended | Why |\n|---|---|---|\n| Phospho-only run, want regulated sites | Acquire a PAIRED global proteome -> MSstatsPTM `groupComparisonPTM` -> require significance in `ADJUSTED.Model` | Unadjusted site changes are confounded with protein abundance |\n| No global proteome available | Report site changes as UNADJUSTED (`PTM.Model`; `ADJUSTED.Model` is absent) and flag the confound explicitly; optionally `use_unmod \u003C- TRUE` (passed as `use_unmod_peptides`) uses unmodified peptides co-enriched in the PTM runs as a weak protein proxy, which needs those unmodified rows kept in the evidence -- label those results proxy-adjusted | Cannot separate occupancy from abundance; do not claim \"regulation\" |\n| TMT \u002F isobaric plexes (enriched + global) | Same MSstatsPTM route with `labeling_type = 'TMT'`, `dataSummarizationPTM_TMT`, `groupComparisonPTM(data.type = 'TMT')`, and a `Condition = 'Norm'` reference channel in EVERY plex | The adjustment is identical; only the converter, the summarization function and the test branch differ |\n| More than one TMT plex | Refuse to compare until each plex carries the pooled reference channel; `reference_norm = TRUE` bridges them | Reporter ratios are meaningful only within a plex |\n| Between-method phospho difference | Suspect chemistry (TiO2 vs Fe-IMAC mono\u002Fmulti bias) BEFORE biology | Enrichment is a confounded filter |\n| Multiply-phospho peptides present | Localize per-site (Ascore\u002FptmRS) AND report empirical global FLR | Peptide FDR != site FDR |\n| \"Ubiquitination\" sites | Confirm chloroacetamide alkylation; treat K-GG as ub + NEDD8 + ISG15; consider UbiSite | Iodoacetamide artifact + NEDD8\u002FISG15 confound |\n| Which kinases moved? | KSEA or PTM-SEA with a curated prior; do not over-interpret dark-kinome silence | Prior-limited; simple z-score suffices |\n| Motif logo from the hits | Background = experiment-matched S\u002FT\u002FY from the identified proteins (NOT whole proteome) | Whole-proteome background rediscovers disordered-region composition bias |\n\nDefault when uncertain: localize with the search engine's probability (class I >=0.75), expand MaxQuant multiplicity, run MSstatsPTM with a paired global proteome, and call only `ADJUSTED.Model` hits regulated.\n\n## Expand the MaxQuant Site Table Before Any Quant\n\n**Goal:** Produce a long, multiplicity-resolved, class-I-filtered phosphosite intensity matrix from `Phospho (STY)Sites.txt`.\n\n**Approach:** Each site row spreads its quant across `Intensity___1\u002F___2\u002F___3` (singly\u002Fdoubly\u002Ftriply-phospho forms, THREE underscores); the collapsed base `Intensity` mixes phospho-states and can mask a switch between forms. Per-run columns are `Intensity \u003Cexperiment>___\u003Cn>`; the aggregated `Intensity___\u003Cn>` (no experiment name) is the sum over runs and must NOT be melted as a run. Drop Reverse\u002Fcontaminant, filter `Localization prob`, then melt the per-run, per-multiplicity columns into rows.\n\n```python\nimport os\nimport re\nimport pandas as pd\nimport numpy as np\n\n# Filename has a SPACE in the modification name in current MaxQuant; accept either form.\nsites_file = next(f for f in ['Phospho (STY)Sites.txt', 'Phospho(STY)Sites.txt'] if os.path.exists(f))\nphospho = pd.read_csv(sites_file, sep='\\t', low_memory=False)\n\n# Newer MaxQuant uses 'Potential contaminant'; older uses 'Contaminant'.\ncontaminant_col = 'Potential contaminant' if 'Potential contaminant' in phospho.columns else 'Contaminant'\nphospho = phospho[(phospho['Reverse'] != '+') & (phospho[contaminant_col] != '+')]\n\nCLASS_I_PROB = 0.75  # Olsen 2006 class-I convention; comparability standard, not a calibrated FLR\nphospho = phospho[phospho['Localization prob'] >= CLASS_I_PROB].copy()\n\ngene = phospho['Gene names'].where(phospho['Gene names'].notna(), phospho['Protein'])\nphospho['site_id'] = gene.str.split(';').str[0] + '_' + phospho['Amino acid'] + phospho['Position'].astype(int).astype(str)\n\n# Per-run multiplicity columns 'Intensity \u003Crun>___\u003Cn>' (THREE underscores); the space after 'Intensity'\n# excludes the aggregated 'Intensity___\u003Cn>' sum-over-runs columns.\nmult_cols = [c for c in phospho.columns if re.fullmatch(r'Intensity .+___[123]', c)]\nlong = phospho.melt(id_vars=['site_id', 'Amino acid', 'Position', 'Localization prob'], value_vars=mult_cols, var_name='run_multiplicity', value_name='intensity')\nlong['multiplicity'] = long['run_multiplicity'].str.split('___').str[-1]\nlong['run'] = long['run_multiplicity'].str.replace(r'___[123]$', '', regex=True).str.replace(r'^Intensity ', '', regex=True)\nlong = long[long['intensity'] > 0]\nlong['log2_intensity'] = np.log2(long['intensity'])\n```\n\n## Protein-Level Adjustment with MSstatsPTM\n\n**Goal:** Decide whether each site change is real after subtracting the matched protein-abundance change.\n\n**Approach:** MSstatsPTM carries TWO datasets -- a PTM dataset (enriched) and a PROTEIN dataset (global\u002Funenriched). `groupComparisonPTM` fits independent linear models to each and returns a list of THREE: `PTM.Model` (unadjusted), `PROTEIN.Model`, and `ADJUSTED.Model`. The adjustment is `dFC_adj = dFC_PTM - dFC_protein` with `SE_adj = sqrt(SE_PTM^2 + SE_protein^2)`, so adjustment ADDS uncertainty -- a site can be significant unadjusted yet lose significance after adjustment. A confident regulation call requires significance in `ADJUSTED.Model`.\n\n```r\nlibrary(MSstatsPTM)\nrd \u003C- function(f) read.table(f, sep = '\\t', header = TRUE, quote = '')\n\nuse_unmod \u003C- FALSE   # TRUE only when no global run exists (weak proxy, see Decision Tree)\n\n# The converter uses the best-localized sequence as is and keeps unmodified peptides from the\n# enriched runs, so apply the class-I rule to the enriched evidence FIRST: keep rows carrying the\n# modification whose best site probability (from 'Phospho (STY) Probabilities') is >= 0.75.\n# The use_unmod proxy needs the unmodified rows, so keep those too when it is on.\nev \u003C- rd('evidence_phospho.txt')\nsite_prob \u003C- vapply(regmatches(ev$Phospho..STY..Probabilities,\n                               gregexpr('(?\u003C=\\\\()[0-9.]+(?=\\\\))', ev$Phospho..STY..Probabilities, perl = TRUE)),\n                    function(p) if (length(p)) max(as.numeric(p)) else NA_real_, numeric(1))\nis_mod \u003C- grepl('Phospho \\\\(STY\\\\)', ev$Modified.sequence)\nkeep \u003C- is_mod & !is.na(site_prob) & site_prob >= 0.75\nif (use_unmod) keep \u003C- keep | !is_mod\nev \u003C- ev[keep, ]\n\n# Converters are \u003CTool>toMSstatsPTMFormat and return a list with $PTM and $PROTEIN.\n# MaxQtoMSstatsPTMFormat reads the MaxQuant 'evidence.txt' (NOT the Phospho (STY)Sites\n# table -- the pandas multiplicity-expansion above is a SEPARATE workflow); the FASTA maps\n# peptides back to site coordinates. $PROTEIN is built ONLY when `evidence_prot` (the GLOBAL\n# run's evidence) is given together with its proteinGroups and annotation.\ninput \u003C- MaxQtoMSstatsPTMFormat(\n  evidence = ev,\n  annotation = read.csv('annotation_ptm.csv'),\n  fasta_path = 'uniprot_human.fasta',\n  evidence_prot = rd('evidence_global.txt'),\n  proteinGroups = rd('proteinGroups_global.txt'),\n  annotation_protein = read.csv('annotation_protein.csv'),\n  mod_id = '\\\\(Phospho \\\\(STY\\\\)\\\\)',\n  which_proteinid_ptm = 'Proteins',\n  which_proteinid_protein = 'Proteins',\n  use_unmod_peptides = use_unmod\n)\nstopifnot('PROTEIN' %in% names(input))   # no protein dataset -> nothing to adjust against\n\n# append defaults to TRUE and requires a log file, so set it FALSE when use_log_file = FALSE\nsummarized \u003C- dataSummarizationPTM(input, use_log_file = FALSE, append = FALSE)\n\n# data.type is 'LabelFree' (DDA\u002FDIA label-free) or 'TMT' -- NOT the converter's labeling_type 'LF'.\n# Pass an explicit contrast: the default pairwise Label is 'Control vs Treatment' (log2FC = Control - Treatment).\n# Columns must follow the sorted Condition levels.\ncontrast \u003C- matrix(c(-1, 1), nrow = 1, dimnames = list('Treatment vs Control', c('Control', 'Treatment')))\nresult \u003C- groupComparisonPTM(summarized, data.type = 'LabelFree', contrast.matrix = contrast)\n\n# Three models; the adjusted one is the deliverable. Keep site rows only (Protein_\u003Cresidue>\u003Cposition>).\nadjusted \u003C- result$ADJUSTED.Model\nadjusted \u003C- adjusted[grepl('_[STY][0-9]+', adjusted$Protein), ]\n\n# A claim of \"changed more than 2-fold\" needs the threshold INSIDE the test (TREAT-style), not\n# adj.pvalue \u003C 0.05 & |log2FC| > 1 as a post-hoc double filter, whose FDR refers to log2FC != 0.\nlfc \u003C- 1\nadjusted$pvalue_lfc \u003C- pt((abs(adjusted$log2FC) - lfc) \u002F adjusted$SE, adjusted$DF, lower.tail = FALSE)\nadjusted$adj.pvalue_lfc \u003C- p.adjust(adjusted$pvalue_lfc, method = 'BH')\nregulated \u003C- adjusted[!is.na(adjusted$adj.pvalue_lfc) & adjusted$adj.pvalue_lfc \u003C 0.05, ]\n\n# How much of each call was protein-driven: compare PTM.Model vs ADJUSTED.Model.\n```\n\n### TMT \u002F isobaric plexes -- same adjustment, three different calls\n\n**Goal:** The same protein-adjusted site testing when the enriched and global runs are isobaric-labelled plexes (the dominant platform for large-cohort phosphoproteomics).\n\n**Approach:** Only three things change. `labeling_type = 'TMT'` on the converter (default `'LF'`), `dataSummarizationPTM_TMT` instead of `dataSummarizationPTM` -- a different FUNCTION, not a flag -- and `data.type = 'TMT'` in `groupComparisonPTM`. The annotation is the MSstatsTMT one: `Run`, `Fraction`, `TechRepMixture`, `Channel`, `Condition`, `Mixture`, `BioReplicate` (`Raw.file` is also accepted). Mismatching the two halves fails loudly in BOTH directions, but neither message says \"wrong labeling type\": a label-free annotation with `labeling_type = 'TMT'` gives *`Extra columns included in the annotation file that are not required ... Run, Raw.file, Fraction, TechRepMixture, Channel, Condition, Mixture, BioReplicate`* -- read that list as the spec for the TMT annotation -- and TMT evidence left on the default `'LF'` gives the much less obvious *`A non-empty vector of column names for 'by' is required`*. EVERY plex needs a pooled reference channel carried as `Condition = 'Norm'`; `reference_norm = TRUE` (default) uses it to put plexes on a common scale -- the IRS bridge -- and `remove_norm_channel = TRUE` (default) drops it before testing. Without one, cross-plex comparison is invalid and no amount of downstream modelling repairs it.\n\nTwo TMT-specific traps for the ADJUSTMENT itself, not just for the quant:\n\n1. **Ratio compression biases the subtraction, it does not merely attenuate it.** Co-isolated precursors pull every reporter ratio toward 1, and the PTM and PROTEIN datasets are not compressed equally -- enriched phosphopeptide runs are a sparser, differently-interfered precursor space than the global run. So `dFC_adj = dFC_PTM - dFC_protein` subtracts two differently-shrunken numbers. Use MS3\u002FSPS or FAIMS to reduce it, and read TMT effect sizes as lower bounds; the SIGN and ranking survive, the magnitude does not.\n2. **Label the enriched and global aliquots in the SAME plex** where the design allows. Split across plexes, each dataset carries its own reference-channel normalization and the site-to-protein subtraction inherits both.\n\n```r\nlibrary(MSstatsPTM)\nrd \u003C- function(f) read.table(f, sep = '\\t', header = TRUE, quote = '')\n\n# Class-I pre-filter on the ENRICHED evidence, exactly as in the label-free route above.\nev \u003C- rd('evidence_phospho_tmt.txt')\nsite_prob \u003C- vapply(regmatches(ev$Phospho..STY..Probabilities,\n                               gregexpr('(?\u003C=\\\\()[0-9.]+(?=\\\\))', ev$Phospho..STY..Probabilities, perl = TRUE)),\n                    function(p) if (length(p)) max(as.numeric(p)) else NA_real_, numeric(1))\nev \u003C- ev[grepl('Phospho \\\\(STY\\\\)', ev$Modified.sequence) & !is.na(site_prob) & site_prob >= 0.75, ]\n\n# TMT annotation: Run, Fraction, TechRepMixture, Channel, Condition, Mixture, BioReplicate.\n# Channel is 'channel.1' ... 'channel.N' and maps to the evidence's\n# 'Reporter intensity corrected \u003Cn>' columns; the CORRECTED ones, not the raw reporters.\n# Give the pooled reference channel Condition = 'Norm' in EVERY plex.\ninput \u003C- MaxQtoMSstatsPTMFormat(\n  evidence = ev,\n  annotation = read.csv('annotation_ptm_tmt.csv'),\n  fasta_path = 'uniprot_human.fasta',\n  evidence_prot = rd('evidence_global_tmt.txt'),\n  proteinGroups = rd('proteinGroups_global.txt'),\n  annotation_protein = read.csv('annotation_protein_tmt.csv'),\n  labeling_type = 'TMT',          # the single converter switch; default is 'LF'\n  mod_id = '\\\\(Phospho \\\\(STY\\\\)\\\\)',\n  which_proteinid_ptm = 'Proteins',\n  which_proteinid_protein = 'Proteins',\n  use_unmod_peptides = FALSE)\nstopifnot('PROTEIN' %in% names(input))\n\n# TMT summarization is its own function. reference_norm \u002F reference_norm.PTM (default TRUE) apply\n# the 'Norm'-channel bridge; remove_norm_channel (default TRUE) drops that channel afterwards, so\n# the contrast below names only the biological conditions.\nsummarized \u003C- dataSummarizationPTM_TMT(input, use_log_file = FALSE, append = FALSE)\n\ncontrast \u003C- matrix(c(-1, 1), nrow = 1, dimnames = list('Treatment vs Control', c('Control', 'Treatment')))\nresult \u003C- groupComparisonPTM(summarized, data.type = 'TMT', contrast.matrix = contrast)\n\nadjusted \u003C- result$ADJUSTED.Model\nadjusted \u003C- adjusted[grepl('_[STY][0-9]+', adjusted$Protein), ]\n# From here the TREAT-style threshold, the PTM.Model-vs-ADJUSTED.Model comparison and the KSEA\n# block below are identical to the label-free route -- only the three calls above differ.\n```\n\nStarting from `Phospho (STY)Sites.txt` instead of `evidence.txt` (the `sites_data =` argument) is the one place `TMT_keyword` matters: there the converter builds column names as `Reporter.intensity.corrected.\u003Cn>.\u003CTMT_keyword>\u003Cmixture>`, so `TMT_keyword` must match how the site table's reporter columns were named. It is ignored on the `evidence =` route shown above.\n\n## Motif Analysis with the Correct Background\n\n**Goal:** Find kinase\u002Fwriter motifs around the modified residue without rediscovering amino-acid composition bias.\n\n**Approach:** Use the `Sequence window` (+\u002F-15 residues, 31-mer) MaxQuant already provides, centered on the site. The background MUST be an experiment-matched S\u002FT\u002FY set drawn from the identified proteins (or a central-residue-preserving shuffle), NOT the whole proteome or IUPAC-random -- those just report the composition of phospho-rich disordered regions. motif-x and MoMo p-values are only valid when the background is built this way.\n\n```python\nfrom collections import Counter\nimport pandas as pd\nfrom scipy.stats import fisher_exact, false_discovery_control\n\n# 'Sequence window' is a 31-mer (+\u002F-15) centered on the modified residue.\nWINDOW_HALF = 7  # +\u002F-7 flanking is the standard kinase-motif window\n# foreground: e.g. the regulated-up class-I sites; here all class-I sites from the expansion block\nforeground = [w[15 - WINDOW_HALF: 16 + WINDOW_HALF] for w in phospho['Sequence window'].dropna() if len(w) >= 31]\n\ndef matched_background(fasta, accessions, residues='ST'):\n    '''Every S\u002FT (or Y) window in the IDENTIFIED proteins, central residue preserved.\n    fasta: {accession: sequence}; accessions: proteins identified in this experiment.'''\n    windows = []\n    for acc in accessions:\n        seq = fasta[acc]\n        for i, aa in enumerate(seq):\n            if aa in residues:\n                windows.append(''.join(seq[j] if 0 \u003C= j \u003C len(seq) else '_' for j in range(i - WINDOW_HALF, i + WINDOW_HALF + 1)))\n    return windows\n\ndef position_frequencies(windows):\n    counts = {i: Counter() for i in range(-WINDOW_HALF, WINDOW_HALF + 1)}\n    for w in windows:\n        for offset, aa in zip(range(-WINDOW_HALF, WINDOW_HALF + 1), w):\n            if aa not in '_X':\n                counts[offset][aa] += 1\n    return counts\n\ndef motif_enrichment(fg_windows, bg_windows):\n    '''One-sided Fisher test per (position, residue), BH-adjusted across all tests.'''\n    fg, bg = position_frequencies(fg_windows), position_frequencies(bg_windows)\n    rows = []\n    for offset in fg:\n        if offset == 0:\n            continue\n        n_fg, n_bg = sum(fg[offset].values()), sum(bg[offset].values())\n        for aa, k in fg[offset].items():\n            _, p = fisher_exact([[k, n_fg - k], [bg[offset][aa], n_bg - bg[offset][aa]]], alternative='greater')\n            rows.append({'offset': offset, 'aa': aa, 'fg': k, 'fg_total': n_fg, 'bg': bg[offset][aa], 'bg_total': n_bg, 'p': p})\n    table = pd.DataFrame(rows)\n    table['q'] = false_discovery_control(table['p'], method='bh')\n    return table.sort_values('p')\n```\n\nFor a publication-grade enrichment logo, hand the foreground and a matched background to a dedicated tool (motif-x \u002F MoMo) and render with data-visualization\u002Fsequence-logos.\n\n## Kinase Activity with KSEAapp\n\n**Goal:** Score kinase activity from the protein-adjusted site fold-changes.\n\n**Approach:** `KSEAapp::KSEA.Scores` merges the site table with a kinase-substrate prior on gene symbol + residue and returns a z-score per kinase with its substrate count `m`. The prior (`KSData`: PhosphoSitePlus + NetworKIN table with `KINASE`, `SUB_GENE`, `SUB_MOD_RSD`, `Source`, `networkin_score` columns) must be the full file from github.com\u002Fcasecpb\u002FKSEA; the package's `data(KSData)` is an abbreviated demonstration subset. `PX` needs six columns in this exact order, and `FC` is a LINEAR ratio (the function takes log2 itself), treatment over control.\n\n```r\nlibrary(KSEAapp)\nKSData \u003C- read.csv('PSP&NetworKIN_Kinase_Substrate_Dataset.csv')   # user-supplied prior\npg \u003C- rd('proteinGroups_global.txt')\ngene_symbol \u003C- setNames(sub(';.*', '', pg$Gene.names), sub(';.*', '', pg$Protein.IDs))\n\n# log2FC = +\u002F-Inf (site measured in one condition only) gives FC = 0 or Inf, and one such row\n# turns every kinase z-score NaN; filter on log2FC, not on the linear FC (0 is finite)\nks \u003C- adjusted[is.finite(adjusted$log2FC), ]\nif (nrow(ks) == 0)\n  stop('No site has a finite log2FC -- every row of the adjusted table is +\u002F-Inf or NA, i.e. every ',\n       'site was quantified in one condition only. KSEA scores fold changes, not presence\u002Fabsence; ',\n       'report those sites as detected-in-one-condition instead.')\nPX \u003C- data.frame(\n  Protein = sub('_[STY][0-9]+$', '', ks$Protein),\n  Gene = gene_symbol[sub('_[STY][0-9]+$', '', ks$Protein)],   # HUGO symbol; merge key with SUB_GENE\n  Peptide = rep('NULL', nrow(ks)),   # rep(), not the bare literal: a length-1 value against\n                                     # zero-length columns is 'differing number of rows: 0, 1'\n  Residue.Both = sub('^.*_', '', ks$Protein),                  # e.g. S473; merge key with SUB_MOD_RSD\n  p = ks$adj.pvalue,\n  FC = 2^ks$log2FC)   # Treatment\u002FControl because the contrast above is 'Treatment vs Control'\nPX \u003C- PX[!is.na(PX$Gene), ]\nif (nrow(PX) == 0)\n  stop('PX is empty after dropping sites with no gene symbol: proteinGroups_global.txt carried no ',\n       '`Gene names` for any tested protein. Check the search FASTA had gene annotation, or map the ',\n       'accessions to HUGO symbols yourself before building PX.')\n\n# Check PRIOR COVERAGE before calling. KSEA.Scores merges on SUB_GENE + SUB_MOD_RSD and then\n# aggregates, so a prior overlapping this site list in 0 or 1 place dies inside the package with\n# `no rows to aggregate` -- a message that says nothing about coverage. Curated priors cover only a\n# small fraction of any real site list, so this is the common failure, not an exotic one.\nprior \u003C- KSData[grep('PhosphoSitePlus', KSData$Source), ]   # the subset NetworKIN = FALSE will use\ncovered \u003C- sum(paste(PX$Gene, PX$Residue.Both) %in% paste(prior$SUB_GENE, prior$SUB_MOD_RSD))\ncat('sites in PX:', nrow(PX), '| covered by the prior:', covered, '\\n')\nif (covered \u003C 2)\n  stop('The kinase-substrate prior covers ', covered, ' of ', nrow(PX), ' sites, so KSEA has ',\n       'nothing to score. Check that KSData is the FULL PhosphoSitePlus+NetworKIN table (not the ',\n       'abbreviated data(KSData)), that Gene holds HUGO symbols matching SUB_GENE, and that ',\n       'Residue.Both is formatted like SUB_MOD_RSD (S473, not pS473 or Ser473).')\n\n# NetworKIN = FALSE: PhosphoSitePlus-curated pairs only; TRUE adds predictions above NetworKIN.cutoff\n# (and then coverage should be counted against that subset instead).\nkinase_scores \u003C- KSEA.Scores(KSData, PX, NetworKIN = FALSE, NetworKIN.cutoff = 3)\nkinase_scores[order(kinase_scores$z.score), c('Kinase.Gene', 'm', 'z.score', 'FDR')]\n```\n\nIf the contrast Label reads `Control vs Treatment`, use `FC = 2^(-log2FC)`, or every kinase's sign inverts.\n\n## A Note on Home-Grown Ascore\n\nThe function below is an ILLUSTRATIVE approximation, NOT real Ascore. Real Ascore (Beausoleil 2006) competes the best localization against the second-best, sweeps peak depth 1-10 per 100 Th, and restricts to site-determining ions -- none of which this captures. Use the search engine's own localization probability (MaxQuant `Localization prob`, ptmRS, PTMProphet) for real work, or pyOpenMS `AScore` (introspect the exact API before relying on it). The home-grown form is here only to show the binomial intuition.\n\n```python\nimport numpy as np\nfrom scipy.stats import binom\n\ndef illustrative_localization_score(matched_site_ions, total_ions, depth_p=0.04):\n    '''Binomial intuition only; NOT Ascore (no best-vs-second competition or depth sweep).'''\n    if total_ions == 0 or matched_site_ions == 0:\n        return 0.0\n    p_random = 1 - binom.cdf(matched_site_ions - 1, total_ions, depth_p)\n    return -10 * np.log10(p_random) if p_random > 0 else 100.0\n```\n\n## Per-Method Failure Modes\n\n### Skipping protein-level adjustment\n**Trigger:** Differential testing on a phospho-only run with no paired global proteome. **Mechanism:** `log2FC(PTM_observed) = log2FC(occupancy) + log2FC(protein)`; the two terms are inseparable. **Symptom:** Pathway-coherent \"regulated sites\" that are pure protein-abundance changes (cyclins\u002Fhistones in cell cycle, stabilized substrates under drug). **Fix:** Run a matched global proteome and adjust via MSstatsPTM; route the protein-level quant to quantification.\n\n### Collapsing the MaxQuant multiplicity\n**Trigger:** Quantifying on base `Intensity` instead of `Intensity___1\u002F___2\u002F___3`. **Mechanism:** The collapsed column mixes singly\u002Fdoubly\u002Ftriply-phospho forms of the same site. **Symptom:** A switch between forms is masked: the singly-phospho form dropping while the doubly-phospho form rises reads as no change (synthetic test: collapsed +0.16 log2, ___1 -1.40, ___2 +1.56). **Fix:** Expand multiplicity to long form (Perseus \"Expand site table\" or the melt above) before any stats.\n\n### Treating identification as localization\n**Trigger:** Reporting sites at peptide FDR without a localization threshold. **Mechanism:** Isobaric positional isomers share precursor mass and peptide score; CID\u002Fion-trap neutral loss (-98 Da) starves site-determining ions. **Symptom:** A 1% peptide FDR result with a much higher true site error. **Fix:** Filter localization probability (class I >=0.75) in EVERY route, including the evidence fed to MSstatsPTM; report an empirical global FLR (LuciPHOr2\u002FDeepFLR), prefer HCD\u002FEThcD. Empirical FLR needs the spectra (mzML); from MaxQuant txt tables alone, report only the model-based expected FLR `mean(1 - Localization prob)` over the accepted sites and label it as such -- it misses mis-assignment sources the search model does not know about.\n\n### diGly read as ubiquitin\n**Trigger:** Calling the K-GG proteome \"ubiquitination\". **Mechanism:** NEDD8 and ISG15 share the LRLRGG C-terminus and leave the identical +114.0429 remnant; iodoacetamide adds a fourth source. **Symptom:** Inflated\u002Ffalse ubiquitin sites, worst under interferon (ISG15) or with iodoacetamide. **Fix:** Ask which alkylation reagent was used; chloroacetamide for future experiments; treat K-GG as ub+NEDD8+ISG15; use UbiSite for ubiquitin-specific mapping. For data already acquired, flag K-GG on the peptide C-terminal lysine (a GG-modified K blocks trypsin, so a C-terminal GG-K is suspect): `ev['Modified sequence'].str.contains(r'K\\(GlyGly \\(K\\)\\)_$')`.\n\n### Motif logo against the wrong background\n**Trigger:** Whole-proteome or IUPAC-random background. **Mechanism:** Phosphosites sit in disordered, Ser\u002FPro\u002Facidic-rich regions; that composition dominates the enrichment. **Symptom:** \"Enriched\" proline\u002Fserine motifs that are region bias, not kinase preference. **Fix:** Experiment-matched S\u002FT\u002FY background or central-residue-preserving shuffle (MoMo default).\n\n### Over-reading kinase-activity output\n**Trigger:** Naming the top KSEA\u002Fatlas kinase as the responsible enzyme. **Mechanism:** Substrate priors are PhosphoSitePlus-curated (CK2\u002FCDK1\u002FPKA\u002FMAPK heavy); atlas hits are biochemical preference ignoring expression\u002Flocalization\u002Ftiming. **Symptom:** Always-the-usual-suspects kinase lists; dark-kinome activity invisible. **Fix:** Use a curated prior, report z-scores with their substrate counts, do not infer absence from silence.\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|---|---|---|\n| Localization prob class I >= 0.75 | Olsen 2006 | Best site holds >3x the posterior of all alternatives (single-phospho); a comparability standard, not a calibrated error rate |\n| Class II 0.5-0.75; class III 0.25-0.5 | Olsen 2006 | Partial \u002F poor localization |\n| Ascore >= 19 (p~0.01); loose >13 | Beausoleil 2006 | Pairwise per-PSM best-vs-next confidence; NOT a dataset FLR |\n| DIA directDIA localization >= 0.99 | Bekker-Jensen 2020 | Stricter than library-based (0.75) to match DDA error rates |\n| DIA-NN site matrix 0.90 \u002F 0.99 | DIA-NN docs | phosphosites_90\u002F99.tsv; class-I-equivalent stringency is HIGHER than MaxQuant 0.75 |\n| Acetyl missed cleavages >= 4 | -- | Acetyl-K blocks trypsin; pair LysC + trypsin |\n| Kinase atlas motif match >= 90th percentile | Johnson 2023 | Strong motif preference, NOT proof the kinase acted |\n| Report peptide FDR and site FLR separately | Fermin 2013 | 1% peptide FDR != 1% site FDR; true site error is typically several-fold higher |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|---|---|---|\n| FileNotFoundError on the sites table | Filename has a SPACE: `Phospho (STY)Sites.txt` | Accept either spaced or no-space form |\n| Form switch hidden (no change on a site that switched singly\u002Fdoubly) | Quantified base `Intensity`, mixing multiplicities | Use `Intensity \u003Crun>___1\u002F___2\u002F___3` (three underscores) |\n| Extra \"run\" named `Intensity` in the long table, ~2.7 log2 above the others | Melt also matched the aggregated `Intensity___1\u002F2\u002F3` columns | Select `Intensity \u003Crun>___n` (note the space) |\n| `Assertion on '!(append & !use_log_file)' failed` | `dataSummarizationPTM` defaults `append = TRUE` | `dataSummarizationPTM(input, use_log_file = FALSE, append = FALSE)` |\n| `object 'ptm_model' not found` in `groupComparisonPTM` | `data.type = 'LF'` matches neither branch | `data.type = 'LabelFree'` (or `'TMT'`) |\n| `Extra columns included in the annotation file that are not required ... Run, Raw.file, Fraction, TechRepMixture, Channel, Condition, Mixture, BioReplicate` | a label-free annotation passed with `labeling_type = 'TMT'` | Use the TMT annotation columns the message itself lists |\n| `A non-empty vector of column names for 'by' is required` from `MaxQtoMSstatsPTMFormat` | TMT evidence left on the default `labeling_type = 'LF'`; the message never mentions labeling | `labeling_type = 'TMT'`, then `dataSummarizationPTM_TMT` and `data.type = 'TMT'` |\n| `names(input)` is only `PTM`; `ADJUSTED.Model` missing | `evidence_prot` not passed to `MaxQtoMSstatsPTMFormat` | Pass the global run's evidence as `evidence_prot`; `stopifnot('PROTEIN' %in% names(input))` |\n| `z.score` NaN for every kinase from `KSEA.Scores` | a site with log2FC -Inf\u002FInf (missing in one condition) entered PX; FC = 0 passes `is.finite(FC)` | drop rows with non-finite `log2FC` before building PX |\n| `arguments imply differing number of rows: 0, 1` while building PX | the non-finite-`log2FC` filter emptied the table, and `Peptide = 'NULL'` is a length-1 literal against zero-length columns | guard `nrow(ks) == 0` with a message about one-condition sites, and use `rep('NULL', nrow(ks))` |\n| `no rows to aggregate` from `KSEA.Scores` | the prior overlaps the site list in 0 or 1 place -- usually the abbreviated `data(KSData)`, a non-HUGO `Gene` column, or residues written `pS473`\u002F`Ser473` | count `paste(Gene, Residue.Both)` against `paste(SUB_GENE, SUB_MOD_RSD)` before calling and stop with the coverage number |\n| `Can't assign 4 names to a 0-column data.table` with `use_unmod_peptides = TRUE` | the evidence pre-filter removed every unmodified row | set `use_unmod \u003C- TRUE` so unmodified rows are kept; the class-I rule applies to modified rows only |\n| Site signs inverted in KSEA \u002F up-down calls | Default pairwise Label `Control vs Treatment` means log2FC = Control - Treatment | Check `adjusted$Label` or pass an explicit `contrast.matrix` |\n| Protein names without a site suffix in `ADJUSTED.Model` | Unmodified peptides from the enriched runs entered `$PTM` | Pre-filter evidence to modified rows; drop rows without `_\u003Cresidue>\u003Cposition>` |\n| KeyError \u002F NaN on `Gene names` | Column is FASTA-dependent, absent without gene annotation | Guard with `.notna()` and fall back to `Protein` |\n| All sites \"regulated\" and pathway-coherent | No protein-level adjustment | Require significance in MSstatsPTM `ADJUSTED.Model` |\n| `PTM.Q.Value` \u002F `PhosphoSite` not found (DIA-NN) | Those columns do not exist | Use `PTM.Site.Confidence` and `Site.Occupancy.Probabilities` |\n| False \"ubiquitination\" sites | Iodoacetamide +114.0429 lysine artifact | Alkylate with chloroacetamide |\n| Acetyl confused with trimethyl | +42.0106 vs +42.0470 isobaric at nominal mass | Require high-res MS; check 0.0364 Da split |\n\n## References\n\n- Beausoleil SA, Villen J, Gerber SA, Rush J, Gygi SP. A probability-based approach for high-throughput protein phosphorylation analysis and site localization. *Nat Biotechnol* 2006;24(10):1285-1292.\n- Taus T, Kocher T, Pichler P, et al. Universal and confident phosphorylation site localization using phosphoRS. *J Proteome Res* 2011;10(12):5354-5362.\n- Olsen JV, Blagoev B, Gnad F, et al. Global, in vivo, and site-specific phosphorylation dynamics in signaling networks. *Cell* 2006;127(3):635-648.\n- Fermin D, Walmsley SJ, Gingras AC, Choi H, Nesvizhskii AI. LuciPHOr: algorithm for phosphorylation site localization with false localization rate estimation using modified target-decoy approach. *Mol Cell Proteomics* 2013;12(11):3409-3419.\n- Fermin D, Avtonomov D, Choi H, Nesvizhskii AI. LuciPHOr2: site localization of generic PTMs from tandem mass spectrometry data. *Bioinformatics* 2015;31(7):1141-1143.\n- Bekker-Jensen DB, Bernhardt OM, Hogrebe A, et al. Rapid and site-specific deep phosphoproteome profiling by data-independent acquisition without the need for spectral libraries. *Nat Commun* 2020;11:787.\n- Kohler D, Tsai TH, Verschueren E, et al. MSstatsPTM: Statistical Relative Quantification of Posttranslational Modifications in Bottom-Up Mass Spectrometry-Based Proteomics. *Mol Cell Proteomics* 2023;22(1):100477.\n- Ochoa D, Jarnuczak AF, Vieitez C, et al. The functional landscape of the human phosphoproteome. *Nat Biotechnol* 2020;38(3):365-373.\n- Casado P, Rodriguez-Prados JC, Cosulich SC, et al. Kinase-Substrate Enrichment Analysis Provides Insights into the Heterogeneity of Signaling Pathway Activation in Leukemia Cells. *Sci Signal* 2013;6(268):rs6.\n- Krug K, Mertins P, Zhang B, et al. A Curated Resource for Phosphosite-specific Signature Analysis. *Mol Cell Proteomics* 2019;18(3):576-593.\n- Yilmaz S, Ayati M, Schlatzer D, et al. Robust inference of kinase activity using functional networks. *Nat Commun* 2021;12:1177.\n- Larsen MR, Thingholm TE, Jensen ON, Roepstorff P, Jorgensen TJD. Highly selective enrichment of phosphorylated peptides from peptide mixtures using titanium dioxide microcolumns. *Mol Cell Proteomics* 2005;4(7):873-886.\n- Ruprecht B, Koch H, Medard G, et al. Comprehensive and reproducible phosphopeptide enrichment using iron immobilized metal ion affinity chromatography (Fe-IMAC) columns. *Mol Cell Proteomics* 2015;14(1):205-215.\n- Matheron L, van den Toorn H, Heck AJR, Mohammed S. Characterization of biases in phosphopeptide enrichment by Ti(IV)-IMAC and TiO2 using a massive synthetic library and human cell digests. *Anal Chem* 2014;86(16):8312-8320.\n- Thingholm TE, Jensen ON, Robinson PJ, Larsen MR. SIMAC (sequential elution from IMAC), a phosphoproteomics strategy for the rapid separation of monophosphorylated from multiply phosphorylated peptides. *Mol Cell Proteomics* 2008;7(4):661-671.\n- Svinkina T, Gu H, Silva JC, et al. Deep, Quantitative Coverage of the Lysine Acetylome Using Novel Anti-acetyl-lysine Antibodies and an Optimized Proteomic Workflow. *Mol Cell Proteomics* 2015;14(9):2429-2440.\n- Xu G, Paige JS, Jaffrey SR. Global analysis of lysine ubiquitination by ubiquitin remnant immunoaffinity profiling. *Nat Biotechnol* 2010;28(8):868-873.\n- Kim W, Bennett EJ, Huttlin EL, et al. Systematic and Quantitative Assessment of the Ubiquitin-Modified Proteome. *Mol Cell* 2011;44(2):325-340.\n- Nielsen ML, Vermeulen M, Bonaldi T, Cox J, Moroder L, Mann M. Iodoacetamide-induced artifact mimics ubiquitination in mass spectrometry. *Nat Methods* 2008;5(6):459-460.\n- Akimov V, Barrio-Hernandez I, Hansen SVF, et al. UbiSite approach for comprehensive mapping of lysine and N-terminal ubiquitination sites. *Nat Struct Mol Biol* 2018;25(7):631-640.\n- Riley NM, Bertozzi CR, Pitteri SJ. A Pragmatic Guide to Enrichment Strategies for Mass Spectrometry-Based Glycoproteomics. *Mol Cell Proteomics* 2021;20:100029.\n- Johnson JL, Yaron TM, Huntsman EM, et al. An atlas of substrate specificities for the human serine\u002Fthreonine kinome. *Nature* 2023;613(7945):759-766.\n- Mueller-Dott S, Jaehnig EJ, et al. Comprehensive evaluation of phosphoproteomic-based kinase activity inference. *Nat Commun* 2025;16:4771.\n- Zong Y, Wang Y, Yang Y, et al. DeepFLR facilitates false localization rate control in phosphoproteomics. *Nat Commun* 2023;14:2269.\n- Ramsbottom KA, Prakash A, Riverol YP, et al. Method for independent estimation of the false localization rate for phosphoproteomics. *J Proteome Res* 2022;21(7):1603-1615.\n\n## Related Skills\n\n- peptide-identification - Identify modified peptides and run open\u002Fvariable-mod search\n- quantification - Underlying protein-level quant feeding the MSstatsPTM PROTEIN dataset\n- differential-abundance - Moderated testing on the protein-level intensity matrix\n- pathway-analysis\u002Fgsea - Enrichment scoring of regulated-site protein lists and PTM-SEA-style signatures\n- data-visualization\u002Fsequence-logos - Render motif logos from the foreground\u002Fbackground windows\n",{"name":5,"tool_type":24,"description":7,"primary_tool":25},"mixed","MSstatsPTM","main","e0956dc9606356ab78468936b502e55a365282e2","specialists\u002Fmass-spec-proteomics-analyst\u002Fversions\u002F1.0.1\u002Fpackage\u002Fskills\u002Fbio-proteomics-ptm-analysis",0,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists","https:\u002F\u002Fgithub.com\u002Fmrsonord2240","2026-10-12 03:19:04",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-proteomics-ptm-analysis",{"tool":39,"command":40},"bunx","bunx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-proteomics-ptm-analysis",{"tool":42,"command":43},"pnpm","pnpm dlx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-proteomics-ptm-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmass-spec-proteomics-analyst\u002Fversions\u002F1.0.1\u002Fpackage\u002Fskills\u002Fbio-proteomics-ptm-analysis\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"examples\u002Fphospho_analysis.py","SCRIPT","脚本",4373,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmass-spec-proteomics-analyst\u002Fversions\u002F1.0.1\u002Fpackage\u002Fskills\u002Fbio-proteomics-ptm-analysis\u002Fexamples\u002Fphospho_analysis.py",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"usage-guide.md","REFERENCE","参考文档",4853,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmass-spec-proteomics-analyst\u002Fversions\u002F1.0.1\u002Fpackage\u002Fskills\u002Fbio-proteomics-ptm-analysis\u002Fusage-guide.md",[60,67,74,81,88,95],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7CW36A6QAGWFE2C008M1XPG","bio-workflows-metabolomics-pipeline","Orchestrates the untargeted LC-MS metabolomics pipeline end-to-end (xcms 4.x feature extraction, QC\u002Fdrift\u002Fnormalization, confidence-stratified annotation, permutation-validated statistics, background-aware pathway mapping), naming what each stage decides and where it silently fails. Use when running a full LC-MS metabolomics study from raw mzML to enriched pathways and needing the honest handoffs between stages. Each stage defers to its component skill for parameters and traps; for stable-isotope flux (a separate branch, not this untargeted flow) see metabolomics\u002Fisotope-tracing.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-workflows-metabolomics-pipeline\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7CW2Y18623NA2S1Y30FRQW1","bio-metabolomics-xcms-preprocessing","Programmatic untargeted LC-MS feature extraction in R with the modern xcms 4.x MsExperiment\u002FXcmsExperiment API, taking raw mzML to a feature table via CentWave peak detection, retention-time alignment, peak-density correspondence, gap-filling, CAMERA redundancy collapse, and built-in QC feature filtering. Use when converting centroided LC-MS runs into a features-by-samples matrix and deciding centWave\u002Fgrouping\u002Falignment parameters. For drift correction and QC\u002FCV filtering execution see metabolomics\u002Fnormalization-qc; for metabolite identification see metabolomics\u002Fmetabolite-annotation; for the MS-DIAL GUI alternative with MS2Dec deconvolution see metabolomics\u002Fmsdial-preprocessing; for downstream statistics see metabolomics\u002Fstatistical-analysis.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-xcms-preprocessing\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7CW2M364HVWPNQEKE2WP4PP","bio-metabolomics-statistical-analysis","Decision-grade statistical analysis for metabolomics intensity tables. Covers transformation and scaling (Pareto vs unit-variance as a hidden hypothesis), unsupervised structure (PCA\u002FHCA for QC), permutation-validated PLS-DA\u002FOPLS-DA (R2 vs Q2, double CV, VIP as heuristic), univariate testing (Welch\u002FMann-Whitney\u002FANOVA\u002FLMM with covariate adjustment), and dependence-aware multiple testing. Use when testing which metabolites differ, building or validating a discriminant model, choosing a scaling, or correcting many correlated tests. For sample-wise normalization\u002Fdrift correction see metabolomics\u002Fnormalization-qc; for ML classifiers and selection-inside-CV leakage see machine-learning\u002Fbiomarker-discovery and machine-learning\u002Fmodel-validation; for pathway interpretation see metabolomics\u002Fpathway-mapping; for design\u002Fpower\u002Fmultiplicity regime see experimental-design\u002Fmultiple-testing.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-statistical-analysis\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7CW2BCBF851WYE03Z8XPEDQ","bio-metabolomics-pathway-mapping","Maps metabolomics results to biological pathways via over-representation (ORA), metabolite-set enrichment (MSEA\u002FQEA), mummichog\u002FPSEA on raw m\u002Fz peaks, and network-diffusion enrichment (FELLA), with correct background-set construction and honest interpretive ceilings. Use when interpreting differential metabolites or an untargeted LC-MS feature table in pathway context, choosing ORA vs MSEA vs mummichog vs topology, or setting the reference\u002Fbackground set. For annotation confidence levels feeding ORA see metabolomics\u002Fmetabolite-annotation; for gene-set concepts see pathway-analysis\u002Fgo-enrichment and pathway-analysis\u002Fgsea; for joint gene+metabolite pathways see multi-omics-integration\u002Fmofa-integration.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-pathway-mapping\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7CW21NSZMCPMF7D9CHJM718","bio-metabolomics-normalization-qc","Designs QC, corrects signal drift, removes batch effects, filters features, normalizes samples, and imputes missing values for untargeted LC-MS\u002FGC-MS metabolomics, framing each step as a measurement model that can create or erase biological signal. Use when processing a peak\u002Ffeature table before statistical analysis, choosing a drift-correction or sample-normalization method, deciding QC RSD vs D-ratio filtering, or handling left-censored missing values. The feature table is produced by metabolomics\u002Fxcms-preprocessing or metabolomics\u002Fmsdial-preprocessing; transformation\u002Fscaling for modeling defers to metabolomics\u002Fstatistical-analysis; cross-study design issues link to experimental-design\u002Fbatch-design.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-normalization-qc\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7CW1SWVM0NYHVE6Q7MA3G7R","bio-metabolomics-msdial-preprocessing","Runs the MS-DIAL preprocessing workflow (peak picking, MS2Dec spectral deconvolution, alignment, gap-filling) and imports the alignment-result table into R or Python with honest filtering. Use when preprocessing LC-MS DDA\u002FDIA (SWATH) or GC-MS raw data with MS-DIAL, deciding MS-DIAL vs XCMS, configuring the MSDIALCUI console run, or parsing an MS-DIAL export into a clean feature matrix. For programmatic R peak detection and the feature-table-as-artifact framing see metabolomics\u002Fxcms-preprocessing; for lipid annotation mode see metabolomics\u002Flipidomics; for MSI-level confidence honesty see metabolomics\u002Fmetabolite-annotation; for drift correction and QC see metabolomics\u002Fnormalization-qc.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-msdial-preprocessing\u002FSKILL.md",[],[]]