adex 0.1.0__tar.gz

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.
Files changed (76) hide show
  1. adex-0.1.0/ADEX.egg-info/PKG-INFO +136 -0
  2. adex-0.1.0/ADEX.egg-info/SOURCES.txt +74 -0
  3. adex-0.1.0/ADEX.egg-info/dependency_links.txt +1 -0
  4. adex-0.1.0/ADEX.egg-info/entry_points.txt +3 -0
  5. adex-0.1.0/ADEX.egg-info/requires.txt +8 -0
  6. adex-0.1.0/ADEX.egg-info/top_level.txt +9 -0
  7. adex-0.1.0/PKG-INFO +136 -0
  8. adex-0.1.0/README.md +121 -0
  9. adex-0.1.0/app.py +88 -0
  10. adex-0.1.0/assets/__init__.py +0 -0
  11. adex-0.1.0/assets/css/dbc.min.css +131 -0
  12. adex-0.1.0/assets/css/layout.css +245 -0
  13. adex-0.1.0/assets/css/markdown.css +113 -0
  14. adex-0.1.0/assets/css/sidebar.css +59 -0
  15. adex-0.1.0/assets/css/startup_modal.css +13 -0
  16. adex-0.1.0/assets/images/AI_lens_black.svg +8 -0
  17. adex-0.1.0/assets/images/AI_lens_white.svg +8 -0
  18. adex-0.1.0/assets/images/AI_medium_white.svg +25 -0
  19. adex-0.1.0/assets/images/aifi-white-logo.png +0 -0
  20. adex-0.1.0/assets/images/aifi-white-text.png +0 -0
  21. adex-0.1.0/assets/images/aifi_logo.png +0 -0
  22. adex-0.1.0/assets/images/screenshot.png +0 -0
  23. adex-0.1.0/assets/images/template.png +0 -0
  24. adex-0.1.0/assets/markdown/covariate-help.md +7 -0
  25. adex-0.1.0/assets/markdown/help_page.md +3 -0
  26. adex-0.1.0/assets/markdown/startup_modal.md +3 -0
  27. adex-0.1.0/assets/markdown/template_help_page.md +40 -0
  28. adex-0.1.0/assets/markdown/template_startup_modal.md +7 -0
  29. adex-0.1.0/callbacks/__init__.py +0 -0
  30. adex-0.1.0/callbacks/create_deg_callbacks.py +1451 -0
  31. adex-0.1.0/components/__init__.py +0 -0
  32. adex-0.1.0/components/create_deg_components.py +499 -0
  33. adex-0.1.0/config/__init__.py +0 -0
  34. adex-0.1.0/config/gmt/c2.all.v2026.1.Hs.json.gz +0 -0
  35. adex-0.1.0/config/gmt/h.all.v2026.1.Hs.json.gz +0 -0
  36. adex-0.1.0/config/gmt/msigdb-all-pathways.json.gz +0 -0
  37. adex-0.1.0/config/template.json +80 -0
  38. adex-0.1.0/preprocess.py +54 -0
  39. adex-0.1.0/preprocessors/__init__.py +0 -0
  40. adex-0.1.0/preprocessors/deseq2.py +144 -0
  41. adex-0.1.0/preprocessors/gsea.py +187 -0
  42. adex-0.1.0/preprocessors/pseudobulk.py +84 -0
  43. adex-0.1.0/pyproject.toml +55 -0
  44. adex-0.1.0/setup.cfg +4 -0
  45. adex-0.1.0/src/__init__.py +0 -0
  46. adex-0.1.0/src/app/__init__.py +5 -0
  47. adex-0.1.0/src/app/components/ConfigSingleton.py +124 -0
  48. adex-0.1.0/src/app/components/GenePanel.py +174 -0
  49. adex-0.1.0/src/app/components/RadioButtons.py +35 -0
  50. adex-0.1.0/src/app/components/StartupModal.py +58 -0
  51. adex-0.1.0/src/app/components/__init__.py +10 -0
  52. adex-0.1.0/src/app/components/app_header.py +304 -0
  53. adex-0.1.0/src/app/components/app_help.py +96 -0
  54. adex-0.1.0/src/app/components/app_settings.py +77 -0
  55. adex-0.1.0/src/app/components/dropdown.py +39 -0
  56. adex-0.1.0/src/app/plots/BoxPlot.py +210 -0
  57. adex-0.1.0/src/app/plots/DegSummariesPlot.py +118 -0
  58. adex-0.1.0/src/app/plots/HeatmapAIO.py +276 -0
  59. adex-0.1.0/src/app/plots/MAPlot.py +133 -0
  60. adex-0.1.0/src/app/plots/Volcano.py +152 -0
  61. adex-0.1.0/src/app/plots/__init__.py +7 -0
  62. adex-0.1.0/src/app/utils.py +381 -0
  63. adex-0.1.0/src/app/version.py +11 -0
  64. adex-0.1.0/src/cli.py +10 -0
  65. adex-0.1.0/src/deploy.py +110 -0
  66. adex-0.1.0/src/mediators/GeneSelectionMediator.py +54 -0
  67. adex-0.1.0/src/mediators/PathwaySelectionMediator.py +101 -0
  68. adex-0.1.0/src/mediators/__init__.py +0 -0
  69. adex-0.1.0/src/readers/DegByCovariatesReader.py +171 -0
  70. adex-0.1.0/src/readers/Deseq2Readers.py +175 -0
  71. adex-0.1.0/src/readers/PseudoBulkLoader.py +166 -0
  72. adex-0.1.0/src/readers/__init__.py +0 -0
  73. adex-0.1.0/src/utils.py +616 -0
  74. adex-0.1.0/src/version.py +5 -0
  75. adex-0.1.0/ui/__init__.py +0 -0
  76. adex-0.1.0/ui/create_deg_layout.py +436 -0
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.4
2
+ Name: ADEX
3
+ Version: 0.1.0
4
+ Summary: Allen Differential results EXplorer
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: dash[compress]==3.1.0
8
+ Requires-Dist: dash-ag-grid>=35.3.0
9
+ Requires-Dist: dash-bootstrap-components==2.0.4
10
+ Requires-Dist: dash-iconify==0.1.2
11
+ Requires-Dist: jsonschema>=4.26.0
12
+ Requires-Dist: mygene==3.2.2
13
+ Requires-Dist: numpy>=2.0.0
14
+ Requires-Dist: polars>=2.1.0
15
+
16
+ ### sc-deg-explorer
17
+
18
+ A [Plotly Dash](https://dash.plotly.com/) web application for interactively exploring **Differentially Expressed Genes (DEGs)** from single-cell RNA sequencing experiments. Its reusable Dash components and plots are included in the ADEX package, which provides a configurable, dataset-agnostic interface that can be pointed at new datasets simply by swapping a JSON configuration file — no code changes required.
19
+
20
+ ---
21
+
22
+ ### Table of Contents
23
+
24
+ 1. [Purpose](#purpose)
25
+ 2. [Expected inputs](#expected-inputs)
26
+ 3. [Example output](#example-output)
27
+ 3. [Usage](#usage)
28
+ 4. [Configuration](#configuration)
29
+
30
+ ---
31
+
32
+ ### Purpose
33
+ sc-deg-explorer is designed to make DEG results from single-cell pseudobulk analyses immediately accessible to wet-lab and computational scientists alike. After running a DESeq2-based differential expression pipeline, users can point this app at the output files and interactively:
34
+
35
+ - **Explore DEGs** through interactive volcano plots, MA plots, and per-covariate DEG views.
36
+ - **Investigate gene expression** for any selected gene using pseudo-bulk box plots stratified by donor, condition, or cell type.
37
+ - **Analyze pathway enrichment** results via GSEA volcano plots and pathway selection dropdowns.
38
+ - **Filter by cell type and experimental covariates** (e.g., day, treatment, cytokine) using sidebar dropdowns that dynamically update all plots.
39
+ - **Browse gene panels** to quickly navigate to genes of interest.
40
+
41
+ The app is designed to be deployed as an internal data portal, enabling research teams to rapidly iterate on hypotheses without writing additional analysis code.
42
+
43
+ ---
44
+
45
+ ### Expected inputs
46
+
47
+ The major inputs to the program are:
48
+
49
+ <details open>
50
+ <summary><strong>1. [Required]: Configuration file</strong></summary>
51
+ Manually fill the configuration file <strong>config/template.json</strong> with project-specific details.
52
+ </details>
53
+
54
+ <details open>
55
+ <summary><strong>2. [Required]: Differential results from tools like DESeq2</strong></summary>
56
+ An example dataset can be found in the file <strong>input-data-examples/deseq2.xlsx</strong>. Make sure to format the data in csv.gz.
57
+ </details>
58
+
59
+ <details>
60
+ <summary><strong>3. [Optional]: Enrichment results from GSEA</strong></summary>
61
+ An example dataset can be found in the file <strong>input-data-examples/fGSEA.xlsx</strong>. Make sure to format the data in tsv.gz.
62
+ </details>
63
+
64
+ > <u>Note on input data format</u>: The overall intention of the input data format is to use a set of columns to specify important combinations of independent variables, which will demarcate several DE tests into one file. These covariate columns **must** be present and match across every input data type.
65
+
66
+ > <u>Note on specifying covariates</u>: While there are instructions in the config file, this small piece of information is important to get right: **the order of covariates written in the config file matters**. The first covariate should reflect the group that appears on the right side of a volcano plot, and the second covariate is the left side of a volcano plot. Additional covariates can be specified without further constraints.
67
+
68
+ ---
69
+
70
+ ### Expected output files
71
+
72
+ The pipeline produces Parquet files that are scanned, selected, filtered, and collected to be served to the user's front-end.
73
+
74
+ ```
75
+ results/
76
+ ├── deg
77
+ │ ├── adjp.parquet
78
+ │ ├── deg.parquet
79
+ │ ├── log2fc.parquet
80
+ │ ├── means.parquet
81
+ │ ├── meta.parquet
82
+ │ ├── summaries.parquet
83
+ │ ├── t-adjp.parquet
84
+ │ └── t-log2fc.parquet
85
+ └── gsea
86
+ ├── results.parquet
87
+ ├── meta.parquet
88
+ ├── summaries.parquet
89
+ ...
90
+ ```
91
+
92
+ ---
93
+
94
+ ### Usage
95
+
96
+ Install ADEX with pip (Python 3.13 or newer), then run the commands from the
97
+ directory containing your project configuration and input data:
98
+
99
+ ```bash
100
+ # Install ADEX
101
+ python -m pip install git+https://github.com/aifimmunology/sc-deg-explorer.git
102
+
103
+ # Prepare config/template.json with project-specific settings and data paths.
104
+
105
+ # Preprocess differential results
106
+ adex-preprocess --config config/template.json
107
+
108
+ # Start the dashboard
109
+ adex-app --config config/template.json
110
+ ```
111
+
112
+ For development from a source checkout, install the Pixi environment with
113
+ `pixi install --frozen`, then run:
114
+
115
+ ```bash
116
+ pixi run python preprocess.py --config config/template.json
117
+ pixi run python app.py --config config/template.json
118
+ ```
119
+
120
+ ---
121
+
122
+ ### Example Output
123
+ The following screenshot is an example of a working app. After starting the app, it can be accessed via the following URL: `http://0.0.0.0:8050/`
124
+
125
+ ![MA Plot](assets/images/screenshot.png)
126
+
127
+ ---
128
+
129
+ ### Test build with Docker
130
+ Local builds with Docker can be helpful before deploying to a remote server for production.
131
+ ```bash
132
+ docker build --platform=linux/arm64/v8 -t rheumatoid-arthritis . # 'rheumatoid-arthritis' can be any string
133
+ docker run -p 8050:8050 rheumatoid-arthritis
134
+ ```
135
+
136
+ The app will be available at `http://localhost:8050`.
@@ -0,0 +1,74 @@
1
+ README.md
2
+ app.py
3
+ preprocess.py
4
+ pyproject.toml
5
+ ADEX.egg-info/PKG-INFO
6
+ ADEX.egg-info/SOURCES.txt
7
+ ADEX.egg-info/dependency_links.txt
8
+ ADEX.egg-info/entry_points.txt
9
+ ADEX.egg-info/requires.txt
10
+ ADEX.egg-info/top_level.txt
11
+ assets/__init__.py
12
+ assets/css/dbc.min.css
13
+ assets/css/layout.css
14
+ assets/css/markdown.css
15
+ assets/css/sidebar.css
16
+ assets/css/startup_modal.css
17
+ assets/images/AI_lens_black.svg
18
+ assets/images/AI_lens_white.svg
19
+ assets/images/AI_medium_white.svg
20
+ assets/images/aifi-white-logo.png
21
+ assets/images/aifi-white-text.png
22
+ assets/images/aifi_logo.png
23
+ assets/images/screenshot.png
24
+ assets/images/template.png
25
+ assets/markdown/covariate-help.md
26
+ assets/markdown/help_page.md
27
+ assets/markdown/startup_modal.md
28
+ assets/markdown/template_help_page.md
29
+ assets/markdown/template_startup_modal.md
30
+ callbacks/__init__.py
31
+ callbacks/create_deg_callbacks.py
32
+ components/__init__.py
33
+ components/create_deg_components.py
34
+ config/__init__.py
35
+ config/template.json
36
+ config/gmt/c2.all.v2026.1.Hs.json.gz
37
+ config/gmt/h.all.v2026.1.Hs.json.gz
38
+ config/gmt/msigdb-all-pathways.json.gz
39
+ preprocessors/__init__.py
40
+ preprocessors/deseq2.py
41
+ preprocessors/gsea.py
42
+ preprocessors/pseudobulk.py
43
+ src/__init__.py
44
+ src/cli.py
45
+ src/deploy.py
46
+ src/utils.py
47
+ src/version.py
48
+ src/app/__init__.py
49
+ src/app/utils.py
50
+ src/app/version.py
51
+ src/app/components/ConfigSingleton.py
52
+ src/app/components/GenePanel.py
53
+ src/app/components/RadioButtons.py
54
+ src/app/components/StartupModal.py
55
+ src/app/components/__init__.py
56
+ src/app/components/app_header.py
57
+ src/app/components/app_help.py
58
+ src/app/components/app_settings.py
59
+ src/app/components/dropdown.py
60
+ src/app/plots/BoxPlot.py
61
+ src/app/plots/DegSummariesPlot.py
62
+ src/app/plots/HeatmapAIO.py
63
+ src/app/plots/MAPlot.py
64
+ src/app/plots/Volcano.py
65
+ src/app/plots/__init__.py
66
+ src/mediators/GeneSelectionMediator.py
67
+ src/mediators/PathwaySelectionMediator.py
68
+ src/mediators/__init__.py
69
+ src/readers/DegByCovariatesReader.py
70
+ src/readers/Deseq2Readers.py
71
+ src/readers/PseudoBulkLoader.py
72
+ src/readers/__init__.py
73
+ ui/__init__.py
74
+ ui/create_deg_layout.py
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ adex-app = app:main
3
+ adex-preprocess = preprocess:main
@@ -0,0 +1,8 @@
1
+ dash[compress]==3.1.0
2
+ dash-ag-grid>=35.3.0
3
+ dash-bootstrap-components==2.0.4
4
+ dash-iconify==0.1.2
5
+ jsonschema>=4.26.0
6
+ mygene==3.2.2
7
+ numpy>=2.0.0
8
+ polars>=2.1.0
@@ -0,0 +1,9 @@
1
+ app
2
+ assets
3
+ callbacks
4
+ components
5
+ config
6
+ preprocess
7
+ preprocessors
8
+ src
9
+ ui
adex-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.4
2
+ Name: ADEX
3
+ Version: 0.1.0
4
+ Summary: Allen Differential results EXplorer
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: dash[compress]==3.1.0
8
+ Requires-Dist: dash-ag-grid>=35.3.0
9
+ Requires-Dist: dash-bootstrap-components==2.0.4
10
+ Requires-Dist: dash-iconify==0.1.2
11
+ Requires-Dist: jsonschema>=4.26.0
12
+ Requires-Dist: mygene==3.2.2
13
+ Requires-Dist: numpy>=2.0.0
14
+ Requires-Dist: polars>=2.1.0
15
+
16
+ ### sc-deg-explorer
17
+
18
+ A [Plotly Dash](https://dash.plotly.com/) web application for interactively exploring **Differentially Expressed Genes (DEGs)** from single-cell RNA sequencing experiments. Its reusable Dash components and plots are included in the ADEX package, which provides a configurable, dataset-agnostic interface that can be pointed at new datasets simply by swapping a JSON configuration file — no code changes required.
19
+
20
+ ---
21
+
22
+ ### Table of Contents
23
+
24
+ 1. [Purpose](#purpose)
25
+ 2. [Expected inputs](#expected-inputs)
26
+ 3. [Example output](#example-output)
27
+ 3. [Usage](#usage)
28
+ 4. [Configuration](#configuration)
29
+
30
+ ---
31
+
32
+ ### Purpose
33
+ sc-deg-explorer is designed to make DEG results from single-cell pseudobulk analyses immediately accessible to wet-lab and computational scientists alike. After running a DESeq2-based differential expression pipeline, users can point this app at the output files and interactively:
34
+
35
+ - **Explore DEGs** through interactive volcano plots, MA plots, and per-covariate DEG views.
36
+ - **Investigate gene expression** for any selected gene using pseudo-bulk box plots stratified by donor, condition, or cell type.
37
+ - **Analyze pathway enrichment** results via GSEA volcano plots and pathway selection dropdowns.
38
+ - **Filter by cell type and experimental covariates** (e.g., day, treatment, cytokine) using sidebar dropdowns that dynamically update all plots.
39
+ - **Browse gene panels** to quickly navigate to genes of interest.
40
+
41
+ The app is designed to be deployed as an internal data portal, enabling research teams to rapidly iterate on hypotheses without writing additional analysis code.
42
+
43
+ ---
44
+
45
+ ### Expected inputs
46
+
47
+ The major inputs to the program are:
48
+
49
+ <details open>
50
+ <summary><strong>1. [Required]: Configuration file</strong></summary>
51
+ Manually fill the configuration file <strong>config/template.json</strong> with project-specific details.
52
+ </details>
53
+
54
+ <details open>
55
+ <summary><strong>2. [Required]: Differential results from tools like DESeq2</strong></summary>
56
+ An example dataset can be found in the file <strong>input-data-examples/deseq2.xlsx</strong>. Make sure to format the data in csv.gz.
57
+ </details>
58
+
59
+ <details>
60
+ <summary><strong>3. [Optional]: Enrichment results from GSEA</strong></summary>
61
+ An example dataset can be found in the file <strong>input-data-examples/fGSEA.xlsx</strong>. Make sure to format the data in tsv.gz.
62
+ </details>
63
+
64
+ > <u>Note on input data format</u>: The overall intention of the input data format is to use a set of columns to specify important combinations of independent variables, which will demarcate several DE tests into one file. These covariate columns **must** be present and match across every input data type.
65
+
66
+ > <u>Note on specifying covariates</u>: While there are instructions in the config file, this small piece of information is important to get right: **the order of covariates written in the config file matters**. The first covariate should reflect the group that appears on the right side of a volcano plot, and the second covariate is the left side of a volcano plot. Additional covariates can be specified without further constraints.
67
+
68
+ ---
69
+
70
+ ### Expected output files
71
+
72
+ The pipeline produces Parquet files that are scanned, selected, filtered, and collected to be served to the user's front-end.
73
+
74
+ ```
75
+ results/
76
+ ├── deg
77
+ │ ├── adjp.parquet
78
+ │ ├── deg.parquet
79
+ │ ├── log2fc.parquet
80
+ │ ├── means.parquet
81
+ │ ├── meta.parquet
82
+ │ ├── summaries.parquet
83
+ │ ├── t-adjp.parquet
84
+ │ └── t-log2fc.parquet
85
+ └── gsea
86
+ ├── results.parquet
87
+ ├── meta.parquet
88
+ ├── summaries.parquet
89
+ ...
90
+ ```
91
+
92
+ ---
93
+
94
+ ### Usage
95
+
96
+ Install ADEX with pip (Python 3.13 or newer), then run the commands from the
97
+ directory containing your project configuration and input data:
98
+
99
+ ```bash
100
+ # Install ADEX
101
+ python -m pip install git+https://github.com/aifimmunology/sc-deg-explorer.git
102
+
103
+ # Prepare config/template.json with project-specific settings and data paths.
104
+
105
+ # Preprocess differential results
106
+ adex-preprocess --config config/template.json
107
+
108
+ # Start the dashboard
109
+ adex-app --config config/template.json
110
+ ```
111
+
112
+ For development from a source checkout, install the Pixi environment with
113
+ `pixi install --frozen`, then run:
114
+
115
+ ```bash
116
+ pixi run python preprocess.py --config config/template.json
117
+ pixi run python app.py --config config/template.json
118
+ ```
119
+
120
+ ---
121
+
122
+ ### Example Output
123
+ The following screenshot is an example of a working app. After starting the app, it can be accessed via the following URL: `http://0.0.0.0:8050/`
124
+
125
+ ![MA Plot](assets/images/screenshot.png)
126
+
127
+ ---
128
+
129
+ ### Test build with Docker
130
+ Local builds with Docker can be helpful before deploying to a remote server for production.
131
+ ```bash
132
+ docker build --platform=linux/arm64/v8 -t rheumatoid-arthritis . # 'rheumatoid-arthritis' can be any string
133
+ docker run -p 8050:8050 rheumatoid-arthritis
134
+ ```
135
+
136
+ The app will be available at `http://localhost:8050`.
adex-0.1.0/README.md ADDED
@@ -0,0 +1,121 @@
1
+ ### sc-deg-explorer
2
+
3
+ A [Plotly Dash](https://dash.plotly.com/) web application for interactively exploring **Differentially Expressed Genes (DEGs)** from single-cell RNA sequencing experiments. Its reusable Dash components and plots are included in the ADEX package, which provides a configurable, dataset-agnostic interface that can be pointed at new datasets simply by swapping a JSON configuration file — no code changes required.
4
+
5
+ ---
6
+
7
+ ### Table of Contents
8
+
9
+ 1. [Purpose](#purpose)
10
+ 2. [Expected inputs](#expected-inputs)
11
+ 3. [Example output](#example-output)
12
+ 3. [Usage](#usage)
13
+ 4. [Configuration](#configuration)
14
+
15
+ ---
16
+
17
+ ### Purpose
18
+ sc-deg-explorer is designed to make DEG results from single-cell pseudobulk analyses immediately accessible to wet-lab and computational scientists alike. After running a DESeq2-based differential expression pipeline, users can point this app at the output files and interactively:
19
+
20
+ - **Explore DEGs** through interactive volcano plots, MA plots, and per-covariate DEG views.
21
+ - **Investigate gene expression** for any selected gene using pseudo-bulk box plots stratified by donor, condition, or cell type.
22
+ - **Analyze pathway enrichment** results via GSEA volcano plots and pathway selection dropdowns.
23
+ - **Filter by cell type and experimental covariates** (e.g., day, treatment, cytokine) using sidebar dropdowns that dynamically update all plots.
24
+ - **Browse gene panels** to quickly navigate to genes of interest.
25
+
26
+ The app is designed to be deployed as an internal data portal, enabling research teams to rapidly iterate on hypotheses without writing additional analysis code.
27
+
28
+ ---
29
+
30
+ ### Expected inputs
31
+
32
+ The major inputs to the program are:
33
+
34
+ <details open>
35
+ <summary><strong>1. [Required]: Configuration file</strong></summary>
36
+ Manually fill the configuration file <strong>config/template.json</strong> with project-specific details.
37
+ </details>
38
+
39
+ <details open>
40
+ <summary><strong>2. [Required]: Differential results from tools like DESeq2</strong></summary>
41
+ An example dataset can be found in the file <strong>input-data-examples/deseq2.xlsx</strong>. Make sure to format the data in csv.gz.
42
+ </details>
43
+
44
+ <details>
45
+ <summary><strong>3. [Optional]: Enrichment results from GSEA</strong></summary>
46
+ An example dataset can be found in the file <strong>input-data-examples/fGSEA.xlsx</strong>. Make sure to format the data in tsv.gz.
47
+ </details>
48
+
49
+ > <u>Note on input data format</u>: The overall intention of the input data format is to use a set of columns to specify important combinations of independent variables, which will demarcate several DE tests into one file. These covariate columns **must** be present and match across every input data type.
50
+
51
+ > <u>Note on specifying covariates</u>: While there are instructions in the config file, this small piece of information is important to get right: **the order of covariates written in the config file matters**. The first covariate should reflect the group that appears on the right side of a volcano plot, and the second covariate is the left side of a volcano plot. Additional covariates can be specified without further constraints.
52
+
53
+ ---
54
+
55
+ ### Expected output files
56
+
57
+ The pipeline produces Parquet files that are scanned, selected, filtered, and collected to be served to the user's front-end.
58
+
59
+ ```
60
+ results/
61
+ ├── deg
62
+ │ ├── adjp.parquet
63
+ │ ├── deg.parquet
64
+ │ ├── log2fc.parquet
65
+ │ ├── means.parquet
66
+ │ ├── meta.parquet
67
+ │ ├── summaries.parquet
68
+ │ ├── t-adjp.parquet
69
+ │ └── t-log2fc.parquet
70
+ └── gsea
71
+ ├── results.parquet
72
+ ├── meta.parquet
73
+ ├── summaries.parquet
74
+ ...
75
+ ```
76
+
77
+ ---
78
+
79
+ ### Usage
80
+
81
+ Install ADEX with pip (Python 3.13 or newer), then run the commands from the
82
+ directory containing your project configuration and input data:
83
+
84
+ ```bash
85
+ # Install ADEX
86
+ python -m pip install git+https://github.com/aifimmunology/sc-deg-explorer.git
87
+
88
+ # Prepare config/template.json with project-specific settings and data paths.
89
+
90
+ # Preprocess differential results
91
+ adex-preprocess --config config/template.json
92
+
93
+ # Start the dashboard
94
+ adex-app --config config/template.json
95
+ ```
96
+
97
+ For development from a source checkout, install the Pixi environment with
98
+ `pixi install --frozen`, then run:
99
+
100
+ ```bash
101
+ pixi run python preprocess.py --config config/template.json
102
+ pixi run python app.py --config config/template.json
103
+ ```
104
+
105
+ ---
106
+
107
+ ### Example Output
108
+ The following screenshot is an example of a working app. After starting the app, it can be accessed via the following URL: `http://0.0.0.0:8050/`
109
+
110
+ ![MA Plot](assets/images/screenshot.png)
111
+
112
+ ---
113
+
114
+ ### Test build with Docker
115
+ Local builds with Docker can be helpful before deploying to a remote server for production.
116
+ ```bash
117
+ docker build --platform=linux/arm64/v8 -t rheumatoid-arthritis . # 'rheumatoid-arthritis' can be any string
118
+ docker run -p 8050:8050 rheumatoid-arthritis
119
+ ```
120
+
121
+ The app will be available at `http://localhost:8050`.
adex-0.1.0/app.py ADDED
@@ -0,0 +1,88 @@
1
+ """
2
+ app.py is a template for Allen Institute members to quickly,
3
+ efficiently, and uniformly develop Dash apps
4
+ """
5
+
6
+ import argparse
7
+ from pathlib import Path
8
+
9
+ from dash import Dash
10
+ from preprocess import GLOBAL_DELIMITER
11
+
12
+ import assets
13
+ import src.app as adm
14
+
15
+ from components.create_deg_components import create_deg_components
16
+ from ui.create_deg_layout import create_deg_layout
17
+ from callbacks.create_deg_callbacks import create_deg_callbacks
18
+ from src.cli import default_config_path
19
+
20
+
21
+ STYLESHEETS = [
22
+ "https://storage.googleapis.com/aifi-static-assets/hise-style.css",
23
+ "https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css",
24
+ "/assets/css/dbc.min.css",
25
+ "/assets/css/sidebar.css",
26
+ "/assets/css/markdown.css",
27
+ "/assets/css/startup_modal.css",
28
+ "/assets/css/layout.css",
29
+ ]
30
+
31
+
32
+ def resolve_packaged_markdown_paths(modules: object, assets_dir: Path) -> None:
33
+ for markdown_key in ("help_page_content", "startup_modal_content", "covariate_help"):
34
+ markdown_file = getattr(modules, markdown_key, None)
35
+ if not isinstance(markdown_file, str) or not markdown_file:
36
+ continue
37
+
38
+ markdown_path = Path(markdown_file)
39
+ if not markdown_path.is_absolute() and not markdown_path.is_file():
40
+ packaged_path = assets_dir.parent / markdown_path
41
+ if packaged_path.is_file():
42
+ setattr(modules, markdown_key, str(packaged_path))
43
+
44
+
45
+ def main() -> None:
46
+ parser = argparse.ArgumentParser(
47
+ description=(
48
+ "Run the ADEX dashboard. By default, uses config/template.json "
49
+ "from the current directory, or the packaged template if absent."
50
+ )
51
+ )
52
+ parser.add_argument("-c", "--config", help="Path to an ADEX-compatible JSON configuration file.")
53
+ parser.add_argument("-s", "--schema", help="Path to a JSON schema to validate configuration against.")
54
+ args = parser.parse_args()
55
+
56
+ assets_dir = Path(assets.__file__).resolve().parent
57
+ config = adm.ConfigSingleton(
58
+ config_file=args.config or str(default_config_path()),
59
+ schema_file=args.schema,
60
+ )
61
+ resolve_packaged_markdown_paths(config.app.modules, assets_dir)
62
+
63
+ app = Dash(
64
+ name=config.app.app_title,
65
+ external_stylesheets=STYLESHEETS,
66
+ assets_folder=str(assets_dir),
67
+ update_title="",
68
+ compress=True,
69
+ )
70
+ app._favicon = "images/AI_lens_black.svg"
71
+
72
+ deg_components = create_deg_components(config, delimiter=GLOBAL_DELIMITER)
73
+ app.layout = create_deg_layout(
74
+ config,
75
+ components=deg_components,
76
+ delimiter=GLOBAL_DELIMITER,
77
+ )
78
+ create_deg_callbacks(
79
+ config,
80
+ components=deg_components,
81
+ delimiter=GLOBAL_DELIMITER,
82
+ )
83
+
84
+ app.run(host="0.0.0.0", port=8050, debug=False)
85
+
86
+
87
+ if __name__ == "__main__":
88
+ main()
File without changes