pyCoReGraph 0.0.1a1__py3-none-any.whl
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.
- coregraph/__init__.py +57 -0
- coregraph/analysis/__init__.py +45 -0
- coregraph/analysis/bins.py +23 -0
- coregraph/analysis/correlations.py +110 -0
- coregraph/analysis/fdr.py +100 -0
- coregraph/analysis/queries.py +118 -0
- coregraph/analysis/subset.py +64 -0
- coregraph/graphics/__init__.py +33 -0
- coregraph/graphics/animations.py +56 -0
- coregraph/graphics/colors.py +9 -0
- coregraph/graphics/network.py +214 -0
- coregraph/graphics/plots.py +85 -0
- coregraph/models/__init__.py +11 -0
- coregraph/models/coregraph.py +221 -0
- coregraph/models/cors.py +63 -0
- coregraph/models/graphics.py +38 -0
- coregraph/models/stargraph.py +41 -0
- coregraph/utils/__init__.py +23 -0
- coregraph/utils/decorators.py +39 -0
- coregraph/utils/formatting.py +16 -0
- coregraph/utils/validation.py +25 -0
- pycoregraph-0.0.1a1.dist-info/METADATA +65 -0
- pycoregraph-0.0.1a1.dist-info/RECORD +26 -0
- pycoregraph-0.0.1a1.dist-info/WHEEL +5 -0
- pycoregraph-0.0.1a1.dist-info/licenses/LICENSE +21 -0
- pycoregraph-0.0.1a1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
## DECORATORS ##
|
|
2
|
+
|
|
3
|
+
from functools import wraps
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def requires_cors(func):
|
|
7
|
+
@wraps(func)
|
|
8
|
+
def wrapper(coregraph, *args, **kwargs):
|
|
9
|
+
if coregraph.cors.window is None:
|
|
10
|
+
raise RuntimeError(
|
|
11
|
+
"Correlations have not been calculated yet. "
|
|
12
|
+
"Run `calculate_all_cors()` first."
|
|
13
|
+
)
|
|
14
|
+
return func(coregraph, *args, **kwargs)
|
|
15
|
+
return wrapper
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def requires_bins(func):
|
|
19
|
+
@wraps(func)
|
|
20
|
+
def wrapper(coregraph, *args, **kwargs):
|
|
21
|
+
if coregraph.graphics.n_bins is None:
|
|
22
|
+
raise RuntimeError(
|
|
23
|
+
"Bins have not been discretized yet. "
|
|
24
|
+
"Run `calculate_bins()` first."
|
|
25
|
+
)
|
|
26
|
+
return func(coregraph, *args, **kwargs)
|
|
27
|
+
return wrapper
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def requires_FDR(func):
|
|
31
|
+
@wraps(func)
|
|
32
|
+
def wrapper(coregraph, *args, **kwargs):
|
|
33
|
+
if coregraph.cors.FDR is None:
|
|
34
|
+
raise RuntimeError(
|
|
35
|
+
"FDR has not been computed yet. "
|
|
36
|
+
"Run `calculate_FDR()` first."
|
|
37
|
+
)
|
|
38
|
+
return func(coregraph, *args, **kwargs)
|
|
39
|
+
return wrapper
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## FORMATTING ##
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def _set_numerical_format(dtype: str):
|
|
7
|
+
'''Assign correct numerical parametrs depending on dtype sepcified from user'''
|
|
8
|
+
if isinstance(dtype, str):
|
|
9
|
+
if dtype.lower() == 'float':
|
|
10
|
+
return [np.float64, np.array([1,15])]
|
|
11
|
+
elif dtype.lower() == 'int':
|
|
12
|
+
return [np.int64, np.array([1000,0])]
|
|
13
|
+
else:
|
|
14
|
+
raise ValueError("dtype must be 'int' or 'float'")
|
|
15
|
+
|
|
16
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## VALIDATION ##
|
|
2
|
+
|
|
3
|
+
import math
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def _solve_step(step, n_steps, window, n_cells):
|
|
7
|
+
if (step == None) and (n_steps == None):
|
|
8
|
+
return 1, n_cells-window+1
|
|
9
|
+
if (step != None) and (n_steps != None):
|
|
10
|
+
raise ValueError("Specify either 'step' or 'n_steps, not both.")
|
|
11
|
+
if (step != None):
|
|
12
|
+
if (step >= (n_cells - window)):
|
|
13
|
+
raise ValueError("'step' is too high for provided window")
|
|
14
|
+
else:
|
|
15
|
+
n_steps = (n_cells - window) // step + 1
|
|
16
|
+
return step, n_steps
|
|
17
|
+
if n_steps >= (n_cells - window):
|
|
18
|
+
raise ValueError("'n_steps' is too high for provided window")
|
|
19
|
+
else:
|
|
20
|
+
step = math.ceil((n_cells - window) / n_steps)
|
|
21
|
+
return step, n_steps
|
|
22
|
+
|
|
23
|
+
def _solve_total_dim3(step, window, n_cells):
|
|
24
|
+
max_dim = (n_cells - window) // step + 1
|
|
25
|
+
return max_dim * (max_dim + 1) //2
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyCoReGraph
|
|
3
|
+
Version: 0.0.1a1
|
|
4
|
+
Summary: CoReGraph : Correlation-based dynamic gene Regulatory Graphs
|
|
5
|
+
Author-email: Joseph Léger <josephleger@outlook.fr>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/JosephLeger/CoReGraph
|
|
8
|
+
Project-URL: Repository, https://github.com/JosephLeger/CoReGraph
|
|
9
|
+
Project-URL: Issues, https://github.com/JosephLeger/CoReGraph/issues
|
|
10
|
+
Keywords: bioinformatics,single-cell,gene-regulatory-network,pseudotime,correlation,network-analysis,visualization
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: numpy>=1.24
|
|
25
|
+
Requires-Dist: pandas>=2.0
|
|
26
|
+
Requires-Dist: matplotlib>=3.7
|
|
27
|
+
Requires-Dist: networkx>=3.0
|
|
28
|
+
Requires-Dist: scipy>=1.10
|
|
29
|
+
Requires-Dist: tqdm>=4.65
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
32
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
33
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
34
|
+
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
35
|
+
Requires-Dist: black>=24.0; extra == "dev"
|
|
36
|
+
Requires-Dist: ipykernel>=6.0; extra == "dev"
|
|
37
|
+
Provides-Extra: notebook
|
|
38
|
+
Requires-Dist: jupyter>=1.0; extra == "notebook"
|
|
39
|
+
Requires-Dist: ipython>=8.0; extra == "notebook"
|
|
40
|
+
Provides-Extra: all
|
|
41
|
+
Requires-Dist: pytest>=8.0; extra == "all"
|
|
42
|
+
Requires-Dist: build>=1.0; extra == "all"
|
|
43
|
+
Requires-Dist: twine>=5.0; extra == "all"
|
|
44
|
+
Requires-Dist: ruff>=0.4; extra == "all"
|
|
45
|
+
Requires-Dist: black>=24.0; extra == "all"
|
|
46
|
+
Requires-Dist: ipykernel>=6.0; extra == "all"
|
|
47
|
+
Requires-Dist: jupyter>=1.0; extra == "all"
|
|
48
|
+
Requires-Dist: ipython>=8.0; extra == "all"
|
|
49
|
+
Dynamic: license-file
|
|
50
|
+
|
|
51
|
+
# CoReGraph : **Co**rrelation-based dynamic gene **Re**gulatory **Graph**s
|
|
52
|
+
|
|
53
|
+
A Python package for dynamic lagged gene correlation analysis along pseudotime trajectories.
|
|
54
|
+
|
|
55
|
+
## Requirments
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
python >= 3.10
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install coregraph
|
|
65
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
coregraph/__init__.py,sha256=SzuGoHBO0vM0kkQjO2dkcegJXFWWzJ3b-S2uFpttG7M,1070
|
|
2
|
+
coregraph/analysis/__init__.py,sha256=o0W0KYqTIZg8GD2EWr6ZpK8twqq3g8N2ww7u2cyYt7s,787
|
|
3
|
+
coregraph/analysis/bins.py,sha256=bQEGC2xYy1cKdDxfsLFae6Z6zlJM5uusLsRDmMk-Fb0,790
|
|
4
|
+
coregraph/analysis/correlations.py,sha256=7n4aZ0LbUXunqtTYUdEpGJ1EfL62whwMcJ53jamFJYE,4506
|
|
5
|
+
coregraph/analysis/fdr.py,sha256=RmI2jqlDfZrTyeK2k2IiOiAIIZGHzmFJ9XilaIdeFZU,3820
|
|
6
|
+
coregraph/analysis/queries.py,sha256=mjzy6HXp7Dqe_dz19eRW609O6WLLZbVVObRIC-fJMUI,3641
|
|
7
|
+
coregraph/analysis/subset.py,sha256=QXIX5EldiIPQrz_EHN3SYT4SrrFIwSiiGzSCtzkuWks,2313
|
|
8
|
+
coregraph/graphics/__init__.py,sha256=HDGSQXTEkdzJrXv7YuA3VJaPxUW4Cbis1bvi3n_d17g,436
|
|
9
|
+
coregraph/graphics/animations.py,sha256=dyB9yzmIaQFxoJrV_RgC1ENRIEOsCSJ7mLuu-JTOcB4,2180
|
|
10
|
+
coregraph/graphics/colors.py,sha256=H79l9Wy1OBLc_zw2j1lxJ8LWEeNOxMbNhEyyI-MOGb0,474
|
|
11
|
+
coregraph/graphics/network.py,sha256=g2B0vonB-TqLqIpHPa3Lqi4iubbrVbl1Mg7FPVWzjPI,6083
|
|
12
|
+
coregraph/graphics/plots.py,sha256=eTCrSTDu1ImIKzkMd1j3NrKsNtXPMnbEHK3vsGgb-mk,3111
|
|
13
|
+
coregraph/models/__init__.py,sha256=x9tzA6LJ7Iz8MP-xZsmBrSNLcykHcyI-HXVVzqHghz4,246
|
|
14
|
+
coregraph/models/coregraph.py,sha256=dSsVf-kEls-RaXBsN8FJ977qFCpOMUTPVRGdq1dyo-M,8817
|
|
15
|
+
coregraph/models/cors.py,sha256=J0CYYbqPCoua6TF_IVJFXZBjfKEHNE2DUg01xtbm5Wo,1983
|
|
16
|
+
coregraph/models/graphics.py,sha256=USdExX5w-eBIu67Y48WPTB4bL1cYl8PgCq0pKMSRq0U,844
|
|
17
|
+
coregraph/models/stargraph.py,sha256=W69BgIwbvzOFAhtaxCemy7hFUOLtXp4jZ5rlIhdxzIs,1258
|
|
18
|
+
coregraph/utils/__init__.py,sha256=V6q1VN3P--1vJV2z_abiyOI4fUfOY4raE3fkVb2Mu3k,380
|
|
19
|
+
coregraph/utils/decorators.py,sha256=p-M9POAqeEQYrGs-EDj-jz0mQPsXK1BaC8ayvnWRdSs,1129
|
|
20
|
+
coregraph/utils/formatting.py,sha256=WA1E0N9w7QxR_elh0dVTIBuIBqpss7ERUE0xoIoG9WE,508
|
|
21
|
+
coregraph/utils/validation.py,sha256=h3S-oXeulsbbh4HPJS33hA1eX_SBkdCeS-cLbx7MNH8,870
|
|
22
|
+
pycoregraph-0.0.1a1.dist-info/licenses/LICENSE,sha256=pJCrZwHnShCXTiMCrr9x9K0YntP8duL21c-WhUpAVQA,1068
|
|
23
|
+
pycoregraph-0.0.1a1.dist-info/METADATA,sha256=4lCV8s50kF4r84HBRNQZrGk6--vVX9_K02T-I03RxA8,2384
|
|
24
|
+
pycoregraph-0.0.1a1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
25
|
+
pycoregraph-0.0.1a1.dist-info/top_level.txt,sha256=f5n-iVpzU4mX6tmszRB3ZbEs-q3iPaaITA1nz05BR3A,10
|
|
26
|
+
pycoregraph-0.0.1a1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 JosephLeger
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
coregraph
|