cytocommunity2 1.0.6__tar.gz → 1.0.7__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.
- {cytocommunity2-1.0.6/src/cytocommunity2.egg-info → cytocommunity2-1.0.7}/PKG-INFO +1 -1
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/pyproject.toml +1 -1
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/__init__.py +1 -1
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/dotplots.py +13 -22
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7/src/cytocommunity2.egg-info}/PKG-INFO +1 -1
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/LICENSE +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/README.md +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/setup.cfg +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/_io.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/colors.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/config.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/__init__.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/coherence.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/communication/__init__.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/communication/between.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/communication/cca.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/communication/utils.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/communication/within.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/differential_composition.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/dominant_celltype.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/enrichment.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/moran.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/__init__.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/cn_selection.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/coherence.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/common.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/communication.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/communication_cca.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/communication_stack.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/dominant.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/recurrence.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/recurrence.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/wilcoxon.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/ensemble.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/learning/__init__.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/learning/api.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/learning/dataset.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/learning/model.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/learning/selection.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/learning/training.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/paths.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/visualization/__init__.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/visualization/spatial.py +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2.egg-info/SOURCES.txt +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2.egg-info/dependency_links.txt +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2.egg-info/requires.txt +0 -0
- {cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2.egg-info/top_level.txt +0 -0
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/dotplots.py
RENAMED
|
@@ -10,6 +10,7 @@ from .common import add_colorbar, plotting_style, dot_size, save_figure
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
DOTPLOT_CMAP = "coolwarm"
|
|
13
|
+
DOTPLOT_STRENGTH_VALUES = (0.5, 1.3, 2.0)
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
def _tested_mask(record):
|
|
@@ -18,18 +19,8 @@ def _tested_mask(record):
|
|
|
18
19
|
|
|
19
20
|
def _panel_size(record):
|
|
20
21
|
tested = _tested_mask(record)
|
|
21
|
-
return (max(
|
|
22
|
-
max(3.0, 0.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def _legend_strength_values(records):
|
|
26
|
-
"""Choose up to three size examples from the dots actually being drawn."""
|
|
27
|
-
pvalues = np.concatenate([record["pvalues"][_tested_mask(record)] for record in records])
|
|
28
|
-
values = np.unique(np.minimum(-np.log10(np.clip(pvalues, 1e-300, 1.0)), 5.0))
|
|
29
|
-
values[values == 0] = 0.0
|
|
30
|
-
if len(values) <= 3:
|
|
31
|
-
return values
|
|
32
|
-
return values[np.rint(np.linspace(0, len(values) - 1, 3)).astype(int)]
|
|
22
|
+
return (max(5.4, 0.46 * tested.any(axis=1).sum() + 1.6),
|
|
23
|
+
max(3.0, 0.46 * tested.any(axis=0).sum() + 1.8))
|
|
33
24
|
|
|
34
25
|
|
|
35
26
|
def _draw_panel(
|
|
@@ -64,11 +55,11 @@ def _draw_panel(
|
|
|
64
55
|
x_grid[significant], y_grid[significant], s=60.0, marker="*",
|
|
65
56
|
c="#1d2630", edgecolors="none", zorder=4,
|
|
66
57
|
)
|
|
67
|
-
axis.set_title(title, fontsize=
|
|
58
|
+
axis.set_title(title, fontsize=17, fontweight="bold", pad=10)
|
|
68
59
|
axis.set_xticks(np.arange(len(celltypes)))
|
|
69
|
-
axis.set_xticklabels(celltypes, rotation=rotation, ha="right" if rotation != 90 else "center", fontsize=
|
|
60
|
+
axis.set_xticklabels(celltypes, rotation=rotation, ha="right" if rotation != 90 else "center", fontsize=14)
|
|
70
61
|
axis.set_yticks(np.arange(len(cn_order)))
|
|
71
|
-
axis.set_yticklabels([f"CN{cn}" for cn in cn_order], fontsize=
|
|
62
|
+
axis.set_yticklabels([f"CN{cn}" for cn in cn_order], fontsize=14)
|
|
72
63
|
axis.set_xlim(-0.6, len(celltypes) - 0.4)
|
|
73
64
|
axis.set_ylim(-0.55, len(cn_order) - 0.45)
|
|
74
65
|
axis.set_aspect("equal", adjustable="box")
|
|
@@ -91,20 +82,20 @@ def _draw_dotplot_legend(figure, norm, threshold, colorbar_title,
|
|
|
91
82
|
|
|
92
83
|
axis = add_axis([0.04, 0.34, 0.92, 0.64] if compact else [0.04, 0.30, 0.92, 0.65])
|
|
93
84
|
axis.axis("off")
|
|
94
|
-
values =
|
|
85
|
+
values = DOTPLOT_STRENGTH_VALUES if strength_values is None else strength_values
|
|
95
86
|
handles = [axis.scatter([], [], s=dot_size(10.0 ** -value), color="#b9414b") for value in values]
|
|
96
87
|
handles.append(axis.scatter([], [], s=60.0, marker="*", color="#1d2630"))
|
|
97
88
|
axis.legend(
|
|
98
89
|
handles, [f"{value:.3g}" for value in values] + [f"p-value < {threshold:g}"],
|
|
99
90
|
title=significance_title, frameon=False, loc="upper left",
|
|
100
91
|
bbox_to_anchor=(0.02, 1.0), labelspacing=0.8 if compact else 1.9, handletextpad=0.75,
|
|
101
|
-
fontsize=
|
|
92
|
+
fontsize=16, title_fontsize=16, markerscale=1.0,
|
|
102
93
|
)
|
|
103
94
|
colorbar = add_colorbar(figure, add_axis([0.04, 0.06, 0.92, 0.08]), norm,
|
|
104
95
|
colorbar_title, cmap=DOTPLOT_CMAP, orientation="horizontal")
|
|
105
|
-
colorbar.ax.tick_params(labelsize=
|
|
96
|
+
colorbar.ax.tick_params(labelsize=14, pad=3)
|
|
106
97
|
colorbar.ax.xaxis.set_label_position("top")
|
|
107
|
-
colorbar.set_label(colorbar_title, fontsize=
|
|
98
|
+
colorbar.set_label(colorbar_title, fontsize=16, labelpad=6)
|
|
108
99
|
|
|
109
100
|
|
|
110
101
|
@plotting_style()
|
|
@@ -114,7 +105,7 @@ def save_dotplot_legend(norm, output_dir, threshold=0.05, colorbar_title="log2FC
|
|
|
114
105
|
"""Save a standalone legend for callers that explicitly request one."""
|
|
115
106
|
import matplotlib.pyplot as plt
|
|
116
107
|
|
|
117
|
-
figure = plt.figure(figsize=(3.6,
|
|
108
|
+
figure = plt.figure(figsize=(3.6, 3.1 if compact else 4.15))
|
|
118
109
|
_draw_dotplot_legend(figure, norm, threshold, colorbar_title,
|
|
119
110
|
significance_title, compact=compact, strength_values=strength_values)
|
|
120
111
|
output = save_figure(figure, Path(output_dir) / "LEGEND.pdf", png=png)
|
|
@@ -164,7 +155,7 @@ def _save_dotplots(
|
|
|
164
155
|
|
|
165
156
|
import matplotlib.pyplot as plt
|
|
166
157
|
|
|
167
|
-
strength_values =
|
|
158
|
+
strength_values = DOTPLOT_STRENGTH_VALUES
|
|
168
159
|
outputs = []
|
|
169
160
|
for index, record in enumerate(records):
|
|
170
161
|
figure, axis = plt.subplots(figsize=_panel_size(record))
|
|
@@ -199,7 +190,7 @@ def _save_dotplots(
|
|
|
199
190
|
figure.subplots_adjust(left=0.07 * plot_width / figure_width,
|
|
200
191
|
right=0.98 * plot_width / figure_width,
|
|
201
192
|
bottom=0.10, top=0.96, hspace=0.60, wspace=0.25)
|
|
202
|
-
legend_height =
|
|
193
|
+
legend_height = 3.1 if compact_legend else 4.15
|
|
203
194
|
legend_center = 0.96 - 0.86 / rows / 2
|
|
204
195
|
_draw_dotplot_legend(
|
|
205
196
|
figure, norm, threshold, colorbar_title, significance_title,
|
|
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
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/communication/between.py
RENAMED
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/communication/cca.py
RENAMED
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/communication/utils.py
RENAMED
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/communication/within.py
RENAMED
|
File without changes
|
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/dominant_celltype.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/__init__.py
RENAMED
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/cn_selection.py
RENAMED
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/coherence.py
RENAMED
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/common.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/dominant.py
RENAMED
|
File without changes
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2/downstream/plotting/recurrence.py
RENAMED
|
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
|
{cytocommunity2-1.0.6 → cytocommunity2-1.0.7}/src/cytocommunity2.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|