scrise 1.2.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.
- scrise-1.2.0/PKG-INFO +100 -0
- scrise-1.2.0/README.md +77 -0
- scrise-1.2.0/pyproject.toml +92 -0
- scrise-1.2.0/pyproject.toml.orig +86 -0
- scrise-1.2.0/scrise/__init__.py +36 -0
- scrise-1.2.0/scrise/annotation_alignment.py +652 -0
- scrise-1.2.0/scrise/factorization.py +613 -0
- scrise-1.2.0/scrise/opq.py +237 -0
- scrise-1.2.0/scrise/plotting/__init__.py +57 -0
- scrise-1.2.0/scrise/plotting/annotation_alignment.py +231 -0
- scrise-1.2.0/scrise/plotting/factors.py +213 -0
- scrise-1.2.0/scrise/plotting/general.py +279 -0
- scrise-1.2.0/scrise/plotting/pacmap.py +236 -0
- scrise-1.2.0/scrise/plotting/rank_selection.py +39 -0
- scrise-1.2.0/scrise/plotting/stability.py +171 -0
- scrise-1.2.0/scrise/rank_selection.py +274 -0
- scrise-1.2.0/scrise/tests/__init__.py +0 -0
- scrise-1.2.0/scrise/tests/test_annotation_alignment.py +245 -0
- scrise-1.2.0/scrise/tests/test_component_ordering.py +161 -0
- scrise-1.2.0/scrise/tests/test_factors.py +133 -0
- scrise-1.2.0/scrise/tests/test_parafac2.py +40 -0
- scrise-1.2.0/scrise/tests/test_rank_selection.py +88 -0
scrise-1.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: scrise
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: Single cell analysis across conditions using PARAFAC2.
|
|
5
|
+
Author: Andrew Ramirez, Aaron Meyer
|
|
6
|
+
Author-email: Aaron Meyer <git@asmlab.org>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Requires-Dist: numpy>=2.2
|
|
9
|
+
Requires-Dist: scipy>=1.16
|
|
10
|
+
Requires-Dist: scikit-learn>=1.6
|
|
11
|
+
Requires-Dist: pandas>=3.0.0
|
|
12
|
+
Requires-Dist: pyarrow>=19.0
|
|
13
|
+
Requires-Dist: tensorly>=0.9.0
|
|
14
|
+
Requires-Dist: parafac2>=1.6.0
|
|
15
|
+
Requires-Dist: anndata>=0.13
|
|
16
|
+
Requires-Dist: pacmap>=0.9
|
|
17
|
+
Requires-Dist: tqdm>=4.66.1
|
|
18
|
+
Requires-Dist: vcsc
|
|
19
|
+
Requires-Dist: parafac2[gpu] ; extra == 'gpu'
|
|
20
|
+
Requires-Python: >=3.13
|
|
21
|
+
Provides-Extra: gpu
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# RISE - Reduction and Insight in Single-cell Exploration
|
|
25
|
+
|
|
26
|
+
RISE (Reduction and Insight in Single-cell Exploration) is an unsupervised, tensor-based computational method designed for the integrative analysis of single-cell RNA sequencing (scRNA-seq) data across multiple experimental conditions, such as drug treatments, patient cohorts, or time points. Built upon the PARAFAC2 tensor decomposition framework, RISE preserves the inherent three-dimensional structure of multi-condition single-cell data—conditions × cells × genes—instead of flattening it into a conventional two-dimensional matrix. This allows RISE to decompose variation into distinct, interpretable patterns associated with experimental conditions, individual cells, and genes, providing a more nuanced and biologically meaningful analysis.
|
|
27
|
+
|
|
28
|
+
RISE does not require prior cell-type labels or clustering, reducing bias and enabling discovery of novel cell states, while also separating technical, biological, and condition-driven variation without batch correction that may erase meaningful signals. Its high resolution enables the identification of cell populations and condition-specific subpopulations missed by pseudobulk or clustering-based approaches, and each resulting component is directly linked to specific conditions, genes, and cells, making the results biologically tractable.
|
|
29
|
+
|
|
30
|
+
- **Read the documentation** at [RISE Documentation](https://meyer-lab.github.io/RISE/).
|
|
31
|
+
- RISE uses the [AnnData](https://anndata.readthedocs.io/) format for handling single-cell data matrices.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
> **Note:** The `RISE` package was renamed to `scrise` on PyPI (the import name changed from `RISE` to `scrise`). The GitHub repository name is unchanged. If you have `RISE` pinned in a `requirements.txt` or install script, update it to `scrise` as shown below.
|
|
36
|
+
|
|
37
|
+
To add `scrise` to your Python environment, install it from PyPI:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install scrise
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
For GPU acceleration support (propagated to `parafac2[gpu]`):
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install "scrise[gpu]"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or add the following line to your `requirements.txt`:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
scrise
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
or with GPU support:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
scrise[gpu]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## Quick Start
|
|
63
|
+
|
|
64
|
+
RISE works with preprocessed AnnData objects containing single-cell RNA-seq data:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from scrise.factorization import pf2
|
|
68
|
+
|
|
69
|
+
# Perform PARAFAC2 tensor decomposition
|
|
70
|
+
X = pf2(X=adata, rank=20, doEmbedding=True, random_state=42)
|
|
71
|
+
|
|
72
|
+
# Results are stored in the AnnData object:
|
|
73
|
+
# - X.uns["Pf2_weights"]: Component weights
|
|
74
|
+
# - X.uns["Pf2_A"]: Condition factors
|
|
75
|
+
# - X.uns["Pf2_B"]: Eigen-state factors
|
|
76
|
+
# - X.varm["Pf2_C"]: Gene factors
|
|
77
|
+
# - X.obsm["projections"]: Cell projections
|
|
78
|
+
# - X.obsm["weighted_projections"]: Weighted cell projections
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
See the [tutorial](https://meyer-lab.github.io/RISE/tutorial.html) for a complete workflow including preprocessing, rank selection, visualization, and interpretation.
|
|
82
|
+
|
|
83
|
+
## Key Features
|
|
84
|
+
|
|
85
|
+
- **Tensor-based decomposition**: Preserves the 3D structure of multi-condition scRNA-seq data
|
|
86
|
+
- **Unsupervised analysis**: No prior cell-type labels or clustering required
|
|
87
|
+
- **High resolution**: Identifies cell populations and condition-specific subpopulations
|
|
88
|
+
- **Interpretable results**: Components directly linked to conditions, cells, and genes
|
|
89
|
+
- **Integrated workflow**: Built-in preprocessing, visualization, and interpretation tools
|
|
90
|
+
- **Principled rank selection**: Bi-cross-validation (`scrise.rank_selection`) for choosing the number of components by evaluating a set of candidate ranks
|
|
91
|
+
|
|
92
|
+
## Citation
|
|
93
|
+
|
|
94
|
+
If you use RISE in your work, please cite the RISE publication as follows:
|
|
95
|
+
|
|
96
|
+
**Integrative, high-resolution analysis of single-cell gene expression across experimental conditions with PARAFAC2-RISE**
|
|
97
|
+
|
|
98
|
+
Andrew Ramirez, [...], Aaron Meyer
|
|
99
|
+
|
|
100
|
+
*Cell Systems*, 2025. DOI: [10.1016/j.cels.2025.101294](https://doi.org/10.1016/j.cels.2025.101294)
|
scrise-1.2.0/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# RISE - Reduction and Insight in Single-cell Exploration
|
|
2
|
+
|
|
3
|
+
RISE (Reduction and Insight in Single-cell Exploration) is an unsupervised, tensor-based computational method designed for the integrative analysis of single-cell RNA sequencing (scRNA-seq) data across multiple experimental conditions, such as drug treatments, patient cohorts, or time points. Built upon the PARAFAC2 tensor decomposition framework, RISE preserves the inherent three-dimensional structure of multi-condition single-cell data—conditions × cells × genes—instead of flattening it into a conventional two-dimensional matrix. This allows RISE to decompose variation into distinct, interpretable patterns associated with experimental conditions, individual cells, and genes, providing a more nuanced and biologically meaningful analysis.
|
|
4
|
+
|
|
5
|
+
RISE does not require prior cell-type labels or clustering, reducing bias and enabling discovery of novel cell states, while also separating technical, biological, and condition-driven variation without batch correction that may erase meaningful signals. Its high resolution enables the identification of cell populations and condition-specific subpopulations missed by pseudobulk or clustering-based approaches, and each resulting component is directly linked to specific conditions, genes, and cells, making the results biologically tractable.
|
|
6
|
+
|
|
7
|
+
- **Read the documentation** at [RISE Documentation](https://meyer-lab.github.io/RISE/).
|
|
8
|
+
- RISE uses the [AnnData](https://anndata.readthedocs.io/) format for handling single-cell data matrices.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
> **Note:** The `RISE` package was renamed to `scrise` on PyPI (the import name changed from `RISE` to `scrise`). The GitHub repository name is unchanged. If you have `RISE` pinned in a `requirements.txt` or install script, update it to `scrise` as shown below.
|
|
13
|
+
|
|
14
|
+
To add `scrise` to your Python environment, install it from PyPI:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install scrise
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
For GPU acceleration support (propagated to `parafac2[gpu]`):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install "scrise[gpu]"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or add the following line to your `requirements.txt`:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
scrise
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
or with GPU support:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
scrise[gpu]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
RISE works with preprocessed AnnData objects containing single-cell RNA-seq data:
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from scrise.factorization import pf2
|
|
45
|
+
|
|
46
|
+
# Perform PARAFAC2 tensor decomposition
|
|
47
|
+
X = pf2(X=adata, rank=20, doEmbedding=True, random_state=42)
|
|
48
|
+
|
|
49
|
+
# Results are stored in the AnnData object:
|
|
50
|
+
# - X.uns["Pf2_weights"]: Component weights
|
|
51
|
+
# - X.uns["Pf2_A"]: Condition factors
|
|
52
|
+
# - X.uns["Pf2_B"]: Eigen-state factors
|
|
53
|
+
# - X.varm["Pf2_C"]: Gene factors
|
|
54
|
+
# - X.obsm["projections"]: Cell projections
|
|
55
|
+
# - X.obsm["weighted_projections"]: Weighted cell projections
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
See the [tutorial](https://meyer-lab.github.io/RISE/tutorial.html) for a complete workflow including preprocessing, rank selection, visualization, and interpretation.
|
|
59
|
+
|
|
60
|
+
## Key Features
|
|
61
|
+
|
|
62
|
+
- **Tensor-based decomposition**: Preserves the 3D structure of multi-condition scRNA-seq data
|
|
63
|
+
- **Unsupervised analysis**: No prior cell-type labels or clustering required
|
|
64
|
+
- **High resolution**: Identifies cell populations and condition-specific subpopulations
|
|
65
|
+
- **Interpretable results**: Components directly linked to conditions, cells, and genes
|
|
66
|
+
- **Integrated workflow**: Built-in preprocessing, visualization, and interpretation tools
|
|
67
|
+
- **Principled rank selection**: Bi-cross-validation (`scrise.rank_selection`) for choosing the number of components by evaluating a set of candidate ranks
|
|
68
|
+
|
|
69
|
+
## Citation
|
|
70
|
+
|
|
71
|
+
If you use RISE in your work, please cite the RISE publication as follows:
|
|
72
|
+
|
|
73
|
+
**Integrative, high-resolution analysis of single-cell gene expression across experimental conditions with PARAFAC2-RISE**
|
|
74
|
+
|
|
75
|
+
Andrew Ramirez, [...], Aaron Meyer
|
|
76
|
+
|
|
77
|
+
*Cell Systems*, 2025. DOI: [10.1016/j.cels.2025.101294](https://doi.org/10.1016/j.cels.2025.101294)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "scrise"
|
|
3
|
+
version = "1.2.0"
|
|
4
|
+
description = "Single cell analysis across conditions using PARAFAC2."
|
|
5
|
+
license = "MIT"
|
|
6
|
+
requires-python = ">= 3.13"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"numpy>=2.2",
|
|
9
|
+
"scipy>=1.16",
|
|
10
|
+
"scikit-learn>=1.6",
|
|
11
|
+
"pandas>=3.0.0",
|
|
12
|
+
"pyarrow>=19.0",
|
|
13
|
+
"tensorly>=0.9.0",
|
|
14
|
+
"parafac2>=1.6.0",
|
|
15
|
+
"anndata>=0.13",
|
|
16
|
+
"pacmap>=0.9",
|
|
17
|
+
"tqdm>=4.66.1",
|
|
18
|
+
"vcsc",
|
|
19
|
+
]
|
|
20
|
+
readme = "README.md"
|
|
21
|
+
|
|
22
|
+
[[project.authors]]
|
|
23
|
+
name = "Andrew Ramirez"
|
|
24
|
+
|
|
25
|
+
[[project.authors]]
|
|
26
|
+
name = "Aaron Meyer"
|
|
27
|
+
email = "git@asmlab.org"
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
gpu = ["parafac2[gpu]"]
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
fbuild = "analysis.figures.common:genFigure"
|
|
34
|
+
|
|
35
|
+
[build-system]
|
|
36
|
+
requires = ["uv_build>=0.12.0,<0.13"]
|
|
37
|
+
build-backend = "uv_build"
|
|
38
|
+
|
|
39
|
+
[tool.uv.build-backend]
|
|
40
|
+
module-name = ["scrise"]
|
|
41
|
+
module-root = ""
|
|
42
|
+
|
|
43
|
+
[tool.uv.sources.vcsc]
|
|
44
|
+
git = "https://github.com/meyer-lab/anndata-VCSC.git"
|
|
45
|
+
|
|
46
|
+
[tool.ruff.lint]
|
|
47
|
+
select = [
|
|
48
|
+
"E",
|
|
49
|
+
"F",
|
|
50
|
+
"I",
|
|
51
|
+
"UP",
|
|
52
|
+
"B",
|
|
53
|
+
]
|
|
54
|
+
ignore = ["E501"]
|
|
55
|
+
|
|
56
|
+
[tool.pytest.ini_options]
|
|
57
|
+
filterwarnings = [
|
|
58
|
+
"ignore::anndata.OldFormatWarning",
|
|
59
|
+
"ignore::FutureWarning",
|
|
60
|
+
"ignore::UserWarning",
|
|
61
|
+
"ignore::DeprecationWarning",
|
|
62
|
+
"ignore::PendingDeprecationWarning:seaborn",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[dependency-groups]
|
|
66
|
+
analysis = [
|
|
67
|
+
"seaborn>=0.13.2",
|
|
68
|
+
"datashader>=0.19",
|
|
69
|
+
"scanpy>=1.12",
|
|
70
|
+
"tlviz>=0.1.1",
|
|
71
|
+
"doubletdetection>=4.3",
|
|
72
|
+
"statsmodels>=0.14.1",
|
|
73
|
+
"hdf5plugin>=7.0.0",
|
|
74
|
+
]
|
|
75
|
+
benchmarking = [
|
|
76
|
+
"scanorama>=1.7.4",
|
|
77
|
+
"harmonypy>=0.0.10",
|
|
78
|
+
"scib>=1.1.5",
|
|
79
|
+
]
|
|
80
|
+
docs = [
|
|
81
|
+
{ include-group = "analysis" },
|
|
82
|
+
"mkdocs>=1.6",
|
|
83
|
+
"mkdocs-material>=9.5",
|
|
84
|
+
"mkdocstrings[python]>=0.28",
|
|
85
|
+
]
|
|
86
|
+
dev = [
|
|
87
|
+
{ include-group = "analysis" },
|
|
88
|
+
"pytest>=9.0",
|
|
89
|
+
"pytest-cov>=7.0",
|
|
90
|
+
"ty",
|
|
91
|
+
"ruff>=0.16",
|
|
92
|
+
]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "scrise"
|
|
3
|
+
version = "1.2.0"
|
|
4
|
+
description = "Single cell analysis across conditions using PARAFAC2."
|
|
5
|
+
authors = [{name = "Andrew Ramirez"}, {name = "Aaron Meyer", email = "git@asmlab.org" }]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
requires-python = ">= 3.13"
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
"numpy>=2.2",
|
|
11
|
+
"scipy>=1.16",
|
|
12
|
+
"scikit-learn>=1.6",
|
|
13
|
+
"pandas>=3.0.0",
|
|
14
|
+
"pyarrow>=19.0",
|
|
15
|
+
"tensorly>=0.9.0",
|
|
16
|
+
"parafac2>=1.6.0",
|
|
17
|
+
"anndata>=0.13",
|
|
18
|
+
"pacmap>=0.9",
|
|
19
|
+
"tqdm>=4.66.1",
|
|
20
|
+
"vcsc",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
readme = "README.md"
|
|
24
|
+
|
|
25
|
+
[project.optional-dependencies]
|
|
26
|
+
gpu = [
|
|
27
|
+
"parafac2[gpu]",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
[project.scripts]
|
|
32
|
+
fbuild = "analysis.figures.common:genFigure"
|
|
33
|
+
|
|
34
|
+
[build-system]
|
|
35
|
+
requires = ["uv_build>=0.12.0,<0.13"]
|
|
36
|
+
build-backend = "uv_build"
|
|
37
|
+
|
|
38
|
+
[tool.uv.build-backend]
|
|
39
|
+
module-name = ["scrise"]
|
|
40
|
+
module-root = ""
|
|
41
|
+
|
|
42
|
+
[tool.uv.sources]
|
|
43
|
+
vcsc = { git = "https://github.com/meyer-lab/anndata-VCSC.git" }
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
[dependency-groups]
|
|
47
|
+
analysis = [
|
|
48
|
+
"seaborn>=0.13.2",
|
|
49
|
+
"datashader>=0.19",
|
|
50
|
+
"scanpy>=1.12",
|
|
51
|
+
"tlviz>=0.1.1",
|
|
52
|
+
"doubletdetection>=4.3",
|
|
53
|
+
"statsmodels>=0.14.1",
|
|
54
|
+
"hdf5plugin>=7.0.0",
|
|
55
|
+
]
|
|
56
|
+
benchmarking = [
|
|
57
|
+
"scanorama>=1.7.4",
|
|
58
|
+
"harmonypy>=0.0.10",
|
|
59
|
+
"scib>=1.1.5",
|
|
60
|
+
]
|
|
61
|
+
docs = [
|
|
62
|
+
{ include-group = "analysis" },
|
|
63
|
+
"mkdocs>=1.6",
|
|
64
|
+
"mkdocs-material>=9.5",
|
|
65
|
+
"mkdocstrings[python]>=0.28",
|
|
66
|
+
]
|
|
67
|
+
dev = [
|
|
68
|
+
{ include-group = "analysis" },
|
|
69
|
+
"pytest>=9.0",
|
|
70
|
+
"pytest-cov>=7.0",
|
|
71
|
+
"ty",
|
|
72
|
+
"ruff>=0.16",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
[tool.ruff.lint]
|
|
76
|
+
select = ["E", "F", "I", "UP", "B"]
|
|
77
|
+
ignore = ["E501"]
|
|
78
|
+
|
|
79
|
+
[tool.pytest.ini_options]
|
|
80
|
+
filterwarnings = [
|
|
81
|
+
"ignore::anndata.OldFormatWarning",
|
|
82
|
+
"ignore::FutureWarning",
|
|
83
|
+
"ignore::UserWarning",
|
|
84
|
+
"ignore::DeprecationWarning",
|
|
85
|
+
"ignore::PendingDeprecationWarning:seaborn",
|
|
86
|
+
]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from .annotation_alignment import (
|
|
2
|
+
CellTypeAlignmentResults,
|
|
3
|
+
ComponentAlignmentResult,
|
|
4
|
+
cell_type_alignment,
|
|
5
|
+
compute_tau,
|
|
6
|
+
score_cell_type_alignment,
|
|
7
|
+
)
|
|
8
|
+
from .factorization import (
|
|
9
|
+
canonical_component_signs,
|
|
10
|
+
correct_conditions,
|
|
11
|
+
export_factors,
|
|
12
|
+
load_factors,
|
|
13
|
+
match_components_across_ranks,
|
|
14
|
+
order_components_by_energy,
|
|
15
|
+
pf2,
|
|
16
|
+
rise_pca_r2x,
|
|
17
|
+
)
|
|
18
|
+
from .opq import OPQQuantizer, find_optimal_opq
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"CellTypeAlignmentResults",
|
|
22
|
+
"ComponentAlignmentResult",
|
|
23
|
+
"OPQQuantizer",
|
|
24
|
+
"canonical_component_signs",
|
|
25
|
+
"cell_type_alignment",
|
|
26
|
+
"compute_tau",
|
|
27
|
+
"correct_conditions",
|
|
28
|
+
"export_factors",
|
|
29
|
+
"find_optimal_opq",
|
|
30
|
+
"load_factors",
|
|
31
|
+
"match_components_across_ranks",
|
|
32
|
+
"order_components_by_energy",
|
|
33
|
+
"pf2",
|
|
34
|
+
"rise_pca_r2x",
|
|
35
|
+
"score_cell_type_alignment",
|
|
36
|
+
]
|