crisgi 0.1.1__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.
- crisgi-0.1.1/.github/workflows/mkdocs.yml +28 -0
- crisgi-0.1.1/INSTALL.md +79 -0
- crisgi-0.1.1/LICENSE +183 -0
- crisgi-0.1.1/MANIFEST.in +12 -0
- crisgi-0.1.1/PKG-INFO +123 -0
- crisgi-0.1.1/README.md +57 -0
- crisgi-0.1.1/__init__.py +0 -0
- crisgi-0.1.1/crisgi/__init__.py +4 -0
- crisgi-0.1.1/crisgi/_version.py +1 -0
- crisgi-0.1.1/crisgi/cnn/CNNModel.py +64 -0
- crisgi-0.1.1/crisgi/cnn/__init__.py +0 -0
- crisgi-0.1.1/crisgi/cnn/autoEncoder.py +36 -0
- crisgi-0.1.1/crisgi/cnn/evalution_metrics.py +46 -0
- crisgi-0.1.1/crisgi/cnn/mlp.py +16 -0
- crisgi-0.1.1/crisgi/cnn/train.py +42 -0
- crisgi-0.1.1/crisgi/crisgi.py +986 -0
- crisgi-0.1.1/crisgi/logistic/LogisticModel.py +37 -0
- crisgi-0.1.1/crisgi/logistic/__init__.py +0 -0
- crisgi-0.1.1/crisgi/logistic/evalution_metrics.py +53 -0
- crisgi-0.1.1/crisgi/logistic/train.py +32 -0
- crisgi-0.1.1/crisgi/plotting.py +219 -0
- crisgi-0.1.1/crisgi/plotting_crisgi_time.py +278 -0
- crisgi-0.1.1/crisgi/simplecnn/SimpleCNNModel.py +65 -0
- crisgi-0.1.1/crisgi/simplecnn/__init__.py +0 -0
- crisgi-0.1.1/crisgi/simplecnn/autoEncoder.py +22 -0
- crisgi-0.1.1/crisgi/simplecnn/evalution_metrics.py +53 -0
- crisgi-0.1.1/crisgi/simplecnn/mlp.py +14 -0
- crisgi-0.1.1/crisgi/simplecnn/train.py +45 -0
- crisgi-0.1.1/crisgi/startpoint_detection.py +61 -0
- crisgi-0.1.1/crisgi/stringdb_human_v12_gb_net.pk +0 -0
- crisgi-0.1.1/crisgi/stringdb_human_v12_genes.pk +0 -0
- crisgi-0.1.1/crisgi/util.py +85 -0
- crisgi-0.1.1/crisgi.egg-info/PKG-INFO +123 -0
- crisgi-0.1.1/crisgi.egg-info/SOURCES.txt +74 -0
- crisgi-0.1.1/crisgi.egg-info/dependency_links.txt +1 -0
- crisgi-0.1.1/crisgi.egg-info/requires.txt +38 -0
- crisgi-0.1.1/crisgi.egg-info/top_level.txt +1 -0
- crisgi-0.1.1/docs/api/calculate_entropy.md +70 -0
- crisgi-0.1.1/docs/api/check_common_diff.md +71 -0
- crisgi-0.1.1/docs/api/cohort_level_top_n_ORA.md +67 -0
- crisgi-0.1.1/docs/api/crisgi_init.md +67 -0
- crisgi-0.1.1/docs/api/crisgitime_init.md +58 -0
- crisgi-0.1.1/docs/api/detect_startpoint.md +43 -0
- crisgi-0.1.1/docs/api/find_interaction_module.md +71 -0
- crisgi-0.1.1/docs/api/get_DER.md +66 -0
- crisgi-0.1.1/docs/api/init.md +145 -0
- crisgi-0.1.1/docs/api/init_edata.md +49 -0
- crisgi-0.1.1/docs/api/load_crisgi.md +47 -0
- crisgi-0.1.1/docs/api/network_analysis.md +65 -0
- crisgi-0.1.1/docs/api/obs_level_CT_rank.md +40 -0
- crisgi-0.1.1/docs/api/pheno_level_CT_rank.md +78 -0
- crisgi-0.1.1/docs/api/pheno_level_accumulated_top_n_ORA.md +80 -0
- crisgi-0.1.1/docs/api/pl.interaction_score_line.md +65 -0
- crisgi-0.1.1/docs/api/pl.pheno_level_accumulated_top_n_ORA.md +72 -0
- crisgi-0.1.1/docs/api/save.md +45 -0
- crisgi-0.1.1/docs/api/survival_analysis.md +67 -0
- crisgi-0.1.1/docs/api/test_DER.md +56 -0
- crisgi-0.1.1/docs/api/test_TER.md +54 -0
- crisgi-0.1.1/docs/api/test_val_trend_entropy.md +52 -0
- crisgi-0.1.1/docs/api/train_predict.md +81 -0
- crisgi-0.1.1/docs/api_reference.md +24 -0
- crisgi-0.1.1/docs/css/custom.css +15 -0
- crisgi-0.1.1/docs/figure/Figure1.png +0 -0
- crisgi-0.1.1/docs/index.md +68 -0
- crisgi-0.1.1/docs/installation.md +38 -0
- crisgi-0.1.1/docs/js/sort-init.js +8 -0
- crisgi-0.1.1/docs/js/tablesort.min.js +6 -0
- crisgi-0.1.1/docs/tutorial/gse30550.ipynb +1674 -0
- crisgi-0.1.1/docs/tutorial.md +7 -0
- crisgi-0.1.1/mkdocs.yml +96 -0
- crisgi-0.1.1/pyproject.toml +131 -0
- crisgi-0.1.1/requirements-dev.txt +22 -0
- crisgi-0.1.1/requirements-test.txt +19 -0
- crisgi-0.1.1/requirements.txt +37 -0
- crisgi-0.1.1/setup.cfg +4 -0
- crisgi-0.1.1/setup.py +114 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: mkdocs
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
permissions:
|
|
7
|
+
contents: write
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- name: Configure Git Credentials
|
|
14
|
+
run: |
|
|
15
|
+
git config user.name github-actions[bot]
|
|
16
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: 3.x
|
|
20
|
+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
|
21
|
+
- uses: actions/cache@v4
|
|
22
|
+
with:
|
|
23
|
+
key: mkdocs-material-${{ env.cache_id }}
|
|
24
|
+
path: .cache
|
|
25
|
+
restore-keys: |
|
|
26
|
+
mkdocs-material-
|
|
27
|
+
- run: pip install mkdocs mkdocs-material mknotebooks mkdocstrings mkdocstrings-python
|
|
28
|
+
- run: mkdocs gh-deploy --force
|
crisgi-0.1.1/INSTALL.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Installation Guide
|
|
2
|
+
|
|
3
|
+
## Quick Installation
|
|
4
|
+
|
|
5
|
+
### From PyPI (Recommended - when available)
|
|
6
|
+
```bash
|
|
7
|
+
pip install crisgi
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### From Source (Development)
|
|
11
|
+
```bash
|
|
12
|
+
# Clone the repository
|
|
13
|
+
git clone https://github.com/compbioclub/CRISGI.git
|
|
14
|
+
cd CRISGI
|
|
15
|
+
|
|
16
|
+
# Install in development mode
|
|
17
|
+
pip install -e .
|
|
18
|
+
|
|
19
|
+
# Or install with all dependencies
|
|
20
|
+
pip install -e ".[dev,docs,tutorial]"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Using requirements.txt
|
|
24
|
+
```bash
|
|
25
|
+
# Basic installation
|
|
26
|
+
pip install -r requirements.txt
|
|
27
|
+
|
|
28
|
+
# Development installation
|
|
29
|
+
pip install -r requirements-dev.txt
|
|
30
|
+
|
|
31
|
+
# Testing environment
|
|
32
|
+
pip install -r requirements-test.txt
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
- Python 3.9+
|
|
38
|
+
- See `requirements.txt` for full dependency list
|
|
39
|
+
|
|
40
|
+
## Verification
|
|
41
|
+
|
|
42
|
+
Test your installation:
|
|
43
|
+
```python
|
|
44
|
+
import crisgi
|
|
45
|
+
print(crisgi.__version__)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Common Issues
|
|
49
|
+
|
|
50
|
+
1. **PyTorch Installation**: If you encounter issues with PyTorch, install it separately:
|
|
51
|
+
```bash
|
|
52
|
+
pip install torch torchvision torchaudio
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
2. **Scanpy Dependencies**: For some systems, you may need to install scanpy dependencies separately:
|
|
56
|
+
```bash
|
|
57
|
+
pip install scanpy[leiden]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
3. **Memory Requirements**: Some operations require significant memory. Ensure adequate RAM is available.
|
|
61
|
+
|
|
62
|
+
## Development Setup
|
|
63
|
+
|
|
64
|
+
For contributors:
|
|
65
|
+
```bash
|
|
66
|
+
# Clone and install
|
|
67
|
+
git clone https://github.com/compbioclub/CRISGI.git
|
|
68
|
+
cd CRISGI
|
|
69
|
+
|
|
70
|
+
# Create virtual environment
|
|
71
|
+
python -m venv venv
|
|
72
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
73
|
+
|
|
74
|
+
# Install in development mode with all extras
|
|
75
|
+
pip install -e ".[dev,docs,tutorial]"
|
|
76
|
+
|
|
77
|
+
# Install pre-commit hooks
|
|
78
|
+
pre-commit install
|
|
79
|
+
```
|
crisgi-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting the License. You accept and agree to be bound by the
|
|
166
|
+
terms of this License by copying, modifying, or distributing the
|
|
167
|
+
Work (or works based on the Work).
|
|
168
|
+
|
|
169
|
+
END OF TERMS AND CONDITIONS
|
|
170
|
+
|
|
171
|
+
Copyright 2025 Lyu C., Jiang A., Ng K. H., Liu X., Chen L.
|
|
172
|
+
|
|
173
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
174
|
+
you may not use this file except in compliance with the License.
|
|
175
|
+
You may obtain a copy of the License at
|
|
176
|
+
|
|
177
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
178
|
+
|
|
179
|
+
Unless required by applicable law or agreed to in writing, software
|
|
180
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
181
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
182
|
+
See the License for the specific language governing permissions and
|
|
183
|
+
limitations under the License.
|
crisgi-0.1.1/MANIFEST.in
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include requirements.txt
|
|
4
|
+
include requirements-dev.txt
|
|
5
|
+
recursive-include crisgi *.pk
|
|
6
|
+
recursive-include docs *
|
|
7
|
+
recursive-include data *.h5ad *.csv
|
|
8
|
+
global-exclude *.pyc
|
|
9
|
+
global-exclude __pycache__
|
|
10
|
+
global-exclude .DS_Store
|
|
11
|
+
global-exclude .git*
|
|
12
|
+
exclude .gitignore
|
crisgi-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: crisgi
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Charting Critical Transient Gene Interactions in Disease Progression from Multi-modal Transcriptomics
|
|
5
|
+
Home-page: https://github.com/compbioclub/CRISGI
|
|
6
|
+
Author: Lyu C., Jiang A., Ng K. H., Liu X., Chen L.
|
|
7
|
+
Author-email:
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/compbioclub/CRISGI
|
|
10
|
+
Project-URL: Documentation, https://compbioclub.github.io/CRISGI/
|
|
11
|
+
Project-URL: Repository, https://github.com/compbioclub/CRISGI.git
|
|
12
|
+
Project-URL: Bug Tracker, https://github.com/compbioclub/CRISGI/issues
|
|
13
|
+
Keywords: bioinformatics,genomics,critical transitions,gene interactions,transcriptomics,single-cell,spatial transcriptomics,disease progression,machine learning,neural networks
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: numpy>=1.20.0
|
|
29
|
+
Requires-Dist: pandas>=1.3.0
|
|
30
|
+
Requires-Dist: scipy>=1.7.0
|
|
31
|
+
Requires-Dist: scikit-learn>=1.0.0
|
|
32
|
+
Requires-Dist: torch>=2.5.0
|
|
33
|
+
Requires-Dist: torchvision>=0.20.0
|
|
34
|
+
Requires-Dist: joblib>=1.0.0
|
|
35
|
+
Requires-Dist: scanpy>=1.8.0
|
|
36
|
+
Requires-Dist: anndata>=0.8.0
|
|
37
|
+
Requires-Dist: matplotlib>=3.3.0
|
|
38
|
+
Requires-Dist: seaborn>=0.11.0
|
|
39
|
+
Requires-Dist: pyvis>=0.2.0
|
|
40
|
+
Requires-Dist: scikit-survival>=0.17.0
|
|
41
|
+
Requires-Dist: gseapy>=1.0.0
|
|
42
|
+
Requires-Dist: pymannkendall>=1.4.0
|
|
43
|
+
Requires-Dist: pyseat
|
|
44
|
+
Requires-Dist: Pillow>=8.0.0
|
|
45
|
+
Requires-Dist: ipykernel>=6.0.0
|
|
46
|
+
Requires-Dist: ipython>=8.0.0
|
|
47
|
+
Requires-Dist: jupyter>=1.0.0
|
|
48
|
+
Provides-Extra: dev
|
|
49
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
50
|
+
Requires-Dist: pytest-cov>=2.10; extra == "dev"
|
|
51
|
+
Requires-Dist: black>=21.0; extra == "dev"
|
|
52
|
+
Requires-Dist: flake8>=3.8; extra == "dev"
|
|
53
|
+
Requires-Dist: isort>=5.0; extra == "dev"
|
|
54
|
+
Requires-Dist: pre-commit>=2.15.0; extra == "dev"
|
|
55
|
+
Requires-Dist: mypy>=0.910; extra == "dev"
|
|
56
|
+
Provides-Extra: docs
|
|
57
|
+
Requires-Dist: mkdocs>=1.4.0; extra == "docs"
|
|
58
|
+
Requires-Dist: mkdocs-material>=8.0.0; extra == "docs"
|
|
59
|
+
Requires-Dist: mkdocstrings[python]>=0.19.0; extra == "docs"
|
|
60
|
+
Requires-Dist: mknotebooks>=0.7.0; extra == "docs"
|
|
61
|
+
Provides-Extra: tutorial
|
|
62
|
+
Requires-Dist: notebook>=6.0.0; extra == "tutorial"
|
|
63
|
+
Dynamic: home-page
|
|
64
|
+
Dynamic: license-file
|
|
65
|
+
Dynamic: requires-python
|
|
66
|
+
|
|
67
|
+
# CRISGI
|
|
68
|
+
|
|
69
|
+
Welcome to the official documentation of Charting CRItical tranSient Gene Interactions (**CRISGI**) in Disease Progression from Multi-modal Transcriptomics!
|
|
70
|
+
|
|
71
|
+
## 🗺️ Overview
|
|
72
|
+
|
|
73
|
+

|
|
74
|
+
|
|
75
|
+
Critical transitions (CTs) in gene regulatory networks (GRNs) drive pivotal shifts in disease progression. While CT theory holds great promise for early disease detection, existing computational frameworks face major limitations. They rely on unsupervised ranking of CT signals at individual gene or gene-module level, apply unranked gene set enrichment analyses, and depend on manual inspection of signal trends to infer CT presence and onset within a single cohort. Additionally, multimodal transcriptomic data remain underutilized. These approaches limit mechanistic resolution and hinder clinical translation.
|
|
76
|
+
|
|
77
|
+
We present CRISGI, a novel CT framework designed to overcome these challenges. CRISGI enables phenotype-specific CT gene-gene interaction modeling, CT-rank enrichment analyses, automated CT presence and onset prediction, and supports bulk, single-cell, and spatial transcriptomic (ST) data.
|
|
78
|
+
|
|
79
|
+
## 🚀 Getting Started
|
|
80
|
+
|
|
81
|
+
Want to start using it immediately? Check out the [Installation Guide](https://compbioclub.github.io/CRISGI/installation/) and [Usage Guide](https://compbioclub.github.io/CRISGI/usage/).
|
|
82
|
+
|
|
83
|
+
### 📥 Installation
|
|
84
|
+
|
|
85
|
+
CRISGI is a Python package that can be installed via pip. You can install it from PyPI or from the source.
|
|
86
|
+
|
|
87
|
+
Details on how to install CRISGI can be found in the [Installation](https://compbioclub.github.io/CRISGI/installation/) section.
|
|
88
|
+
|
|
89
|
+
### 🔧 Usage
|
|
90
|
+
|
|
91
|
+
CRISGI is designed to be user-friendly and easy to use. The package provides a set of functions that can be used to perform various tasks related to critical transitions in gene interactions. Detailed instructions on how to use CRISGI can be found in the following sections.
|
|
92
|
+
|
|
93
|
+
### 📖 Tutorials
|
|
94
|
+
|
|
95
|
+
Moreover, you can find some tutorials in the [Tutorial](https://compbioclub.github.io/CRISGI/tutorial/) section. These tutorials will guide you through the process of using CRISGI for your own data analysis.
|
|
96
|
+
|
|
97
|
+
## 📚 API Reference
|
|
98
|
+
|
|
99
|
+
For more detailed information, please refer to the [API Reference](https://compbioclub.github.io/CRISGI/api_reference/).
|
|
100
|
+
|
|
101
|
+
## 📑 Citation
|
|
102
|
+
|
|
103
|
+
If you use CRISGI in your research, please cite the following paper:
|
|
104
|
+
|
|
105
|
+
APA format:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Lyu, C., Jiang, A., Ng, K. H., Liu, X., & Chen, L. (2025). Predicting Early Transitions in Respiratory Virus Infections via Critical Transient Gene Interactions. bioRxiv. https://doi.org/10.1101/2025.04.18.649619
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
BibTeX format:
|
|
113
|
+
|
|
114
|
+
```bibtex
|
|
115
|
+
@article{crisgi,
|
|
116
|
+
title={Predicting Early Transitions in Respiratory Virus Infections via Critical Transient Gene Interactions},
|
|
117
|
+
author={Lyu, Chengshang and Jiang, Anna and Ng, Ka Ho and Liu, Xiaoyu and Chen, Lingxi},
|
|
118
|
+
journal={bioRxiv},
|
|
119
|
+
year={2025},
|
|
120
|
+
doi={10.1101/2025.04.18.649619},
|
|
121
|
+
publisher={Cold Spring Harbor Laboratory}
|
|
122
|
+
}
|
|
123
|
+
```
|
crisgi-0.1.1/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# CRISGI
|
|
2
|
+
|
|
3
|
+
Welcome to the official documentation of Charting CRItical tranSient Gene Interactions (**CRISGI**) in Disease Progression from Multi-modal Transcriptomics!
|
|
4
|
+
|
|
5
|
+
## 🗺️ Overview
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
Critical transitions (CTs) in gene regulatory networks (GRNs) drive pivotal shifts in disease progression. While CT theory holds great promise for early disease detection, existing computational frameworks face major limitations. They rely on unsupervised ranking of CT signals at individual gene or gene-module level, apply unranked gene set enrichment analyses, and depend on manual inspection of signal trends to infer CT presence and onset within a single cohort. Additionally, multimodal transcriptomic data remain underutilized. These approaches limit mechanistic resolution and hinder clinical translation.
|
|
10
|
+
|
|
11
|
+
We present CRISGI, a novel CT framework designed to overcome these challenges. CRISGI enables phenotype-specific CT gene-gene interaction modeling, CT-rank enrichment analyses, automated CT presence and onset prediction, and supports bulk, single-cell, and spatial transcriptomic (ST) data.
|
|
12
|
+
|
|
13
|
+
## 🚀 Getting Started
|
|
14
|
+
|
|
15
|
+
Want to start using it immediately? Check out the [Installation Guide](https://compbioclub.github.io/CRISGI/installation/) and [Usage Guide](https://compbioclub.github.io/CRISGI/usage/).
|
|
16
|
+
|
|
17
|
+
### 📥 Installation
|
|
18
|
+
|
|
19
|
+
CRISGI is a Python package that can be installed via pip. You can install it from PyPI or from the source.
|
|
20
|
+
|
|
21
|
+
Details on how to install CRISGI can be found in the [Installation](https://compbioclub.github.io/CRISGI/installation/) section.
|
|
22
|
+
|
|
23
|
+
### 🔧 Usage
|
|
24
|
+
|
|
25
|
+
CRISGI is designed to be user-friendly and easy to use. The package provides a set of functions that can be used to perform various tasks related to critical transitions in gene interactions. Detailed instructions on how to use CRISGI can be found in the following sections.
|
|
26
|
+
|
|
27
|
+
### 📖 Tutorials
|
|
28
|
+
|
|
29
|
+
Moreover, you can find some tutorials in the [Tutorial](https://compbioclub.github.io/CRISGI/tutorial/) section. These tutorials will guide you through the process of using CRISGI for your own data analysis.
|
|
30
|
+
|
|
31
|
+
## 📚 API Reference
|
|
32
|
+
|
|
33
|
+
For more detailed information, please refer to the [API Reference](https://compbioclub.github.io/CRISGI/api_reference/).
|
|
34
|
+
|
|
35
|
+
## 📑 Citation
|
|
36
|
+
|
|
37
|
+
If you use CRISGI in your research, please cite the following paper:
|
|
38
|
+
|
|
39
|
+
APA format:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Lyu, C., Jiang, A., Ng, K. H., Liu, X., & Chen, L. (2025). Predicting Early Transitions in Respiratory Virus Infections via Critical Transient Gene Interactions. bioRxiv. https://doi.org/10.1101/2025.04.18.649619
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
BibTeX format:
|
|
47
|
+
|
|
48
|
+
```bibtex
|
|
49
|
+
@article{crisgi,
|
|
50
|
+
title={Predicting Early Transitions in Respiratory Virus Infections via Critical Transient Gene Interactions},
|
|
51
|
+
author={Lyu, Chengshang and Jiang, Anna and Ng, Ka Ho and Liu, Xiaoyu and Chen, Lingxi},
|
|
52
|
+
journal={bioRxiv},
|
|
53
|
+
year={2025},
|
|
54
|
+
doi={10.1101/2025.04.18.649619},
|
|
55
|
+
publisher={Cold Spring Harbor Laboratory}
|
|
56
|
+
}
|
|
57
|
+
```
|
crisgi-0.1.1/__init__.py
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.1"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import torch
|
|
3
|
+
from crisgi.cnn.autoEncoder import AE
|
|
4
|
+
import crisgi.cnn.autoEncoder
|
|
5
|
+
from crisgi.cnn.mlp import MLP
|
|
6
|
+
import crisgi.cnn.mlp
|
|
7
|
+
from crisgi.cnn.train import train as train_loop
|
|
8
|
+
|
|
9
|
+
sys.modules['autoEncoder'] = crisgi.cnn.autoEncoder
|
|
10
|
+
sys.modules['mlp'] = crisgi.cnn.mlp
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CNNModel:
|
|
14
|
+
def __init__(self, device, ae_path=None, mlp_path=None):
|
|
15
|
+
self.device = device
|
|
16
|
+
self.ae = AE().to(device)
|
|
17
|
+
self.mlp = MLP().to(device)
|
|
18
|
+
self.ae_loss_fn = torch.nn.MSELoss().to(device)
|
|
19
|
+
self.ce_loss_fn = torch.nn.CrossEntropyLoss().to(device)
|
|
20
|
+
self.optimizer = torch.optim.Adam(
|
|
21
|
+
list(self.ae.parameters()) + list(self.mlp.parameters()),
|
|
22
|
+
lr=0.001, weight_decay=1e-4
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
if ae_path and mlp_path:
|
|
26
|
+
print(f"Loading pretrained models:\n - AE: {ae_path}\n - MLP: {mlp_path}")
|
|
27
|
+
self.ae = torch.load(ae_path, map_location=device, weights_only=False)
|
|
28
|
+
self.mlp = torch.load(mlp_path, map_location=device, weights_only=False)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def train(self, train_loader,epochs=10):
|
|
32
|
+
final_metrics = None
|
|
33
|
+
for epoch in range(epochs):
|
|
34
|
+
print(f"\nEpoch {epoch + 1}/{epochs}")
|
|
35
|
+
final_metrics = train_loop(
|
|
36
|
+
self.ae,
|
|
37
|
+
self.mlp,
|
|
38
|
+
train_loader,
|
|
39
|
+
self.ae_loss_fn,
|
|
40
|
+
self.ce_loss_fn,
|
|
41
|
+
self.optimizer,
|
|
42
|
+
self.device
|
|
43
|
+
)
|
|
44
|
+
return final_metrics
|
|
45
|
+
|
|
46
|
+
def predict(self, data_loader):
|
|
47
|
+
self.ae.eval()
|
|
48
|
+
self.mlp.eval()
|
|
49
|
+
all_predictions = []
|
|
50
|
+
|
|
51
|
+
with torch.no_grad():
|
|
52
|
+
for x, _ in data_loader:
|
|
53
|
+
x = x.to(self.device)
|
|
54
|
+
en, _ = self.ae(x)
|
|
55
|
+
out = self.mlp(en)
|
|
56
|
+
predicted = out.argmax(dim=1)
|
|
57
|
+
all_predictions.extend(predicted.cpu().numpy())
|
|
58
|
+
|
|
59
|
+
return all_predictions
|
|
60
|
+
|
|
61
|
+
def save(self, ae_path, mlp_path):
|
|
62
|
+
torch.save(self.ae.state_dict(), ae_path)
|
|
63
|
+
torch.save(self.mlp.state_dict(), mlp_path)
|
|
64
|
+
print(f"Models saved to:\n - {ae_path}\n - {mlp_path}")
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from torch import nn
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class AE(nn.Module):
|
|
5
|
+
def __init__(self):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.encoder = nn.Sequential(
|
|
8
|
+
nn.Conv2d(4, 16, 3, padding=1),
|
|
9
|
+
nn.BatchNorm2d(16),
|
|
10
|
+
nn.ReLU(),
|
|
11
|
+
nn.Dropout(0.2),
|
|
12
|
+
nn.MaxPool2d(2, 2),
|
|
13
|
+
nn.Conv2d(16, 32, 3, padding=1),
|
|
14
|
+
nn.BatchNorm2d(32),
|
|
15
|
+
nn.ReLU(),
|
|
16
|
+
nn.Dropout(0.2),
|
|
17
|
+
nn.MaxPool2d(2, 2),
|
|
18
|
+
nn.Conv2d(32, 64, 3, padding=1),
|
|
19
|
+
nn.BatchNorm2d(64),
|
|
20
|
+
nn.ReLU(),
|
|
21
|
+
nn.Dropout(0.2),
|
|
22
|
+
nn.MaxPool2d(2, 2)
|
|
23
|
+
)
|
|
24
|
+
self.decoder = nn.Sequential(
|
|
25
|
+
nn.ConvTranspose2d(64, 32, 3, stride=2, padding=1, output_padding=1),
|
|
26
|
+
nn.ReLU(),
|
|
27
|
+
nn.ConvTranspose2d(32, 16, 3, stride=2, padding=1, output_padding=1),
|
|
28
|
+
nn.ReLU(),
|
|
29
|
+
nn.ConvTranspose2d(16, 4, 3, stride=2, padding=1, output_padding=1),
|
|
30
|
+
nn.Sigmoid()
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
def forward(self, x):
|
|
34
|
+
en = self.encoder(x)
|
|
35
|
+
de = self.decoder(en)
|
|
36
|
+
return en, de
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from sklearn.metrics import auc, brier_score_loss, cohen_kappa_score, confusion_matrix, f1_score, roc_curve, roc_auc_score, precision_recall_curve, average_precision_score
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def calculate_pred_metric(label, pred):
|
|
5
|
+
# label: ground truth
|
|
6
|
+
# pred: prediction
|
|
7
|
+
|
|
8
|
+
# calculate ROC AUC
|
|
9
|
+
roc_auc = roc_auc_score(label, pred)
|
|
10
|
+
|
|
11
|
+
# confusion matrix
|
|
12
|
+
tn, fp, fn, tp = confusion_matrix(label, pred).ravel()
|
|
13
|
+
|
|
14
|
+
# other metric
|
|
15
|
+
accuracy = (tp + tn) / (tp + fp + fn + tn)
|
|
16
|
+
precision = tp / (tp + fp) if (tp + fp) > 0 else 0
|
|
17
|
+
recall = tp / (tp + fn) if (tp + fn) > 0 else 0
|
|
18
|
+
sensitivity = recall
|
|
19
|
+
specificity = tn / (tn + fp)
|
|
20
|
+
ppv = precision
|
|
21
|
+
npv = tn / (tn + fn) if (tn + fn) > 0 else 0
|
|
22
|
+
f1 = f1_score(label, pred)
|
|
23
|
+
kappa = cohen_kappa_score(label, pred)
|
|
24
|
+
brier = brier_score_loss(label, pred)
|
|
25
|
+
|
|
26
|
+
# calculate PR curve and its AUC
|
|
27
|
+
precision_vals, recall_vals, _ = precision_recall_curve(label, pred)
|
|
28
|
+
avg_pr_auc = auc(recall_vals, precision_vals)
|
|
29
|
+
|
|
30
|
+
# store the result into dictionary
|
|
31
|
+
res = {
|
|
32
|
+
'AUROC': roc_auc,
|
|
33
|
+
'AUPRC': avg_pr_auc,
|
|
34
|
+
'Accuracy': accuracy,
|
|
35
|
+
'Precision': precision,
|
|
36
|
+
'Recall': recall,
|
|
37
|
+
'Sensitivity': sensitivity,
|
|
38
|
+
'Specificity': specificity,
|
|
39
|
+
'PPV': ppv,
|
|
40
|
+
'NPV': npv,
|
|
41
|
+
'F1_Score': f1,
|
|
42
|
+
'Kappa': kappa,
|
|
43
|
+
'Brier_Score': brier
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return res
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from torch import nn
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class MLP(nn.Module):
|
|
5
|
+
def __init__(self):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.mlp = nn.Sequential(
|
|
8
|
+
nn.Linear(64 * 28 * 28, 64),
|
|
9
|
+
nn.ReLU(),
|
|
10
|
+
nn.Linear(64, 2),
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
def forward(self, x):
|
|
14
|
+
flatt = x.view(x.size(0), -1)
|
|
15
|
+
res = self.mlp(flatt)
|
|
16
|
+
return res
|