Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Daniel's developmental branch #223

Closed
wants to merge 235 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
e2738cd
Starting to add to spatial regression core
dzhu8 Mar 9, 2023
feb182e
Moved generalized_lm and spatial_regression to temporary Deprecated f…
dzhu8 Mar 15, 2023
9a94133
Moved more regression files to Deprecated
dzhu8 Mar 23, 2023
a0af9eb
Add new databases, start building up new regression core
dzhu8 Mar 25, 2023
bfe2815
Add to distributions
dzhu8 Mar 27, 2023
be4fd8c
Add more to distributions, remove references to binomial
dzhu8 Mar 27, 2023
9530660
Edit distributions
dzhu8 Mar 28, 2023
b32ddc3
Adjust variable names in distributions
dzhu8 Mar 28, 2023
4298955
Update to distributions
dzhu8 Mar 28, 2023
de1b47c
Updates to regression
dzhu8 Mar 29, 2023
c67f728
Update iwls
dzhu8 Mar 30, 2023
b64122a
Code IWLS algorithm
dzhu8 Mar 31, 2023
90a11d0
Update to regression_utils
dzhu8 Mar 31, 2023
56f1b11
Start filling out the GWR class
dzhu8 Apr 1, 2023
a8bc661
Add preprocessing to new regression core
dzhu8 Apr 2, 2023
00940b8
Add main executable for spatial regression
dzhu8 Apr 2, 2023
f91398e
Add golden search for optimum bandwidth
dzhu8 Apr 3, 2023
6a33fb2
More updates to spatial regression
dzhu8 Apr 4, 2023
995d9bf
Update to regression model
dzhu8 Apr 5, 2023
4d3d7dc
Adjust diagnostics pipeline for non-Gaussian models
dzhu8 Apr 5, 2023
b2be944
Finished GWR core
dzhu8 Apr 6, 2023
81aff37
More updates to spatial reg
dzhu8 Apr 6, 2023
14a2097
Add main run file, other small updates
dzhu8 Apr 6, 2023
509edaa
Update STGWR
dzhu8 Apr 8, 2023
083bb55
Add GWRGRN, refactoring, add new databases
dzhu8 Apr 9, 2023
0398b59
Update GRN model
dzhu8 Apr 9, 2023
950fae1
Update GWR model
dzhu8 Apr 9, 2023
4f9bdc5
Add main run file
dzhu8 Apr 10, 2023
88119e9
Minor updates
dzhu8 Apr 10, 2023
ded84ac
Bug fixing
dzhu8 Apr 11, 2023
48a6a88
Finished main multiscale procedure
dzhu8 Apr 12, 2023
cb6e1a9
Small update to multiscale core
dzhu8 Apr 12, 2023
4d6989c
Updates to design matrix setup
dzhu8 Apr 14, 2023
b532cbe
Updates to multiscale modules
dzhu8 Apr 15, 2023
4ba7c6b
Multiscale update
dzhu8 Apr 16, 2023
c5ace26
Bug testing
dzhu8 Apr 17, 2023
42bf157
Added functionality for the case of cell-intrinsic modeling
dzhu8 Apr 18, 2023
c674304
Add subsampling functionality
dzhu8 Apr 20, 2023
853f220
Result of a lot of iteration
dzhu8 Apr 21, 2023
ca33c6f
Updates to multiscale- fit on linear predictor
dzhu8 Apr 21, 2023
0f350e0
Update
dzhu8 Apr 22, 2023
64fe40c
Updates
dzhu8 Apr 23, 2023
aa74646
Update to GLM multiscale
dzhu8 Apr 24, 2023
b21ff22
Small updates
dzhu8 Apr 24, 2023
0e99065
Removed Hessian for now
dzhu8 Apr 26, 2023
602531d
Small update
dzhu8 Apr 26, 2023
3d49955
Update to GRN model configuration
dzhu8 Apr 27, 2023
dae249a
Small updates
dzhu8 Apr 28, 2023
46f6083
Update to subsampling
dzhu8 Apr 30, 2023
2710e5a
Update GRN model
dzhu8 May 2, 2023
4d5835f
Preliminary GRN models do not work well- delete
dzhu8 May 3, 2023
004cbad
Bug fixes
dzhu8 May 5, 2023
fc2c875
Refactor modeling package
dzhu8 May 5, 2023
f23f601
Slight mods to utils
dzhu8 May 6, 2023
2b06c0f
Update to setup
dzhu8 May 8, 2023
0058701
Updates
dzhu8 May 10, 2023
c29be12
Bug fixes
dzhu8 May 10, 2023
47f1de8
Bug fixes
dzhu8 May 11, 2023
16a670c
Modified regularization and preprocessing
dzhu8 May 11, 2023
22f75c8
Guided upstream target/predictor selection
dzhu8 May 15, 2023
d4d08c1
Update X block setup
dzhu8 May 15, 2023
0ecfc7c
Add to upstream selection
dzhu8 May 16, 2023
7b5f1a9
Add to upstream selector class
dzhu8 May 17, 2023
88bc376
Preparing for hurdle implementation
dzhu8 May 18, 2023
e0340b4
Update hurdle model
dzhu8 May 18, 2023
0f5d38a
Added hurdle component + tweaking
dzhu8 May 19, 2023
07d12a4
Update subset
dzhu8 May 20, 2023
1368ada
Modified statistical testing
dzhu8 May 21, 2023
916b75c
Defined tools for arrow-drawing plots
dzhu8 May 22, 2023
0f8c842
Add plot functions for directional plots
dzhu8 May 22, 2023
e302875
Implement plotting for arrows
dzhu8 May 22, 2023
06cb51c
Fixed bug in significance testing
dzhu8 May 23, 2023
336d2e3
Tweaks to arrow plotting function
dzhu8 May 24, 2023
b6ec78f
Minor fix to arrow drawing
dzhu8 May 24, 2023
509e345
Effect directions- compatibility with sparse matrices
dzhu8 May 26, 2023
adfecf0
Slight design tweaks
dzhu8 May 28, 2023
ac760f1
More conditions for bandwidth searching
dzhu8 May 28, 2023
b6fcf8f
More design matrix tweaks
dzhu8 May 28, 2023
3fff784
Misc. minor changes
dzhu8 May 29, 2023
25201ac
GAM helper functions
dzhu8 May 31, 2023
55b4f38
Spline fitting functions
dzhu8 Jun 2, 2023
ca39768
Updates to GAM modeling
dzhu8 Jun 4, 2023
12df2f0
Statistical testing for GAM fitting
dzhu8 Jun 5, 2023
6bf953b
Downstream preprocessing
dzhu8 Jun 6, 2023
8344170
TMM normalization + polygon plotting
dzhu8 Jun 10, 2023
85e1baf
Bug fix
dzhu8 Jun 10, 2023
4d18aad
Add signaling DEG clustering, add Leiden clustering
dzhu8 Jun 12, 2023
2e4b6c2
Signaling DEG plotting
dzhu8 Jun 12, 2023
fad8f7c
Small updates to signaling DEG plotting
dzhu8 Jun 12, 2023
1d95366
Formatting for color label
dzhu8 Jun 12, 2023
5b0cd1f
Updates to normalize
dzhu8 Jun 13, 2023
9903e39
Name updates
dzhu8 Jun 13, 2023
2d9df1f
Typo fixes
dzhu8 Jun 13, 2023
adfa0dc
Save design matrix
dzhu8 Jun 14, 2023
0c8aba2
Small fix
dzhu8 Jun 14, 2023
ae86b31
Bug fix
dzhu8 Jun 14, 2023
ef90a9b
Cell type coupling to downstream functions
dzhu8 Jun 15, 2023
1bc528f
Temporarily deprecated upstream feature selection
dzhu8 Jun 16, 2023
e34751f
(I think?) complete downstream functionality, update run files and up…
dzhu8 Jun 18, 2023
96b08f4
Bug fixes
dzhu8 Jun 18, 2023
0ac54de
Generic update
dzhu8 Jun 20, 2023
04a3c74
Update docstrings
dzhu8 Jun 21, 2023
9f89a43
Update argparse
dzhu8 Jun 21, 2023
9fdfee5
Update argparse
dzhu8 Jun 21, 2023
f3a5d07
Update argparse
dzhu8 Jun 22, 2023
8812a2d
Misc. updates
dzhu8 Jun 22, 2023
eebfcd9
Misc. updates
dzhu8 Jun 23, 2023
ae93d62
Refactor GAM core
dzhu8 Jun 24, 2023
2973836
Found/fixed major issue in normalization
dzhu8 Jun 25, 2023
5689089
Add updated human GRN- large file.
dzhu8 Jun 26, 2023
11bbc24
Refactor databases
dzhu8 Jun 26, 2023
b3ee108
Update databases again
dzhu8 Jun 26, 2023
4174fdd
Many misc. changes
dzhu8 Jul 5, 2023
ca38230
Edits to smoothing
dzhu8 Jul 6, 2023
2a423f7
Update smooth function
dzhu8 Jul 6, 2023
e7cdb3e
Filtered cofactor and TF interaction databases
dzhu8 Jul 9, 2023
91f2c28
Add dimensionality reduction functions from Dynamo
dzhu8 Jul 10, 2023
aba56b3
Small updates
dzhu8 Jul 10, 2023
f159779
Reconfigured import statements, improved algorithm (I think)
dzhu8 Jul 12, 2023
ae63c03
Typo fix
dzhu8 Jul 12, 2023
b84b632
Finishing touches?
dzhu8 Jul 12, 2023
42ca424
Renamed outer CCI effects package
dzhu8 Jul 13, 2023
2ebf7bc
Adjust variable-scale model
dzhu8 Jul 14, 2023
225b5f3
SWR implementation tweaks
dzhu8 Jul 16, 2023
9d3f826
Small misc. changes
dzhu8 Jul 16, 2023
8d0ad27
Jaccard-based adaptive bandwidth adjustment
dzhu8 Jul 17, 2023
e46fda5
Reverted back to slightly older version of algo
dzhu8 Jul 17, 2023
9c68a70
Framework adjustments!
dzhu8 Jul 19, 2023
404959c
More bandwidth-finding options
dzhu8 Jul 20, 2023
bf3144e
Typo fixes, adjustments to neighbor finding
dzhu8 Jul 20, 2023
7a0351e
Bug fix
dzhu8 Jul 20, 2023
58048be
Add to downstream analysis funcs
dzhu8 Jul 24, 2023
ffa6c81
Misc. small fixes
dzhu8 Jul 24, 2023
81506ce
Edits to downstream analysis functions
dzhu8 Jul 24, 2023
fdedc66
Begin definition of downstream effects model
dzhu8 Jul 25, 2023
9dffbfa
Update downstream model
dzhu8 Jul 25, 2023
6402524
Sender deg downstream analysis
dzhu8 Jul 27, 2023
7339b69
More downstream functions
dzhu8 Jul 28, 2023
97ca922
Misc. changes
dzhu8 Jul 29, 2023
627076f
Misc. changes
dzhu8 Jul 29, 2023
a916bd9
Adjustment to upstream selection
dzhu8 Aug 10, 2023
f24c279
Update upstream
dzhu8 Aug 12, 2023
f76cf09
Update selector
dzhu8 Aug 13, 2023
3def14a
Edit downstream functions
dzhu8 Aug 14, 2023
8de78fb
Misc. changes
dzhu8 Aug 15, 2023
06bf860
Fixes
dzhu8 Aug 16, 2023
1264740
Clean up, add visualization for downstream model
dzhu8 Aug 16, 2023
24127d6
Edit downstream
dzhu8 Aug 17, 2023
ed9f681
Update downstream
dzhu8 Aug 17, 2023
027cb25
Small updates to downstream
dzhu8 Aug 18, 2023
c4cecaa
Mods to downstream
dzhu8 Aug 19, 2023
a103177
Re-included plot_connections
dzhu8 Aug 21, 2023
1fd0a8d
Interactions plot adjustments
dzhu8 Aug 23, 2023
76f2f14
Add multiplicity plot, adjust FC plot
dzhu8 Aug 25, 2023
fd91812
Variant of highly variable genes that works on dense data
dzhu8 Sep 18, 2023
7b7766c
Downstream model update
dzhu8 Sep 22, 2023
66925ef
Modify computation of pairwise distances
dzhu8 Sep 23, 2023
df34367
Update network construction
dzhu8 Sep 25, 2023
ae689a6
Update intercellular network
dzhu8 Sep 25, 2023
1d4667a
Update network plot
dzhu8 Sep 25, 2023
384048b
Customize network plotting
dzhu8 Sep 26, 2023
4bb07e8
Many updates
dzhu8 Sep 27, 2023
4122fb1
Update README
dzhu8 Oct 3, 2023
3e5c6b6
Update intercellular networks
dzhu8 Oct 3, 2023
90a40d3
Update network and plotting function
dzhu8 Oct 5, 2023
f1b7b06
Modify subsampling, add partial corr
dzhu8 Oct 25, 2023
e4626e8
Finish partial corr function
dzhu8 Oct 26, 2023
fb3e62e
Add option for total counts-based subsetting
dzhu8 Oct 26, 2023
2abdb11
Bug fixes
dzhu8 Oct 27, 2023
bac1a49
Mouse db doesn't have pathway information
dzhu8 Oct 29, 2023
a120e89
Update docstrings- for smoothing funcs
dzhu8 Oct 31, 2023
05e3295
Edit order for Notch in DB
dzhu8 Nov 1, 2023
1960676
Misc fixes
dzhu8 Nov 4, 2023
11a09e1
Update to smoothing funcs
dzhu8 Nov 4, 2023
84bb152
Updated Jaccard implementation
dzhu8 Nov 7, 2023
07d4b09
Final update to smoothing
dzhu8 Nov 9, 2023
fb11ec3
Updates to model
dzhu8 Nov 12, 2023
12344ce
Modify downstream funcs to look over only the true pos & true neg
dzhu8 Nov 13, 2023
31beb47
Database update
dzhu8 Nov 13, 2023
933294f
Remove MPI integration for now
dzhu8 Nov 14, 2023
c168c21
Updates
dzhu8 Nov 14, 2023
d31bb53
Modifications to downstream, main model
dzhu8 Nov 19, 2023
aea08a3
Removed some parts of downstream module
dzhu8 Nov 20, 2023
9451414
Modify LR databases
dzhu8 Nov 21, 2023
c468905
Update downstream functions
dzhu8 Nov 27, 2023
90d87ca
Mods + additions + removals- many new downstream functionalities
dzhu8 Nov 30, 2023
ed6d8b7
Update downstream plotting
dzhu8 Nov 30, 2023
0a7446b
Update to downstream
dzhu8 Dec 1, 2023
0af31ff
Update downstream functions
dzhu8 Dec 3, 2023
9b0f3e4
Moved adata filtering func
dzhu8 Dec 3, 2023
5f7c1da
Misc. updates
dzhu8 Dec 3, 2023
e090dec
Downstream function update
dzhu8 Dec 4, 2023
dfec5d5
Updates to downstream
dzhu8 Dec 6, 2023
1b4c0b4
Update downstream
dzhu8 Dec 6, 2023
0652a9e
Update downstream
dzhu8 Dec 7, 2023
b6df5bc
Update downstream
dzhu8 Dec 7, 2023
3930740
Minor update
dzhu8 Dec 11, 2023
0ea5c15
Database update
dzhu8 Dec 12, 2023
3038b76
Add custom axis functions
dzhu8 Dec 16, 2023
c8993d6
Update downstream
dzhu8 Dec 18, 2023
a797183
Updates to plotting & downstream
dzhu8 Dec 20, 2023
57b3df0
Update downstream
dzhu8 Dec 22, 2023
584174f
Update downstream
dzhu8 Dec 23, 2023
01d5871
Add 3D direction plotting code
dzhu8 Dec 29, 2023
fefea49
Update 3D vector field plotting
dzhu8 Dec 30, 2023
617d467
Add gene expression heatmap functionality to downstream
dzhu8 Dec 31, 2023
0b07c6a
Update 3D CCI plotting
dzhu8 Jan 3, 2024
3c19aec
Misc. changes
dzhu8 Jan 6, 2024
0603ef0
Merge branch 'main' into dzhu_dev
dzhu8 Jan 6, 2024
1b7a717
Fix some errors
dzhu8 Jan 7, 2024
6e4462e
Merge branch 'main' into dzhu_dev
dzhu8 Jan 7, 2024
4ae1111
Change to modeling framework
dzhu8 Jan 9, 2024
c7c09b8
Small mods to modeling
dzhu8 Jan 10, 2024
b5a9d0c
Delete testing folder
dzhu8 Jan 12, 2024
5efc460
Add adjustText to requirements
dzhu8 Jan 12, 2024
7484161
Add psutil to installs
dzhu8 Jan 12, 2024
e3e84a0
Delete tests folder
dzhu8 Jan 12, 2024
815d8a6
Merge branch 'main' into dzhu_dev
dzhu8 Jan 14, 2024
c159854
Misc. updates
dzhu8 Jan 16, 2024
5207955
Adjustment to CCI modeling
dzhu8 Jan 16, 2024
686e30e
Updated downstream class
dzhu8 Jan 21, 2024
8979346
Merge branch 'main' into dzhu_dev
dzhu8 Jan 21, 2024
a92252a
Update downstream
dzhu8 Jan 22, 2024
ec7006a
Update downstream
dzhu8 Jan 24, 2024
dcf0bf1
Update downstream
dzhu8 Jan 26, 2024
4348441
Update lr_db_mouse.csv
dzhu8 Jan 26, 2024
fef55e4
Update plotting functions
dzhu8 Jan 27, 2024
d877729
Update model setup
dzhu8 Jan 28, 2024
f3d2e0c
Small updates to plotting functions
dzhu8 Jan 28, 2024
dbea3cf
Add axolotl, Drosophila, zebrafish L:R lists again
dzhu8 Jan 31, 2024
d04ee24
Merge branch 'main' into dzhu_dev
dzhu8 Jan 31, 2024
2d4ce22
Update main modeling core
dzhu8 Jan 31, 2024
e3f35bc
Merge branch 'main' into dzhu_dev
dzhu8 Feb 1, 2024
55133dd
Add tests folder back
dzhu8 Feb 1, 2024
d9c7abc
Update formatting for certain files
dzhu8 Feb 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
spateo/tools/database/human_GRN.csv filter=lfs diff=lfs merge=lfs -text
spateo/tools/database/mouse_GRN.csv filter=lfs diff=lfs merge=lfs -text
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/python/black
rev: 22.3.0
rev: 23.10.1
hooks:
- id: black

Expand Down
26 changes: 0 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,6 @@

[Installation](https://spateo-release.readthedocs.io/en/latest/installation.html) - [Tutorials](https://spateo-release.readthedocs.io/en/latest/tutorials/index.html) - [API](https://spateo-release.readthedocs.io/en/latest/autoapi/spateo/index.html) - [Citation](https://www.biorxiv.org/content/10.1101/2022.12.07.519417v1) - [Technical](https://spateo-release.readthedocs.io/en/latest/technicals/index.html)

# Installation Notes
A few notes on installation: Spateo utilizes the `mpi4py` package and a working MPI implementation.
This can be most easily installed by first using `conda`. There are three options for MPI implementation:
1. OpenMPI (Linux and macOS)
2. MPICH (Linux and macOS)
3. Microsoft MPI (Windows)

To use MPICH:
```
conda install -c conda-forge mpich
```

To use OpenMPI:
```
conda install -c conda-forge openmpi
```

To use Microsoft MPI:
```
conda install -c conda-forge msmpi
```

On Linux, this can also be achieved using `sudo apt-get install libopenmpi-dev` or `sudo apt-get install mpich`.
mpi4py can also be installed at this time using the same command, however the version Spateo uses may differ from
the most current version.

# Citation
Xiaojie Qiu1$\*, Daniel Y. Zhu3$, Jiajun Yao2, 4, 5, 6$, Zehua Jing2, 4,7$, Lulu Zuo8$, Mingyue Wang2, 4, 9, 10$, Kyung Hoi (Joseph) Min11, Hailin Pan2, 4, Shuai Wang2, 4, 7, Sha Liao4, Yiwei Lai4, Shijie Hao2, 4, 7, Yuancheng Ryan Lu1, Matthew Hill17, Jorge D. Martin-Rufino17, Chen Weng1, Anna Maria Riera-Escandell18, Mengnan Chen2, 4, Liang Wu4, Yong Zhang4, Xiaoyu Wei2, 4, Mei Li4, Xin Huang4, Rong Xiang2, 4, 7, Zhuoxuan Yang4, 12, Chao Liu4, Tianyi Xia4, Yingxin Liang10, Junqiang Xu4,7, Qinan Hu9, 10, Yuhui Hu9, 10, Hongmei Zhu8, Yuxiang Li4, Ao Chen4, Miguel A. Esteban4, Ying Gu2, 4,7, Douglas A. Lauffenburger3, Xun Xu2, 4, 13, Longqi Liu2, 4, 14, 15\*, Jonathan S. Weissman1,19, 20\*, Shiping Liu2, 4, 14, 15, 16\*, Yinqi Bai2, 4\* $Co-first authors; *:Corresponding authors

Expand Down
28 changes: 0 additions & 28 deletions docs/extensions/typed_returns.py

This file was deleted.

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
adjustText
anndata>=0.8.0
colorcet>=2.0.1
cvxopt>=1.2.3
Expand Down Expand Up @@ -25,6 +26,7 @@ pandas>=0.25.1
paste-bio>=1.4.0
plotly>=5.1.0
POT>=0.8.1
psutil>=5.6.3
pynndescent>=0.4.8
pysal>=1.14.4
pyro-ppl
Expand Down
2 changes: 1 addition & 1 deletion spateo/alignment/methods/paste.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,4 @@ def generalized_procrustes_analysis(X, Y, pi):
Y = R.dot(Y.T).T
mapping_dict = {"tX": tX, "tY": tY, "R": R}

return X, Y, mapping_dict
return X, Y, mapping_dict
4 changes: 4 additions & 0 deletions spateo/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
from .errors import ConfigurationError
from .logging import logger_manager as lm

# Global tolerance value:
EPS = np.finfo(float).eps
MAX = np.finfo(np.float32).max


class SpateoConfig:
def __init__(
Expand Down
2 changes: 0 additions & 2 deletions spateo/digitization/boundary_old.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def identify_boundary(
min_area=30,
dilate_k_size: int = 3,
):

lm.main_info(f"Setting up source and target area.")
adata_tmp = adata.copy()
adata_tmp.obs["tmp_boundary"] = 0
Expand Down Expand Up @@ -88,7 +87,6 @@ def boundary_gridding(
spatial_key: str = "spatial",
init: bool = False,
):

bdl_seg_inner_list = []
bdl_seg_outer_list = []

Expand Down
4 changes: 0 additions & 4 deletions spateo/digitization/utils_old.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def fill_grid_label(
column_label_key: str = "column_label",
init: bool = False,
):

# mask image should be 2 pixels wider and higher, according to cv2.floodFill
layer_grid_img = seg_grid_img.copy()
layer_mask = np.zeros((layer_grid_img.shape[0] + 2, layer_grid_img.shape[1] + 2), dtype=np.uint8)
Expand Down Expand Up @@ -104,7 +103,6 @@ def draw_seg_grid(
gridline_width=1,
mode="grid",
):

seg_grid_img = np.zeros_like(boundary_line_img, dtype=np.uint8)

if len(bdl_seg_coor_x) != len(bdl_seg_coor_y):
Expand Down Expand Up @@ -187,7 +185,6 @@ def extend_layer(
boundary_line_list,
extend_width=10,
):

lm.main_info(f"Generating layer area.")
extend_layer_mask = np.zeros_like(boundary_line_img, dtype=np.uint8)
extend_layer_img = np.zeros_like(boundary_line_img, dtype=np.uint8)
Expand Down Expand Up @@ -226,7 +223,6 @@ def field_contour_line(
min_pnt,
max_pnt,
):

ctr_seq_rev = ctr_seq[::-1].copy()
min_idx = ctr_seq.index(min_pnt)
max_idx = ctr_seq.index(max_pnt) + 1
Expand Down
2 changes: 1 addition & 1 deletion spateo/io/nanostring.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from ..configuration import SKM
from ..logging import logger_manager as lm
from .utils import get_points_props
from .utils import bin_indices, get_bin_props, get_points_props

try:
import ngs_tools as ngs
Expand Down
3 changes: 2 additions & 1 deletion spateo/io/slideseq.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""IO functions for Slide-seq technology.
"""
from typing import List, NamedTuple, Optional, Union
from typing import NamedTuple, Optional

import numpy as np
import pandas as pd
Expand All @@ -10,6 +10,7 @@

from ..configuration import SKM
from ..logging import logger_manager as lm
from .utils import bin_indices, get_bin_props

try:
import ngs_tools as ngs
Expand Down
2 changes: 1 addition & 1 deletion spateo/io/tenx.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def read_10x(matrix_dir: str, positions_path: str, version: Literal["visium"] =
SKM.init_adata_type(adata, SKM.ADATA_UMI_TYPE)
SKM.init_uns_pp_namespace(adata)
SKM.init_uns_spatial_namespace(adata)
SKM.set_uns_spatial_attribute(adata, SKM.UNS_SPATIAL_BINSIZE_KEY, binsize)
# SKM.set_uns_spatial_attribute(adata, SKM.UNS_SPATIAL_BINSIZE_KEY, binsize)
SKM.set_uns_spatial_attribute(adata, SKM.UNS_SPATIAL_SCALE_KEY, scale)
SKM.set_uns_spatial_attribute(adata, SKM.UNS_SPATIAL_SCALE_UNIT_KEY, scale_unit)
return adata
7 changes: 3 additions & 4 deletions spateo/plotting/interactive/agg.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
"""Interactive plotting functions for aggregated UMI counts.
"""
from typing import Dict, List, Optional, Tuple, Union
from typing import List, Optional, Tuple, Union

import anndata
import cv2
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import plotly.graph_objects as go
from anndata import AnnData
from matplotlib.axes import Axes
from matplotlib.figure import Figure
from matplotlib.widgets import PolygonSelector
from skimage.color.colorlabel import DEFAULT_COLORS, color_dict
from typing_extensions import Literal
from skimage.color.colorlabel import DEFAULT_COLORS

from ...configuration import SKM
from ...errors import PlottingError
Expand Down
1 change: 0 additions & 1 deletion spateo/plotting/static/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from .align import multi_slices
from .bbs import delaunay, polygon
from .colorlabel import color_label
from .contour import spatial_domains
from .dotplot import dotplot
from .geo import geo
from .glm import glm_fit, glm_heatmap
Expand Down
43 changes: 43 additions & 0 deletions spateo/plotting/static/colorlabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,46 @@ def color_label(
"#A4E804",
"#324E72",
]

# D. Zhu's color scheme for categorical data- used in plotting interaction-related things:
interaction_colors = [
"#FF0000", # Red
"#FF69B4", # Hot Pink
"#FFF68F", # Khaki
"#FF8C00", # Dark Orange
"#C71585", # Medium Violet Red
"#00CED1", # Dark Turquoise
"#1874CD", # Dodger Blue
"#8B4726", # Saddle Brown
"#9400D3", # Dark Violet
"#00C957", # Medium Spring Green
"#8EE5EE", # Sky Blue
"#CDC673", # Dark Khaki
"#7CFC00", # Lawn Green
"#8A2BE2", # Blue Violet
"#FFD700", # Gold
"#FF1493", # Deep Pink
"#008000", # Green
"#4682B4", # Steel Blue
"#B22222", # Fire Brick
"#FF00FF", # Magenta
"#32CD32", # Lime Green
"#1E90FF", # Dodger Blue
"#FFD700", # Gold
"#9AFF9A", # Pale Green
"#EE0000", # Crimson
"#808080", # Gray
"#C1FFC1", # Light Green
"#B22222", # Fire Brick
"#FFFF00", # Yellow
"#FFFFFF", # White
"#FA8072", # Salmon
"#FFC1C1", # Light Pink
"#836FFF", # Medium Slate Blue
"#FF4500", # Orange Red
"#698B22", # Olive Drab
"#7CCD7C", # Pale Green
"#C6E2FF", # Powder Blue
"#FFA500", # Orange
"#00FFFF", # Cyan
]
68 changes: 0 additions & 68 deletions spateo/plotting/static/contour.py

This file was deleted.

Loading
Loading