mcDETECT 2.0.1__py3-none-any.whl → 2.0.3__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.
Potentially problematic release.
This version of mcDETECT might be problematic. Click here for more details.
- mcDETECT/__init__.py +6 -3
- mcDETECT/model.py +1 -0
- mcDETECT/utils.py +12 -12
- {mcdetect-2.0.1.dist-info → mcdetect-2.0.3.dist-info}/METADATA +1 -1
- mcdetect-2.0.3.dist-info/RECORD +8 -0
- mcdetect-2.0.1.dist-info/RECORD +0 -8
- {mcdetect-2.0.1.dist-info → mcdetect-2.0.3.dist-info}/WHEEL +0 -0
- {mcdetect-2.0.1.dist-info → mcdetect-2.0.3.dist-info}/licenses/LICENSE +0 -0
- {mcdetect-2.0.1.dist-info → mcdetect-2.0.3.dist-info}/top_level.txt +0 -0
mcDETECT/__init__.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
__version__ = "2.0.
|
|
2
|
-
|
|
3
|
-
from .
|
|
1
|
+
__version__ = "2.0.3"
|
|
2
|
+
|
|
3
|
+
from . import model
|
|
4
|
+
from . import utils
|
|
5
|
+
|
|
6
|
+
__all__ = ["model", "utils"]
|
mcDETECT/model.py
CHANGED
mcDETECT/utils.py
CHANGED
|
@@ -100,26 +100,26 @@ def weighted_spearmanr(A, B, weights):
|
|
|
100
100
|
return weighted_spearman_corr
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
def assign_palette_to_adata(adata, obs_key = "granule_expr_cluster_hierarchical", cmap_name = "tab10"):
|
|
103
|
+
def assign_palette_to_adata(adata, obs_key = "granule_expr_cluster_hierarchical", self_defined = False, cmap_name = "tab10"):
|
|
104
104
|
|
|
105
105
|
adata = adata.copy()
|
|
106
106
|
|
|
107
|
-
# ensure the column is categorical
|
|
108
107
|
if not pd.api.types.is_categorical_dtype(adata.obs[obs_key]):
|
|
109
108
|
adata.obs[obs_key] = adata.obs[obs_key].astype("category")
|
|
110
|
-
|
|
111
|
-
# extract categories and number of levels
|
|
109
|
+
|
|
112
110
|
categories = adata.obs[obs_key].cat.categories
|
|
113
111
|
n_categories = len(categories)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
color_palette = sns.color_palette(cmap_name, n_categories)
|
|
112
|
+
|
|
113
|
+
if self_defined:
|
|
114
|
+
cmap = plt.colormaps[cmap_name]
|
|
115
|
+
color_palette = [cmap(i) for i in range(n_categories)]
|
|
119
116
|
else:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
base_colors = plt.get_cmap(cmap_name).colors
|
|
118
|
+
if n_categories > len(base_colors):
|
|
119
|
+
color_palette = sns.color_palette(cmap_name, n_categories)
|
|
120
|
+
else:
|
|
121
|
+
color_palette = base_colors[:n_categories]
|
|
122
|
+
|
|
123
123
|
adata.uns[f"{obs_key}_colors"] = [mcolors.to_hex(c) for c in color_palette]
|
|
124
124
|
|
|
125
125
|
return adata
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
mcDETECT/__init__.py,sha256=SPCzZZOrSFKUNUYRrFbrBWF0FPN6OUzUpRP4zjlfQr0,92
|
|
2
|
+
mcDETECT/model.py,sha256=zEdHqgwTjDi7HxdLW0aPG2j8uLMPiobNu-BcJraAG8g,28047
|
|
3
|
+
mcDETECT/utils.py,sha256=0gvqZV7sGi8qvvdC5x9XScyiTXlSfqbUt1zks4t7Xd4,4545
|
|
4
|
+
mcdetect-2.0.3.dist-info/licenses/LICENSE,sha256=uxq-shEWOGTIGVnQLmpElILmfCkuUhFZRAMnZUiKvtg,1070
|
|
5
|
+
mcdetect-2.0.3.dist-info/METADATA,sha256=1ny7qrjmE9p1Ybgmw3k4QnVJSKlXVJR4nlBNPxj3RCU,3016
|
|
6
|
+
mcdetect-2.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
mcdetect-2.0.3.dist-info/top_level.txt,sha256=WwzBojt5U-T2hZ8llO6XgpM9OFIBkWQQldQKu19O8EY,9
|
|
8
|
+
mcdetect-2.0.3.dist-info/RECORD,,
|
mcdetect-2.0.1.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
mcDETECT/__init__.py,sha256=o9fQTRgcHPisSCcv0Cy-AtdiTSWrj-ITBK_FQxfnmKE,174
|
|
2
|
-
mcDETECT/model.py,sha256=-r2_Ve0wxOALxiFk0REa58WjMea495yLZ6oXT-WWekw,28046
|
|
3
|
-
mcDETECT/utils.py,sha256=kKw7KnrS-0llqtT32S_PDkag1jk4CWYkSm-FZeIJFAw,4510
|
|
4
|
-
mcdetect-2.0.1.dist-info/licenses/LICENSE,sha256=uxq-shEWOGTIGVnQLmpElILmfCkuUhFZRAMnZUiKvtg,1070
|
|
5
|
-
mcdetect-2.0.1.dist-info/METADATA,sha256=qMO7hrWgabHHp1_UxlDvsLmQYaBC7Nf85RPNxyBvA8o,3016
|
|
6
|
-
mcdetect-2.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
mcdetect-2.0.1.dist-info/top_level.txt,sha256=WwzBojt5U-T2hZ8llO6XgpM9OFIBkWQQldQKu19O8EY,9
|
|
8
|
-
mcdetect-2.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|