@datagrok/proteomics 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -3
- package/CLAUDE.md +178 -0
- package/README.md +195 -3
- package/detectors.js +152 -9
- package/dist/package-test.js +1 -1744
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -146
- package/dist/package.js.map +1 -1
- package/docs/personas-and-capabilities.md +165 -0
- package/files/demo/README.md +264 -0
- package/files/demo/cptac-spike-in.txt +1571 -0
- package/files/demo/enrichment-demo.csv +120 -0
- package/files/demo/fragpipe-smoke-test.tsv +11 -0
- package/files/demo/proteinGroups.txt +28 -0
- package/files/demo/spectronaut-hye-candidates.tsv +94 -0
- package/files/demo/spectronaut-hye-demo.tsv +8761 -0
- package/files/demo/spectronaut-hye-mix.tsv +8761 -0
- package/files/demo/spectronaut-hye-precursor-golden.json +938 -0
- package/files/demo/spectronaut-hye-precursor-golden.tsv +235 -0
- package/files/demo/spectronaut-hye-precursor.tsv +493 -0
- package/images/enrichment-crosslink.png +0 -0
- package/images/enrichment-term-selected.png +0 -0
- package/images/hero.png +0 -0
- package/images/pipeline.svg +80 -0
- package/package.json +87 -62
- package/scripts/deqms_de.R +60 -0
- package/scripts/limma_de.R +42 -0
- package/scripts/vsn_normalize.R +19 -0
- package/src/analysis/differential-expression.ts +450 -0
- package/src/analysis/enrichment-export.ts +101 -0
- package/src/analysis/enrichment.ts +602 -0
- package/src/analysis/experiment-setup.ts +199 -0
- package/src/analysis/imputation.ts +407 -0
- package/src/analysis/log2-scale.ts +139 -0
- package/src/analysis/normalization.ts +255 -0
- package/src/analysis/pca.ts +254 -0
- package/src/analysis/spc-storage.ts +515 -0
- package/src/analysis/spc.ts +544 -0
- package/src/analysis/subcellular-location.ts +431 -0
- package/src/demo/enrichment-demo.ts +94 -0
- package/src/demo/proteomics-demo.ts +123 -0
- package/src/global.d.ts +15 -0
- package/src/menu.ts +133 -0
- package/src/package-api.ts +136 -14
- package/src/package-test.ts +45 -20
- package/src/package.g.ts +161 -0
- package/src/package.ts +1029 -17
- package/src/panels/protein-focus.ts +63 -0
- package/src/panels/published-analysis-panel.ts +151 -0
- package/src/panels/uniprot-panel.ts +349 -0
- package/src/parsers/fragpipe-parser.ts +200 -0
- package/src/parsers/generic-parser.ts +197 -0
- package/src/parsers/maxquant-parser.ts +162 -0
- package/src/parsers/shared-utils.ts +163 -0
- package/src/parsers/spectronaut-candidates-parser.ts +307 -0
- package/src/parsers/spectronaut-parser.ts +604 -0
- package/src/publishing/assert-published-shape.ts +260 -0
- package/src/publishing/post-open-recovery.ts +104 -0
- package/src/publishing/publish-project.ts +515 -0
- package/src/publishing/publish-settings.ts +59 -0
- package/src/publishing/publish-state.ts +316 -0
- package/src/publishing/share-dialog.ts +171 -0
- package/src/publishing/trim-dataframe.ts +247 -0
- package/src/tests/analysis.ts +658 -0
- package/src/tests/enrichment-export.ts +61 -0
- package/src/tests/enrichment-visualization.ts +340 -0
- package/src/tests/enrichment.ts +224 -0
- package/src/tests/fragpipe-e2e.ts +74 -0
- package/src/tests/fragpipe-parser.ts +147 -0
- package/src/tests/gene-label-resolver.ts +387 -0
- package/src/tests/generic-parser.ts +152 -0
- package/src/tests/group-mean-correlation.ts +139 -0
- package/src/tests/log2-scale.ts +93 -0
- package/src/tests/organisms.ts +56 -0
- package/src/tests/parsers.ts +182 -0
- package/src/tests/publish-roundtrip.ts +584 -0
- package/src/tests/publish-spike.ts +377 -0
- package/src/tests/qc-dashboard.ts +210 -0
- package/src/tests/smart-pathway-filter.ts +193 -0
- package/src/tests/spc-formula-lines-spike.ts +129 -0
- package/src/tests/spc.ts +640 -0
- package/src/tests/spectronaut-candidates-e2e.ts +140 -0
- package/src/tests/spectronaut-candidates-parser.ts +398 -0
- package/src/tests/spectronaut-parser.ts +668 -0
- package/src/tests/subcellular-location.ts +361 -0
- package/src/tests/uniprot-panel.ts +202 -0
- package/src/tests/volcano.ts +603 -0
- package/src/utils/column-detection.ts +28 -0
- package/src/utils/gene-label-resolver.ts +443 -0
- package/src/utils/organisms.ts +82 -0
- package/src/utils/proteomics-types.ts +30 -0
- package/src/viewers/enrichment-viewers.ts +274 -0
- package/src/viewers/group-mean-correlation.ts +218 -0
- package/src/viewers/heatmap.ts +168 -0
- package/src/viewers/pca-plot.ts +169 -0
- package/src/viewers/qc-computations.ts +266 -0
- package/src/viewers/qc-dashboard.ts +176 -0
- package/src/viewers/spc-dashboard.ts +755 -0
- package/src/viewers/volcano.ts +690 -0
- package/test-console-output-1.log +2055 -0
- package/test-record-1.mp4 +0 -0
- package/tools/derive-precursor-golden-sidecar.mjs +81 -0
- package/tools/generate-enrichment-fixture.sh +160 -0
- package/tools/generate-spectronaut-candidates-fixture.mjs +212 -0
- package/tools/generate-spectronaut-precursor-fixture.mjs +128 -0
- package/tools/spectronaut-aggregate.sh +46 -0
- package/tools/spectronaut-aggregate.sql +80 -0
- package/tsconfig.json +18 -71
- package/webpack.config.js +86 -45
- package/.eslintignore +0 -1
- package/.eslintrc.json +0 -56
- package/LICENSE +0 -674
- package/package.png +0 -0
- package/scripts/number_antibody.py +0 -190
- package/scripts/number_antibody_abnumber.py +0 -177
- package/scripts/number_antibody_anarci.py +0 -200
package/package.json
CHANGED
|
@@ -1,62 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@datagrok/proteomics",
|
|
3
|
-
"friendlyName": "Proteomics",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"datagrok-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"@datagrok-libraries/test": "^1.1.0"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@datagrok/proteomics",
|
|
3
|
+
"friendlyName": "Proteomics",
|
|
4
|
+
"version": "1.2.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Ed Jaeger",
|
|
7
|
+
"email": "ejaeger@datagrok.ai"
|
|
8
|
+
},
|
|
9
|
+
"description": "Mass spectrometry-based proteomics data analysis: import, QC, normalization, imputation, differential expression, and visualization.",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/datagrok-ai/public.git",
|
|
13
|
+
"directory": "packages/Proteomics"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@datagrok-libraries/bio": "^5.61.3",
|
|
17
|
+
"@datagrok-libraries/math": "^1.2.6",
|
|
18
|
+
"@datagrok-libraries/ml": "^6.10.7",
|
|
19
|
+
"@datagrok-libraries/statistics": "^1.2.12",
|
|
20
|
+
"@datagrok-libraries/utils": "^4.6.9",
|
|
21
|
+
"@datagrok-libraries/test": "^1.1.0",
|
|
22
|
+
"cash-dom": "^8.1.5",
|
|
23
|
+
"datagrok-api": "^1.25.0",
|
|
24
|
+
"rxjs": "^6.5.5",
|
|
25
|
+
"wu": "^2.1.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/wu": "^2.1.44",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^8.8.1",
|
|
30
|
+
"@typescript-eslint/parser": "^8.8.1",
|
|
31
|
+
"css-loader": "^7.1.2",
|
|
32
|
+
"eslint": "^8.57.1",
|
|
33
|
+
"eslint-config-google": "^0.14.0",
|
|
34
|
+
"style-loader": "^4.0.0",
|
|
35
|
+
"ts-loader": "^9.5.1",
|
|
36
|
+
"typescript": "^5.6.3",
|
|
37
|
+
"webpack": "^5.95.0",
|
|
38
|
+
"webpack-cli": "^5.1.4"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"link-api": "npm link datagrok-api",
|
|
42
|
+
"link-all": "npm link datagrok-api @datagrok-libraries/utils @datagrok-libraries/math @datagrok-libraries/ml @datagrok-libraries/bio @datagrok-libraries/statistics",
|
|
43
|
+
"build": "grok api && grok check --soft && webpack",
|
|
44
|
+
"debug-proteomics": "grok publish",
|
|
45
|
+
"release-proteomics": "grok publish --release",
|
|
46
|
+
"debug-proteomics-local": "grok publish local",
|
|
47
|
+
"release-proteomics-local": "grok publish local --release",
|
|
48
|
+
"lint": "eslint \"./src/**/*.ts\"",
|
|
49
|
+
"lint-fix": "eslint \"./src/**/*.ts\" --fix",
|
|
50
|
+
"test": "grok test",
|
|
51
|
+
"test-local": "grok test --host localhost",
|
|
52
|
+
"build-all": "npm --prefix ./../../js-api run build && npm --prefix ./../../libraries/utils run build && npm --prefix ./../../libraries/math run build && npm --prefix ./../../libraries/ml run build && npm --prefix ./../../libraries/bio run build && npm --prefix ./../../libraries/statistics run build && npm run build"
|
|
53
|
+
},
|
|
54
|
+
"canEdit": [
|
|
55
|
+
"Administrators"
|
|
56
|
+
],
|
|
57
|
+
"canView": [
|
|
58
|
+
"All users"
|
|
59
|
+
],
|
|
60
|
+
"category": "Bioinformatics",
|
|
61
|
+
"properties": [
|
|
62
|
+
{
|
|
63
|
+
"name": "reviewSpaceName",
|
|
64
|
+
"description": "Umbrella Space that shared review snapshots are published under. Each target gets a child Space inside it.",
|
|
65
|
+
"propertyType": "string",
|
|
66
|
+
"defaultValue": "Proteomics-Reviews",
|
|
67
|
+
"nullable": false
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "reviewNamePrefix",
|
|
71
|
+
"description": "Prefix for shared review project names. The structural '-<target>-v<version>-<date>' suffix stays fixed so re-share version detection keeps working.",
|
|
72
|
+
"propertyType": "string",
|
|
73
|
+
"defaultValue": "Proteomics-Review",
|
|
74
|
+
"nullable": false
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "verifyPublishedDashboard",
|
|
78
|
+
"description": "After publishing, re-open the shared dashboard to verify it survives a reload. Safer for client deliverables; turn off for faster demo shares.",
|
|
79
|
+
"propertyType": "bool",
|
|
80
|
+
"defaultValue": true,
|
|
81
|
+
"nullable": false
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"overrides": {
|
|
85
|
+
"datagrok-api": "$datagrok-api"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#name: deqmsDE
|
|
2
|
+
#description: DEqMS peptide-count-weighted differential expression
|
|
3
|
+
#language: r
|
|
4
|
+
#environment: channels: [conda-forge, bioconda], dependencies: [bioconductor-limma, bioconductor-deqms]
|
|
5
|
+
#input: dataframe exprDf
|
|
6
|
+
#input: int nGroup1
|
|
7
|
+
#input: dataframe peptideDf
|
|
8
|
+
#input: double fcThreshold = 1.0
|
|
9
|
+
#input: double pThreshold = 0.05
|
|
10
|
+
#output: dataframe result
|
|
11
|
+
|
|
12
|
+
# exprDf columns are named s1, s2, ... with group1 first, then group2
|
|
13
|
+
nTotal <- ncol(exprDf)
|
|
14
|
+
exprMat <- as.matrix(exprDf)
|
|
15
|
+
rownames(exprMat) <- seq_len(nrow(exprMat))
|
|
16
|
+
counts <- as.numeric(peptideDf[[1]])
|
|
17
|
+
|
|
18
|
+
# Design matrix (same as limma_de.R)
|
|
19
|
+
group <- factor(c(rep("ctrl", nGroup1), rep("treat", nTotal - nGroup1)),
|
|
20
|
+
levels = c("ctrl", "treat"))
|
|
21
|
+
design <- model.matrix(~ group)
|
|
22
|
+
|
|
23
|
+
# Limma pipeline (required by DEqMS as base)
|
|
24
|
+
library(limma)
|
|
25
|
+
fit <- lmFit(exprMat, design)
|
|
26
|
+
fit <- eBayes(fit)
|
|
27
|
+
|
|
28
|
+
hasDeqms <- suppressWarnings(require(DEqMS, quietly = TRUE))
|
|
29
|
+
|
|
30
|
+
if (hasDeqms) {
|
|
31
|
+
# DEqMS: peptide-count-weighted variance estimation
|
|
32
|
+
fit$count <- counts
|
|
33
|
+
fit <- spectraCounteBayes(fit)
|
|
34
|
+
# outputResult() returns rows SORTED by significance, NOT input order. The
|
|
35
|
+
# original 1-based input index is preserved in rownames; carry it through so
|
|
36
|
+
# the client aligns stats to proteins by key, never by row position.
|
|
37
|
+
tt <- outputResult(fit, coef = 2)
|
|
38
|
+
|
|
39
|
+
result <- data.frame(
|
|
40
|
+
row = as.integer(rownames(tt)),
|
|
41
|
+
log2FC = tt$logFC,
|
|
42
|
+
p.value = tt$sca.P.Value,
|
|
43
|
+
adj.p.value = tt$sca.adj.pval,
|
|
44
|
+
significant = (abs(tt$logFC) >= fcThreshold) & (tt$sca.adj.pval <= pThreshold),
|
|
45
|
+
check.names = FALSE
|
|
46
|
+
)
|
|
47
|
+
} else {
|
|
48
|
+
# Fallback: use limma topTable (DEqMS not installed)
|
|
49
|
+
warning("DEqMS not available, using limma instead")
|
|
50
|
+
tt <- topTable(fit, coef = 2, number = Inf, sort.by = "none")
|
|
51
|
+
|
|
52
|
+
result <- data.frame(
|
|
53
|
+
row = as.integer(rownames(tt)),
|
|
54
|
+
log2FC = tt$logFC,
|
|
55
|
+
p.value = tt$P.Value,
|
|
56
|
+
adj.p.value = tt$adj.P.Val,
|
|
57
|
+
significant = (abs(tt$logFC) >= fcThreshold) & (tt$adj.P.Val <= pThreshold),
|
|
58
|
+
check.names = FALSE
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#name: limmaDE
|
|
2
|
+
#description: Differential expression via limma moderated t-test
|
|
3
|
+
#language: r
|
|
4
|
+
#environment: channels: [conda-forge, bioconda], dependencies: [bioconductor-limma]
|
|
5
|
+
#input: dataframe exprDf
|
|
6
|
+
#input: int nGroup1
|
|
7
|
+
#input: double fcThreshold = 1.0
|
|
8
|
+
#input: double pThreshold = 0.05
|
|
9
|
+
#output: dataframe result
|
|
10
|
+
|
|
11
|
+
# exprDf columns are named s1, s2, ... with group1 first, then group2
|
|
12
|
+
nTotal <- ncol(exprDf)
|
|
13
|
+
exprMat <- as.matrix(exprDf)
|
|
14
|
+
nRows <- nrow(exprMat)
|
|
15
|
+
# 1-based input row index, carried through to the result so the client aligns
|
|
16
|
+
# stats to proteins by key — never by row position (some R outputs reorder).
|
|
17
|
+
rownames(exprMat) <- seq_len(nRows)
|
|
18
|
+
g1Idx <- 1:nGroup1
|
|
19
|
+
g2Idx <- (nGroup1 + 1):nTotal
|
|
20
|
+
|
|
21
|
+
hasLimma <- suppressWarnings(require(limma, quietly = TRUE))
|
|
22
|
+
|
|
23
|
+
if (hasLimma) {
|
|
24
|
+
# Limma empirical Bayes moderated t-test
|
|
25
|
+
group <- factor(c(rep("ctrl", nGroup1), rep("treat", nTotal - nGroup1)),
|
|
26
|
+
levels = c("ctrl", "treat"))
|
|
27
|
+
design <- model.matrix(~ group)
|
|
28
|
+
fit <- lmFit(exprMat, design)
|
|
29
|
+
fit <- eBayes(fit)
|
|
30
|
+
tt <- topTable(fit, coef = 2, number = Inf, sort.by = "none")
|
|
31
|
+
|
|
32
|
+
result <- data.frame(
|
|
33
|
+
row = as.integer(rownames(tt)),
|
|
34
|
+
log2FC = tt$logFC,
|
|
35
|
+
p.value = tt$P.Value,
|
|
36
|
+
adj.p.value = tt$adj.P.Val,
|
|
37
|
+
significant = (abs(tt$logFC) >= fcThreshold) & (tt$adj.P.Val <= pThreshold),
|
|
38
|
+
check.names = FALSE
|
|
39
|
+
)
|
|
40
|
+
} else {
|
|
41
|
+
stop("limma package is not available")
|
|
42
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#name: VsnNormalize
|
|
2
|
+
#description: Variance-stabilizing normalization via vsn
|
|
3
|
+
#language: r
|
|
4
|
+
#environment: channels: [conda-forge, bioconda], dependencies: [bioconductor-vsn]
|
|
5
|
+
#input: dataframe exprDf
|
|
6
|
+
#output: dataframe result
|
|
7
|
+
|
|
8
|
+
# exprDf columns are named s1, s2, ... containing raw (non-log2) intensities
|
|
9
|
+
# VSN performs a generalized log2 transformation that stabilizes variance
|
|
10
|
+
|
|
11
|
+
library(vsn)
|
|
12
|
+
|
|
13
|
+
exprMat <- as.matrix(exprDf)
|
|
14
|
+
|
|
15
|
+
# Run VSN normalization (returns glog2-transformed values)
|
|
16
|
+
vsnFit <- vsn::justvsn(exprMat)
|
|
17
|
+
|
|
18
|
+
result <- as.data.frame(vsnFit)
|
|
19
|
+
colnames(result) <- colnames(exprDf)
|