@datagrok/proteomics 1.0.1 → 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 -63
- 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/src/menu.ts
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamic half of the **Proteomics** menu — the analysis groups that need a per-table
|
|
3
|
+
* grey-out, built onto a table view's ribbon.
|
|
4
|
+
*
|
|
5
|
+
* The menu is split across two mechanisms on purpose:
|
|
6
|
+
*
|
|
7
|
+
* - In the **main Datagrok menu (left bar)**: only `Proteomics | Import`, via decorator
|
|
8
|
+
* `top-menu` strings in `package.ts`. This is the always-available entry point,
|
|
9
|
+
* reachable with no table open. The platform owns it — robust, never duplicates.
|
|
10
|
+
* - In a **table view's ribbon**: the full menu (Import + Annotate / Analyze / Visualize
|
|
11
|
+
* / Share), built here onto `view.ribbonMenu`, and ONLY when a Proteomics analysis
|
|
12
|
+
* table is active. The analysis items need `isEnabled` grey-out (a Spectronaut
|
|
13
|
+
* Candidates file has no per-sample intensities, so the sample-level steps don't apply),
|
|
14
|
+
* which only works on a programmatically built menu.
|
|
15
|
+
*
|
|
16
|
+
* The two hosts are independent: a decorator `top-menu` populates `grok.shell.topMenu` (the
|
|
17
|
+
* left-bar menu), NOT `view.ribbonMenu`. When a view's ribbon has its own 'Proteomics'
|
|
18
|
+
* group, the ribbon shows THAT one — so Import has to be (re)added here for the ribbon copy.
|
|
19
|
+
* They don't collide because they live in different menus.
|
|
20
|
+
*/
|
|
21
|
+
import * as DG from 'datagrok-api/dg';
|
|
22
|
+
|
|
23
|
+
/** Handlers the ribbon menu invokes — including Import, which the ribbon builds itself
|
|
24
|
+
* (the decorator copies only reach the left-bar main menu). Passed in from `package.ts`
|
|
25
|
+
* so this module doesn't import `PackageFunctions` (circular). */
|
|
26
|
+
export interface ProteomicsMenuHandlers {
|
|
27
|
+
importSpectronautCandidates: () => void;
|
|
28
|
+
importSpectronaut: () => void;
|
|
29
|
+
importMaxQuant: () => void;
|
|
30
|
+
importFragPipe: () => void;
|
|
31
|
+
importGenericMatrix: () => void;
|
|
32
|
+
annotateExperiment: () => void;
|
|
33
|
+
setLog2Scale: () => void;
|
|
34
|
+
normalize: () => void;
|
|
35
|
+
impute: () => void;
|
|
36
|
+
differentialExpression: () => void;
|
|
37
|
+
enrichmentAnalysis: () => void;
|
|
38
|
+
exportEnrichmentInputs: () => void;
|
|
39
|
+
computeSpcStatus: () => void;
|
|
40
|
+
showVolcanoPlot: () => void;
|
|
41
|
+
showHeatmap: () => void;
|
|
42
|
+
showPcaPlot: () => void;
|
|
43
|
+
showGroupMeanCorrelation: () => void;
|
|
44
|
+
showQcDashboard: () => void;
|
|
45
|
+
showSpcDashboard: () => void;
|
|
46
|
+
enrichmentCharts: () => void;
|
|
47
|
+
showAllVisualizations: () => void;
|
|
48
|
+
shareAnalysisForReview: () => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Our subgroups/items under the ribbon 'Proteomics' group. Cleared before a (re)build so
|
|
52
|
+
* repeated calls replace rather than duplicate. 'Import' is ours here too — the decorator
|
|
53
|
+
* Import lives only in the left-bar main menu, not the ribbon. */
|
|
54
|
+
const DYNAMIC_SECTIONS = ['Import', 'Annotate Experiment...', 'Analyze', 'Visualize', 'Share'];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Is this an analysis table the full Proteomics menu should attach to? Every parser stamps
|
|
58
|
+
* `proteomics.source`, so its presence is the reliable signal. Plain CSVs and the
|
|
59
|
+
* sample-level PCA table (which has no source tag) get only the decorator Import.
|
|
60
|
+
*/
|
|
61
|
+
export function isProteomicsTable(df: DG.DataFrame | null | undefined): boolean {
|
|
62
|
+
return !!df && !!df.getTag('proteomics.source');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Disable reason for sample-level menu items on `df`, or `null` when they're fine.
|
|
67
|
+
* Re-evaluated by the platform every time the menu opens, so it tracks the live table.
|
|
68
|
+
* Only a Spectronaut Candidates table is blocked; the per-handler runtime guards stay in
|
|
69
|
+
* place as the backstop for every other not-ready case.
|
|
70
|
+
*/
|
|
71
|
+
export function sampleLevelDisabledReason(df: DG.DataFrame | null | undefined): string | null {
|
|
72
|
+
if (df && df.getTag('proteomics.source') === 'spectronaut-candidates') {
|
|
73
|
+
return 'Not applicable to a Spectronaut Candidates file — it already carries computed ' +
|
|
74
|
+
'differential expression and has no per-sample intensities. Use Volcano Plot, ' +
|
|
75
|
+
'Enrichment Analysis or the UniProt panel, or import the matching Spectronaut Report ' +
|
|
76
|
+
'for sample-level analyses.';
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Build the dynamic analysis groups onto a table view's ribbon, attaching to the Proteomics
|
|
83
|
+
* group the decorator Import created. Returns `true` if it built (the view is a Proteomics
|
|
84
|
+
* table), `false` otherwise — the caller uses that to decide whether the view is "done".
|
|
85
|
+
*
|
|
86
|
+
* Idempotent: clears its own sections first (never the decorator 'Import') so a rebuild
|
|
87
|
+
* replaces rather than duplicates.
|
|
88
|
+
*/
|
|
89
|
+
export function buildProteomicsRibbonMenu(view: DG.TableView, h: ProteomicsMenuHandlers): boolean {
|
|
90
|
+
const df = view.dataFrame;
|
|
91
|
+
if (!isProteomicsTable(df))
|
|
92
|
+
return false;
|
|
93
|
+
|
|
94
|
+
const root = view.ribbonMenu.group('Proteomics');
|
|
95
|
+
for (const s of DYNAMIC_SECTIONS) {
|
|
96
|
+
try { root.remove(s); } catch { /* not present — fine */ }
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const sampleOnly = {isEnabled: () => sampleLevelDisabledReason(view.dataFrame)};
|
|
100
|
+
|
|
101
|
+
// Import — the ribbon's own copy (the decorator Import only reaches the left-bar menu).
|
|
102
|
+
const imp = root.group('Import');
|
|
103
|
+
imp.item('Spectronaut Candidates...', h.importSpectronautCandidates);
|
|
104
|
+
imp.item('Spectronaut Report...', h.importSpectronaut);
|
|
105
|
+
imp.item('MaxQuant...', h.importMaxQuant);
|
|
106
|
+
imp.item('FragPipe...', h.importFragPipe);
|
|
107
|
+
imp.item('Generic Matrix...', h.importGenericMatrix);
|
|
108
|
+
|
|
109
|
+
root.item('Annotate Experiment...', h.annotateExperiment, null, sampleOnly);
|
|
110
|
+
|
|
111
|
+
const analyze = root.group('Analyze');
|
|
112
|
+
analyze.item('Set Log2 Scale...', h.setLog2Scale, null, sampleOnly);
|
|
113
|
+
analyze.item('Normalize...', h.normalize, null, sampleOnly);
|
|
114
|
+
analyze.item('Impute Missing Values...', h.impute, null, sampleOnly);
|
|
115
|
+
analyze.item('Differential Expression...', h.differentialExpression, null, sampleOnly);
|
|
116
|
+
analyze.item('Enrichment Analysis...', h.enrichmentAnalysis);
|
|
117
|
+
analyze.item('Export Enrichment Inputs...', h.exportEnrichmentInputs);
|
|
118
|
+
analyze.item('Compute SPC Status', h.computeSpcStatus, null, sampleOnly);
|
|
119
|
+
|
|
120
|
+
const viz = root.group('Visualize');
|
|
121
|
+
viz.item('Volcano Plot...', h.showVolcanoPlot);
|
|
122
|
+
viz.item('Heatmap...', h.showHeatmap, null, sampleOnly);
|
|
123
|
+
viz.item('PCA...', h.showPcaPlot, null, sampleOnly);
|
|
124
|
+
viz.item('Group-Mean Correlation...', h.showGroupMeanCorrelation, null, sampleOnly);
|
|
125
|
+
viz.item('QC Dashboard...', h.showQcDashboard, null, sampleOnly);
|
|
126
|
+
viz.item('SPC Dashboard...', h.showSpcDashboard);
|
|
127
|
+
viz.item('Enrichment Charts...', h.enrichmentCharts);
|
|
128
|
+
viz.item('Show All Visualizations...', h.showAllVisualizations, null, sampleOnly);
|
|
129
|
+
|
|
130
|
+
const share = root.group('Share');
|
|
131
|
+
share.item('Share Analysis for Review...', h.shareAnalysisForReview);
|
|
132
|
+
return true;
|
|
133
|
+
}
|
package/src/package-api.ts
CHANGED
|
@@ -9,29 +9,151 @@ import * as DG from 'datagrok-api/dg';
|
|
|
9
9
|
|
|
10
10
|
export namespace scripts {
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export async function
|
|
15
|
-
return await grok.functions.call('Proteomics:
|
|
12
|
+
* DEqMS peptide-count-weighted differential expression
|
|
13
|
+
*/
|
|
14
|
+
export async function deqmsDE(exprDf: DG.DataFrame , nGroup1: number , peptideDf: DG.DataFrame , fcThreshold: number , pThreshold: number ): Promise<DG.DataFrame> {
|
|
15
|
+
return await grok.functions.call('Proteomics:DeqmsDE', { exprDf, nGroup1, peptideDf, fcThreshold, pThreshold });
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export async function
|
|
22
|
-
return await grok.functions.call('Proteomics:
|
|
19
|
+
* Differential expression via limma moderated t-test
|
|
20
|
+
*/
|
|
21
|
+
export async function limmaDE(exprDf: DG.DataFrame , nGroup1: number , fcThreshold: number , pThreshold: number ): Promise<DG.DataFrame> {
|
|
22
|
+
return await grok.functions.call('Proteomics:LimmaDE', { exprDf, nGroup1, fcThreshold, pThreshold });
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export async function
|
|
29
|
-
return await grok.functions.call('Proteomics:
|
|
26
|
+
* Variance-stabilizing normalization via vsn
|
|
27
|
+
*/
|
|
28
|
+
export async function vsnNormalize(exprDf: DG.DataFrame ): Promise<DG.DataFrame> {
|
|
29
|
+
return await grok.functions.call('Proteomics:VsnNormalize', { exprDf });
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export namespace funcs {
|
|
34
|
-
export async function
|
|
35
|
-
return await grok.functions.call('Proteomics:
|
|
34
|
+
export async function initProteomics(): Promise<void> {
|
|
35
|
+
return await grok.functions.call('Proteomics:InitProteomics', {});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export async function buildProteomicsTopMenu(): Promise<void> {
|
|
39
|
+
return await grok.functions.call('Proteomics:BuildProteomicsTopMenu', {});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function importSpectronautCandidates(): Promise<void> {
|
|
43
|
+
return await grok.functions.call('Proteomics:ImportSpectronautCandidates', {});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function importSpectronaut(): Promise<void> {
|
|
47
|
+
return await grok.functions.call('Proteomics:ImportSpectronaut', {});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export async function importMaxQuant(): Promise<void> {
|
|
51
|
+
return await grok.functions.call('Proteomics:ImportMaxQuant', {});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function importFragPipe(): Promise<void> {
|
|
55
|
+
return await grok.functions.call('Proteomics:ImportFragPipe', {});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export async function importGenericMatrix(): Promise<void> {
|
|
59
|
+
return await grok.functions.call('Proteomics:ImportGenericMatrix', {});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export async function annotateExperiment(): Promise<void> {
|
|
63
|
+
return await grok.functions.call('Proteomics:AnnotateExperiment', {});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export async function setLog2Scale(): Promise<void> {
|
|
67
|
+
return await grok.functions.call('Proteomics:SetLog2Scale', {});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function normalizeProteomics(): Promise<void> {
|
|
71
|
+
return await grok.functions.call('Proteomics:NormalizeProteomics', {});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export async function imputeMissingValues(): Promise<void> {
|
|
75
|
+
return await grok.functions.call('Proteomics:ImputeMissingValues', {});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export async function differentialExpression(): Promise<void> {
|
|
79
|
+
return await grok.functions.call('Proteomics:DifferentialExpression', {});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export async function computeSpcStatus(): Promise<void> {
|
|
83
|
+
return await grok.functions.call('Proteomics:ComputeSpcStatus', {});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export async function showVolcanoPlot(): Promise<void> {
|
|
87
|
+
return await grok.functions.call('Proteomics:ShowVolcanoPlot', {});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export async function showHeatmap(): Promise<void> {
|
|
91
|
+
return await grok.functions.call('Proteomics:ShowHeatmap', {});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export async function showPcaPlot(): Promise<void> {
|
|
95
|
+
return await grok.functions.call('Proteomics:ShowPcaPlot', {});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export async function showGroupMeanCorrelation(): Promise<void> {
|
|
99
|
+
return await grok.functions.call('Proteomics:ShowGroupMeanCorrelation', {});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export async function showQcDashboard(): Promise<void> {
|
|
103
|
+
return await grok.functions.call('Proteomics:ShowQcDashboard', {});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export async function showSpcDashboard(): Promise<void> {
|
|
107
|
+
return await grok.functions.call('Proteomics:ShowSpcDashboard', {});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export async function showAllVisualizations(): Promise<void> {
|
|
111
|
+
return await grok.functions.call('Proteomics:ShowAllVisualizations', {});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export async function enrichmentAnalysis(): Promise<void> {
|
|
115
|
+
return await grok.functions.call('Proteomics:EnrichmentAnalysis', {});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export async function exportEnrichmentInputs(): Promise<void> {
|
|
119
|
+
return await grok.functions.call('Proteomics:ExportEnrichmentInputs', {});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export async function enrichmentCharts(): Promise<void> {
|
|
123
|
+
return await grok.functions.call('Proteomics:EnrichmentCharts', {});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export async function proteomicsDemo(): Promise<void> {
|
|
127
|
+
return await grok.functions.call('Proteomics:ProteomicsDemo', {});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export async function proteomicsEnrichmentDemo(): Promise<void> {
|
|
131
|
+
return await grok.functions.call('Proteomics:ProteomicsEnrichmentDemo', {});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* UniProt protein details
|
|
136
|
+
* @param {string} proteinId
|
|
137
|
+
* semType: Proteomics-ProteinId
|
|
138
|
+
*/
|
|
139
|
+
export async function uniprotPanelWidget(proteinId: string ): Promise<any> {
|
|
140
|
+
return await grok.functions.call('Proteomics:UniprotPanelWidget', { proteinId });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export async function shareAnalysisForReview(): Promise<void> {
|
|
144
|
+
return await grok.functions.call('Proteomics:ShareAnalysisForReview', {});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Audit context for a shared analysis snapshot
|
|
149
|
+
* @param {string} proteinId
|
|
150
|
+
* semType: Proteomics-ProteinId
|
|
151
|
+
*/
|
|
152
|
+
export async function publishedAnalysisPanelWidget(proteinId: string ): Promise<any> {
|
|
153
|
+
return await grok.functions.call('Proteomics:PublishedAnalysisPanelWidget', { proteinId });
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export async function recoverPublishedProjectsOnStartup(): Promise<void> {
|
|
157
|
+
return await grok.functions.call('Proteomics:RecoverPublishedProjectsOnStartup', {});
|
|
36
158
|
}
|
|
37
159
|
}
|
package/src/package-test.ts
CHANGED
|
@@ -1,20 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import * as DG from 'datagrok-api/dg';
|
|
2
|
+
import {runTests, TestContext, tests, initAutoTests as initTests} from '@datagrok-libraries/test/src/test';
|
|
3
|
+
|
|
4
|
+
import './tests/parsers';
|
|
5
|
+
import './tests/analysis';
|
|
6
|
+
import './tests/generic-parser';
|
|
7
|
+
import './tests/qc-dashboard';
|
|
8
|
+
import './tests/enrichment';
|
|
9
|
+
import './tests/enrichment-export';
|
|
10
|
+
import './tests/enrichment-visualization';
|
|
11
|
+
import './tests/spectronaut-parser';
|
|
12
|
+
import './tests/spectronaut-candidates-parser';
|
|
13
|
+
import './tests/spectronaut-candidates-e2e';
|
|
14
|
+
import './tests/fragpipe-parser';
|
|
15
|
+
import './tests/fragpipe-e2e';
|
|
16
|
+
import './tests/subcellular-location';
|
|
17
|
+
import './tests/organisms';
|
|
18
|
+
import './tests/log2-scale';
|
|
19
|
+
import './tests/volcano';
|
|
20
|
+
import './tests/gene-label-resolver';
|
|
21
|
+
import './tests/smart-pathway-filter';
|
|
22
|
+
import './tests/uniprot-panel';
|
|
23
|
+
import './tests/group-mean-correlation';
|
|
24
|
+
import './tests/publish-spike';
|
|
25
|
+
import './tests/publish-roundtrip';
|
|
26
|
+
import './tests/spc-formula-lines-spike';
|
|
27
|
+
import './tests/spc';
|
|
28
|
+
|
|
29
|
+
export const _package = new DG.Package();
|
|
30
|
+
export {tests};
|
|
31
|
+
|
|
32
|
+
//name: test
|
|
33
|
+
//input: string category {optional: true}
|
|
34
|
+
//input: string test {optional: true}
|
|
35
|
+
//input: object testContext {optional: true}
|
|
36
|
+
//output: dataframe result
|
|
37
|
+
export async function test(category: string, test: string, testContext: TestContext): Promise<DG.DataFrame> {
|
|
38
|
+
const data = await runTests({category, test, testContext});
|
|
39
|
+
return DG.DataFrame.fromObjects(data)!;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//name: initAutoTests
|
|
43
|
+
export async function initAutoTests() {
|
|
44
|
+
await initTests(_package, _package.getModule('package-test.js'));
|
|
45
|
+
}
|
package/src/package.g.ts
CHANGED
|
@@ -1 +1,162 @@
|
|
|
1
|
+
import {PackageFunctions} from './package';
|
|
1
2
|
import * as DG from 'datagrok-api/dg';
|
|
3
|
+
|
|
4
|
+
//tags: init
|
|
5
|
+
//meta.role: init
|
|
6
|
+
export async function initProteomics() : Promise<void> {
|
|
7
|
+
await PackageFunctions.initProteomics();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//tags: autostart
|
|
11
|
+
//meta.autostartImmediate: true
|
|
12
|
+
export async function buildProteomicsTopMenu() : Promise<void> {
|
|
13
|
+
await PackageFunctions.buildProteomicsTopMenu();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//top-menu: Proteomics | Import | Spectronaut Candidates...
|
|
17
|
+
export async function importSpectronautCandidates() : Promise<void> {
|
|
18
|
+
await PackageFunctions.importSpectronautCandidates();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//top-menu: Proteomics | Import | Spectronaut Report...
|
|
22
|
+
export async function importSpectronaut() : Promise<void> {
|
|
23
|
+
await PackageFunctions.importSpectronaut();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//top-menu: Proteomics | Import | MaxQuant...
|
|
27
|
+
export async function importMaxQuant() : Promise<void> {
|
|
28
|
+
await PackageFunctions.importMaxQuant();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//top-menu: Proteomics | Import | FragPipe...
|
|
32
|
+
export async function importFragPipe() : Promise<void> {
|
|
33
|
+
await PackageFunctions.importFragPipe();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//top-menu: Proteomics | Import | Generic Matrix...
|
|
37
|
+
export async function importGenericMatrix() : Promise<void> {
|
|
38
|
+
await PackageFunctions.importGenericMatrix();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//name: annotateExperiment
|
|
42
|
+
export async function annotateExperiment() : Promise<void> {
|
|
43
|
+
await PackageFunctions.annotateExperiment();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//name: setLog2Scale
|
|
47
|
+
export async function setLog2Scale() : Promise<void> {
|
|
48
|
+
await PackageFunctions.setLog2Scale();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//name: normalizeProteomics
|
|
52
|
+
export async function normalizeProteomics() : Promise<void> {
|
|
53
|
+
await PackageFunctions.normalizeProteomics();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//name: imputeMissingValues
|
|
57
|
+
export async function imputeMissingValues() : Promise<void> {
|
|
58
|
+
await PackageFunctions.imputeMissingValues();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//name: differentialExpression
|
|
62
|
+
export async function differentialExpression() : Promise<void> {
|
|
63
|
+
await PackageFunctions.differentialExpression();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
//name: computeSpcStatus
|
|
67
|
+
export async function computeSpcStatus() : Promise<void> {
|
|
68
|
+
await PackageFunctions.computeSpcStatus();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//name: showVolcanoPlot
|
|
72
|
+
export async function showVolcanoPlot() : Promise<void> {
|
|
73
|
+
await PackageFunctions.showVolcanoPlot();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//name: showHeatmap
|
|
77
|
+
export async function showHeatmap() : Promise<void> {
|
|
78
|
+
await PackageFunctions.showHeatmap();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//name: showPcaPlot
|
|
82
|
+
export async function showPcaPlot() : Promise<void> {
|
|
83
|
+
await PackageFunctions.showPcaPlot();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//name: showGroupMeanCorrelation
|
|
87
|
+
export async function showGroupMeanCorrelation() : Promise<void> {
|
|
88
|
+
await PackageFunctions.showGroupMeanCorrelation();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
//name: showQcDashboard
|
|
92
|
+
export async function showQcDashboard() : Promise<void> {
|
|
93
|
+
await PackageFunctions.showQcDashboard();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//name: showSpcDashboard
|
|
97
|
+
export async function showSpcDashboard() : Promise<void> {
|
|
98
|
+
await PackageFunctions.showSpcDashboard();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
//name: showAllVisualizations
|
|
102
|
+
export async function showAllVisualizations() : Promise<void> {
|
|
103
|
+
await PackageFunctions.showAllVisualizations();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//name: enrichmentAnalysis
|
|
107
|
+
export async function enrichmentAnalysis() : Promise<void> {
|
|
108
|
+
await PackageFunctions.enrichmentAnalysis();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
//name: exportEnrichmentInputs
|
|
112
|
+
export async function exportEnrichmentInputs() : Promise<void> {
|
|
113
|
+
await PackageFunctions.exportEnrichmentInputs();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
//name: enrichmentCharts
|
|
117
|
+
export async function enrichmentCharts() : Promise<void> {
|
|
118
|
+
await PackageFunctions.enrichmentCharts();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
//name: Proteomics Demo
|
|
122
|
+
//meta.demoPath: Proteomics | Differential Expression
|
|
123
|
+
//meta.isDemoDashboard: true
|
|
124
|
+
export async function proteomicsDemo() : Promise<void> {
|
|
125
|
+
await PackageFunctions.proteomicsDemo();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
//name: Proteomics Enrichment Demo
|
|
129
|
+
//meta.demoPath: Proteomics | Enrichment Analysis
|
|
130
|
+
//meta.isDemoDashboard: true
|
|
131
|
+
export async function proteomicsEnrichmentDemo() : Promise<void> {
|
|
132
|
+
await PackageFunctions.proteomicsEnrichmentDemo();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
//name: Proteomics | UniProt
|
|
136
|
+
//description: UniProt protein details
|
|
137
|
+
//input: string proteinId { semType: Proteomics-ProteinId }
|
|
138
|
+
//output: widget result
|
|
139
|
+
//meta.role: widgets,panel
|
|
140
|
+
export function uniprotPanelWidget(proteinId: string) : any {
|
|
141
|
+
return PackageFunctions.uniprotPanelWidget(proteinId);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
//name: shareAnalysisForReview
|
|
145
|
+
export async function shareAnalysisForReview() : Promise<void> {
|
|
146
|
+
await PackageFunctions.shareAnalysisForReview();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
//name: Proteomics | Shared Analysis
|
|
150
|
+
//description: Audit context for a shared analysis snapshot
|
|
151
|
+
//input: string proteinId { semType: Proteomics-ProteinId }
|
|
152
|
+
//output: widget result
|
|
153
|
+
//meta.role: widgets,panel
|
|
154
|
+
export function publishedAnalysisPanelWidget(proteinId: string) : any {
|
|
155
|
+
return PackageFunctions.publishedAnalysisPanelWidget(proteinId);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
//tags: autostart
|
|
159
|
+
//meta.autostartImmediate: true
|
|
160
|
+
export async function recoverPublishedProjectsOnStartup() : Promise<void> {
|
|
161
|
+
await PackageFunctions.recoverPublishedProjectsOnStartup();
|
|
162
|
+
}
|