cellSP 2.2__tar.gz → 2.2.3__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.
- {cellsp-2.2 → cellsp-2.2.3}/PKG-INFO +11 -5
- {cellsp-2.2 → cellsp-2.2.3}/README.md +10 -4
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/characterize/_instant.py +2 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/characterize/_sprawl.py +1 -1
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/datasets/_datasets.py +32 -30
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/visualisation/_compare.py +1 -1
- {cellsp-2.2 → cellsp-2.2.3}/cellSP.egg-info/PKG-INFO +11 -5
- {cellsp-2.2 → cellsp-2.2.3}/pyproject.toml +2 -2
- {cellsp-2.2 → cellsp-2.2.3}/LICENSE +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/__init__.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/characterize/__init__.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/characterize/_bicluster.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/characterize/_utils.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/datasets/__init__.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/geo/__init__.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/geo/_geo.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/io/__init__.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/io/_io.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/model/__init__.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/model/_model.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/preprocessing/__init__.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/preprocessing/_extrapolate.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/preprocessing/_impute.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/visualisation/__init__.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/visualisation/_circularize.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/visualisation/_enrichment.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/visualisation/_raw.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/visualisation/_report.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP/visualisation/_validation.py +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP.egg-info/SOURCES.txt +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP.egg-info/dependency_links.txt +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP.egg-info/requires.txt +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/cellSP.egg-info/top_level.txt +0 -0
- {cellsp-2.2 → cellsp-2.2.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cellSP
|
|
3
|
-
Version: 2.2
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: cellSP.
|
|
5
5
|
Author-email: Bhavay Aggarwal <baggarwal9@gatech.edu>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -38,6 +38,10 @@ Requires-Dist: umap-learn>=0.5.7
|
|
|
38
38
|
Dynamic: license-file
|
|
39
39
|
|
|
40
40
|
# CellSP
|
|
41
|
+
[](https://pypi.org/project/cellSP/)
|
|
42
|
+
[](LICENSE)
|
|
43
|
+
[](https://github.com/bhavaygg/cellSP#readme)
|
|
44
|
+
[](https://pepy.tech/project/cellSP)
|
|
41
45
|
|
|
42
46
|
CellSP is a python package for the analysis of subcellular spatial transcriptomic data. CellSP works with datasets generated at single-modulecule resolution from technologies like Xenium, CosMx, MERSCOPE or other ISH-like data. Using existing tools [InSTAnT](https://github.com/bhavaygg/InSTAnT) and [SPRAWL](https://github.com/salzman-lab/SPRAWL/), CellSP identifies statistically signficant subcellular patterns of gene transcripts and uses a biclustering algorithm to aggregate these patterns over hundereds of cells to produce "gene-cell modules". These modules represent the consistent detection of the same subcellular pattern by a set of genes in the same cells and offer a summarized and biologically interpretable desciption of subcellular patterns. CellSP provides specialized techniques for visualizing such modules and their defining spatial patterns. Additionally, CellSP utilize Gene Ontology (GO) enrichments tests to offer functionsal insights into the genes comprising the module as CellSPll as the cells comprising the module.
|
|
43
47
|
|
|
@@ -165,11 +169,13 @@ InSTAnT identifies colocalized gene pairs based on their spatial proximity. A pr
|
|
|
165
169
|
|
|
166
170
|
```
|
|
167
171
|
@article{aggarwal2025cellsp,
|
|
168
|
-
title={CellSP
|
|
172
|
+
title={CellSP enables module discovery and visualization for subcellular spatial transcriptomics data},
|
|
169
173
|
author={Aggarwal, Bhavay and Sinha, Saurabh},
|
|
170
|
-
journal={
|
|
171
|
-
|
|
174
|
+
journal={Communications Biology},
|
|
175
|
+
volume={8},
|
|
176
|
+
number={1},
|
|
177
|
+
pages={1528},
|
|
172
178
|
year={2025},
|
|
173
|
-
publisher={
|
|
179
|
+
publisher={Nature Publishing Group UK London}
|
|
174
180
|
}
|
|
175
181
|
```
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# CellSP
|
|
2
|
+
[](https://pypi.org/project/cellSP/)
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://github.com/bhavaygg/cellSP#readme)
|
|
5
|
+
[](https://pepy.tech/project/cellSP)
|
|
2
6
|
|
|
3
7
|
CellSP is a python package for the analysis of subcellular spatial transcriptomic data. CellSP works with datasets generated at single-modulecule resolution from technologies like Xenium, CosMx, MERSCOPE or other ISH-like data. Using existing tools [InSTAnT](https://github.com/bhavaygg/InSTAnT) and [SPRAWL](https://github.com/salzman-lab/SPRAWL/), CellSP identifies statistically signficant subcellular patterns of gene transcripts and uses a biclustering algorithm to aggregate these patterns over hundereds of cells to produce "gene-cell modules". These modules represent the consistent detection of the same subcellular pattern by a set of genes in the same cells and offer a summarized and biologically interpretable desciption of subcellular patterns. CellSP provides specialized techniques for visualizing such modules and their defining spatial patterns. Additionally, CellSP utilize Gene Ontology (GO) enrichments tests to offer functionsal insights into the genes comprising the module as CellSPll as the cells comprising the module.
|
|
4
8
|
|
|
@@ -126,11 +130,13 @@ InSTAnT identifies colocalized gene pairs based on their spatial proximity. A pr
|
|
|
126
130
|
|
|
127
131
|
```
|
|
128
132
|
@article{aggarwal2025cellsp,
|
|
129
|
-
title={CellSP
|
|
133
|
+
title={CellSP enables module discovery and visualization for subcellular spatial transcriptomics data},
|
|
130
134
|
author={Aggarwal, Bhavay and Sinha, Saurabh},
|
|
131
|
-
journal={
|
|
132
|
-
|
|
135
|
+
journal={Communications Biology},
|
|
136
|
+
volume={8},
|
|
137
|
+
number={1},
|
|
138
|
+
pages={1528},
|
|
133
139
|
year={2025},
|
|
134
|
-
publisher={
|
|
140
|
+
publisher={Nature Publishing Group UK London}
|
|
135
141
|
}
|
|
136
142
|
```
|
|
@@ -49,6 +49,8 @@ def run_instant(adata_st, distance_threshold, threads, n_vertices = None, alpha_
|
|
|
49
49
|
obj.run_ProximalPairs3D_slice(distance_threshold = distance_threshold, min_genecount = 20)
|
|
50
50
|
else:
|
|
51
51
|
df_temp = adata_st.uns["transcripts"].copy()
|
|
52
|
+
if 'absZ_raw' not in adata_st.uns["transcripts"].columns:
|
|
53
|
+
adata_st.uns["transcripts"]['absZ_raw'] = adata_st.uns["transcripts"]['absZ'].copy()
|
|
52
54
|
adata_st.uns["transcripts"]['absZ'] = adata_st.uns["transcripts"]['absZ_raw']
|
|
53
55
|
obj.run_ProximalPairs3D(distance_threshold = distance_threshold, min_genecount = 20)
|
|
54
56
|
adata_st.uns['transcripts'] = df_temp
|
|
@@ -122,7 +122,7 @@ def run_sprawl(adata_st, methods = ['Peripheral', 'Radial', 'Punctate', 'Central
|
|
|
122
122
|
cell_dict['boundaries'][0], cell_dict['spot_coords'][0], cell_dict['spot_genes'][0] = vertices, spot_coords, spot_genes
|
|
123
123
|
cell_dict['zslices'].append(0)
|
|
124
124
|
cell_dict['gene_counts'] = cell.gene.value_counts().to_dict()
|
|
125
|
-
cell_dict['n'] +=
|
|
125
|
+
cell_dict['n'] += cell[['absX', 'absY']].values.shape[0]
|
|
126
126
|
if "gene_counts" in cell_dict:
|
|
127
127
|
cell_dict['genes'] = np.unique(list(cell_dict['gene_counts'].keys()))
|
|
128
128
|
if len(cell_dict["zslices"]) > 0 and min(cell_dict['gene_counts'].values()) >= 2:
|
|
@@ -90,34 +90,36 @@ def st_to_anndata(transcripts, cell_type = None, cell_boundary = None):
|
|
|
90
90
|
'''
|
|
91
91
|
if Path(transcripts).suffix.lower() == ".csv":
|
|
92
92
|
df = pd.read_csv(transcripts)
|
|
93
|
-
|
|
94
|
-
df.
|
|
95
|
-
df_st = pd.crosstab(df.uID, df.gene)
|
|
96
|
-
df_st.columns.name = None
|
|
97
|
-
df_st.index = df_st.index.astype(str)
|
|
98
|
-
if 'absZ' in df.columns:
|
|
99
|
-
result = pd.pivot_table(df, values=['absX', 'absY', 'absZ'], index=['uID'])
|
|
100
|
-
else:
|
|
101
|
-
result = pd.pivot_table(df, values=['absX', 'absY'], index=['uID'])
|
|
102
|
-
result.index = result.index.astype(str)
|
|
103
|
-
adata = ad.AnnData(X=df_st)
|
|
104
|
-
adata.obs_names = df_st.index
|
|
105
|
-
adata.obs.index = df_st.index
|
|
106
|
-
adata.var_names = df_st.columns
|
|
107
|
-
adata.obsm['spatial'] = result
|
|
108
|
-
adata.uns["transcripts"] = df
|
|
109
|
-
if cell_type != None:
|
|
110
|
-
df_ct = pd.read_csv(cell_type, index_col = 0)
|
|
111
|
-
df_ct.index = df_ct.index.astype(str)
|
|
112
|
-
adata.obs['cell_type'] = df_ct
|
|
113
|
-
if cell_boundary != None:
|
|
114
|
-
if Path(cell_boundary).suffix.lower() == ".csv":
|
|
115
|
-
df_cb = pd.read_csv(cell_boundary)
|
|
116
|
-
else:
|
|
117
|
-
raise ValueError("Incorrect file format. Only .csv files are supported.")
|
|
118
|
-
df_cb = df_cb.set_index('uID')
|
|
119
|
-
df_cb.index = df_cb.index.astype(str)
|
|
120
|
-
adata.uns['cell_boundary'] = df_cb
|
|
121
|
-
return adata
|
|
93
|
+
elif Path(transcripts).suffix.lower() == ".parquet":
|
|
94
|
+
df = pd.read_parquet(transcripts)
|
|
122
95
|
else:
|
|
123
|
-
raise ValueError("Incorrect file format. Only .csv files are supported.")
|
|
96
|
+
raise ValueError("Incorrect file format. Only .csv/.parquet files are supported.")
|
|
97
|
+
df = df[~df['gene'].str.startswith('Blank')]
|
|
98
|
+
df.sort_values(by=['uID', 'gene'], inplace=True)
|
|
99
|
+
df_st = pd.crosstab(df.uID, df.gene)
|
|
100
|
+
df_st.columns.name = None
|
|
101
|
+
df_st.index = df_st.index.astype(str)
|
|
102
|
+
if 'absZ' in df.columns:
|
|
103
|
+
result = pd.pivot_table(df, values=['absX', 'absY', 'absZ'], index=['uID'])
|
|
104
|
+
else:
|
|
105
|
+
result = pd.pivot_table(df, values=['absX', 'absY'], index=['uID'])
|
|
106
|
+
result.index = result.index.astype(str)
|
|
107
|
+
adata = ad.AnnData(X=df_st)
|
|
108
|
+
adata.obs_names = df_st.index
|
|
109
|
+
adata.obs.index = df_st.index
|
|
110
|
+
adata.var_names = df_st.columns
|
|
111
|
+
adata.obsm['spatial'] = result
|
|
112
|
+
adata.uns["transcripts"] = df
|
|
113
|
+
if cell_type != None:
|
|
114
|
+
df_ct = pd.read_csv(cell_type, index_col = 0)
|
|
115
|
+
df_ct.index = df_ct.index.astype(str)
|
|
116
|
+
adata.obs['cell_type'] = df_ct
|
|
117
|
+
if cell_boundary != None:
|
|
118
|
+
if Path(cell_boundary).suffix.lower() == ".csv":
|
|
119
|
+
df_cb = pd.read_csv(cell_boundary)
|
|
120
|
+
else:
|
|
121
|
+
raise ValueError("Incorrect file format. Only .csv files are supported.")
|
|
122
|
+
df_cb = df_cb.set_index('uID')
|
|
123
|
+
df_cb.index = df_cb.index.astype(str)
|
|
124
|
+
adata.uns['cell_boundary'] = df_cb
|
|
125
|
+
return adata
|
|
@@ -30,7 +30,7 @@ def apply_ztest_neg_score(c1, c2, n1, n2):
|
|
|
30
30
|
alternative='smaller'
|
|
31
31
|
)[0]
|
|
32
32
|
|
|
33
|
-
def do_proportion_test(adata_st_control, adata_st_condition
|
|
33
|
+
def do_proportion_test(adata_st_control, adata_st_condition):
|
|
34
34
|
'''
|
|
35
35
|
Plot the cells in the spatial transcriptomic data.
|
|
36
36
|
Arguments
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cellSP
|
|
3
|
-
Version: 2.2
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: cellSP.
|
|
5
5
|
Author-email: Bhavay Aggarwal <baggarwal9@gatech.edu>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -38,6 +38,10 @@ Requires-Dist: umap-learn>=0.5.7
|
|
|
38
38
|
Dynamic: license-file
|
|
39
39
|
|
|
40
40
|
# CellSP
|
|
41
|
+
[](https://pypi.org/project/cellSP/)
|
|
42
|
+
[](LICENSE)
|
|
43
|
+
[](https://github.com/bhavaygg/cellSP#readme)
|
|
44
|
+
[](https://pepy.tech/project/cellSP)
|
|
41
45
|
|
|
42
46
|
CellSP is a python package for the analysis of subcellular spatial transcriptomic data. CellSP works with datasets generated at single-modulecule resolution from technologies like Xenium, CosMx, MERSCOPE or other ISH-like data. Using existing tools [InSTAnT](https://github.com/bhavaygg/InSTAnT) and [SPRAWL](https://github.com/salzman-lab/SPRAWL/), CellSP identifies statistically signficant subcellular patterns of gene transcripts and uses a biclustering algorithm to aggregate these patterns over hundereds of cells to produce "gene-cell modules". These modules represent the consistent detection of the same subcellular pattern by a set of genes in the same cells and offer a summarized and biologically interpretable desciption of subcellular patterns. CellSP provides specialized techniques for visualizing such modules and their defining spatial patterns. Additionally, CellSP utilize Gene Ontology (GO) enrichments tests to offer functionsal insights into the genes comprising the module as CellSPll as the cells comprising the module.
|
|
43
47
|
|
|
@@ -165,11 +169,13 @@ InSTAnT identifies colocalized gene pairs based on their spatial proximity. A pr
|
|
|
165
169
|
|
|
166
170
|
```
|
|
167
171
|
@article{aggarwal2025cellsp,
|
|
168
|
-
title={CellSP
|
|
172
|
+
title={CellSP enables module discovery and visualization for subcellular spatial transcriptomics data},
|
|
169
173
|
author={Aggarwal, Bhavay and Sinha, Saurabh},
|
|
170
|
-
journal={
|
|
171
|
-
|
|
174
|
+
journal={Communications Biology},
|
|
175
|
+
volume={8},
|
|
176
|
+
number={1},
|
|
177
|
+
pages={1528},
|
|
172
178
|
year={2025},
|
|
173
|
-
publisher={
|
|
179
|
+
publisher={Nature Publishing Group UK London}
|
|
174
180
|
}
|
|
175
181
|
```
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[metadata]
|
|
6
6
|
name = "cellSP"
|
|
7
|
-
version = "2.2"
|
|
7
|
+
version = "2.2.3"
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
[tool.setuptools.packages]
|
|
@@ -12,7 +12,7 @@ find = {} # Scan the project directory with the default parameters
|
|
|
12
12
|
|
|
13
13
|
[project]
|
|
14
14
|
name = "cellSP"
|
|
15
|
-
version = "2.2"
|
|
15
|
+
version = "2.2.3"
|
|
16
16
|
authors = [
|
|
17
17
|
{ name="Bhavay Aggarwal", email="baggarwal9@gatech.edu" },
|
|
18
18
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|