marsilea 0.4.7__py3-none-any.whl → 0.5.0rc1__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.
- marsilea/__init__.py +1 -1
- marsilea/base.py +7 -0
- marsilea/heatmap.py +6 -3
- marsilea/plotter/arc.py +2 -4
- marsilea/plotter/area.py +1 -2
- marsilea/plotter/bar.py +1 -2
- marsilea/plotter/bio.py +3 -6
- marsilea/plotter/range.py +1 -2
- marsilea/upset.py +1 -1
- {marsilea-0.4.7.dist-info → marsilea-0.5.0rc1.dist-info}/METADATA +17 -17
- {marsilea-0.4.7.dist-info → marsilea-0.5.0rc1.dist-info}/RECORD +13 -13
- {marsilea-0.4.7.dist-info → marsilea-0.5.0rc1.dist-info}/WHEEL +0 -0
- {marsilea-0.4.7.dist-info → marsilea-0.5.0rc1.dist-info}/licenses/LICENSE +0 -0
marsilea/__init__.py
CHANGED
marsilea/base.py
CHANGED
|
@@ -169,7 +169,14 @@ class LegendMaker:
|
|
|
169
169
|
for _, legs in legends.items():
|
|
170
170
|
for leg in legs:
|
|
171
171
|
try:
|
|
172
|
+
# Try to detach legend from figure
|
|
172
173
|
leg.remove()
|
|
174
|
+
# For matplotlib >= 3.10.0
|
|
175
|
+
if hasattr(leg, "_parent_figure"):
|
|
176
|
+
setattr(leg, "_parent_figure", None)
|
|
177
|
+
# For matplotlib < 3.10.0
|
|
178
|
+
if hasattr(leg, "figure"):
|
|
179
|
+
setattr(leg, "figure", None)
|
|
173
180
|
except Exception:
|
|
174
181
|
pass
|
|
175
182
|
|
marsilea/heatmap.py
CHANGED
|
@@ -50,6 +50,7 @@ class Heatmap(ClusterBoard):
|
|
|
50
50
|
height=None,
|
|
51
51
|
cluster_data=None,
|
|
52
52
|
init_main=True,
|
|
53
|
+
legend=True,
|
|
53
54
|
**kwargs,
|
|
54
55
|
):
|
|
55
56
|
if cluster_data is None:
|
|
@@ -80,7 +81,7 @@ class Heatmap(ClusterBoard):
|
|
|
80
81
|
)
|
|
81
82
|
name = get_plot_name(name, "main", mesh.__class__.__name__)
|
|
82
83
|
mesh.set(name=name)
|
|
83
|
-
self.add_layer(mesh)
|
|
84
|
+
self.add_layer(mesh, legend=legend)
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
class CatHeatmap(ClusterBoard):
|
|
@@ -109,6 +110,7 @@ class CatHeatmap(ClusterBoard):
|
|
|
109
110
|
name=None,
|
|
110
111
|
width=None,
|
|
111
112
|
height=None,
|
|
113
|
+
legend=True,
|
|
112
114
|
cluster_data=None,
|
|
113
115
|
linewidth=0,
|
|
114
116
|
linecolor="white",
|
|
@@ -128,7 +130,7 @@ class CatHeatmap(ClusterBoard):
|
|
|
128
130
|
super().__init__(cluster_data, width=width, height=height, name=name)
|
|
129
131
|
name = get_plot_name(name, "main", mesh.__class__.__name__)
|
|
130
132
|
mesh.set(name=name)
|
|
131
|
-
self.add_layer(mesh)
|
|
133
|
+
self.add_layer(mesh, legend=legend)
|
|
132
134
|
|
|
133
135
|
|
|
134
136
|
class SizedHeatmap(ClusterBoard):
|
|
@@ -156,6 +158,7 @@ class SizedHeatmap(ClusterBoard):
|
|
|
156
158
|
name=None,
|
|
157
159
|
width=None,
|
|
158
160
|
height=None,
|
|
161
|
+
legend=True,
|
|
159
162
|
**kwargs,
|
|
160
163
|
):
|
|
161
164
|
if cluster_data is None:
|
|
@@ -166,4 +169,4 @@ class SizedHeatmap(ClusterBoard):
|
|
|
166
169
|
super().__init__(cluster_data, width=width, height=height, name=name)
|
|
167
170
|
|
|
168
171
|
mesh = SizedMesh(size=size, color=color, **kwargs)
|
|
169
|
-
self.add_layer(mesh)
|
|
172
|
+
self.add_layer(mesh, legend=legend)
|
marsilea/plotter/arc.py
CHANGED
|
@@ -231,11 +231,9 @@ class Arc(StatsBase):
|
|
|
231
231
|
ax.set_ylim(lim * 1.1, 0)
|
|
232
232
|
ax.set_xlim(0, 1)
|
|
233
233
|
if self.side == "top":
|
|
234
|
-
|
|
235
|
-
ax.invert_yaxis()
|
|
234
|
+
ax.invert_yaxis()
|
|
236
235
|
if self.side == "left":
|
|
237
|
-
|
|
238
|
-
ax.invert_xaxis()
|
|
236
|
+
ax.invert_xaxis()
|
|
239
237
|
ax.set_axis_off()
|
|
240
238
|
|
|
241
239
|
def get_legends(self):
|
marsilea/plotter/area.py
CHANGED
|
@@ -90,8 +90,7 @@ class Area(StatsBase):
|
|
|
90
90
|
ax.plot(data, x, **line_options)
|
|
91
91
|
ax.set_ylim(-0.5, len(data) - 0.5)
|
|
92
92
|
if self.side == "left":
|
|
93
|
-
|
|
94
|
-
ax.invert_xaxis()
|
|
93
|
+
ax.invert_xaxis()
|
|
95
94
|
else:
|
|
96
95
|
ax.fill_between(x, data, **fill_options)
|
|
97
96
|
if self.add_outline:
|
marsilea/plotter/bar.py
CHANGED
|
@@ -270,8 +270,7 @@ class CenterBar(_BarBase):
|
|
|
270
270
|
ax.xaxis.set_major_formatter(FuncFormatter(lambda x, p: f"{np.abs(x):g}"))
|
|
271
271
|
|
|
272
272
|
if self.is_flank:
|
|
273
|
-
|
|
274
|
-
ax.invert_yaxis()
|
|
273
|
+
ax.invert_yaxis()
|
|
275
274
|
|
|
276
275
|
if self.show_value:
|
|
277
276
|
left_label = _format_labels(left_bar, self.fmt)
|
marsilea/plotter/bio.py
CHANGED
|
@@ -171,12 +171,9 @@ class SeqLogo(StatsBase):
|
|
|
171
171
|
ax.set_xlim(0, lim)
|
|
172
172
|
ax.set_ylim(0, data.shape[1])
|
|
173
173
|
if self.is_flank:
|
|
174
|
-
|
|
175
|
-
ax.invert_yaxis()
|
|
174
|
+
ax.invert_yaxis()
|
|
176
175
|
if self.side == "left":
|
|
177
|
-
|
|
178
|
-
ax.invert_xaxis()
|
|
176
|
+
ax.invert_xaxis()
|
|
179
177
|
if self.side == "bottom":
|
|
180
|
-
|
|
181
|
-
ax.invert_yaxis()
|
|
178
|
+
ax.invert_yaxis()
|
|
182
179
|
ax.set_axis_off()
|
marsilea/plotter/range.py
CHANGED
marsilea/upset.py
CHANGED
|
@@ -947,7 +947,7 @@ class Upset(WhiteBoard):
|
|
|
947
947
|
def _extra_legends(self):
|
|
948
948
|
handles = [Patch(**entry) for entry in self._legend_entries]
|
|
949
949
|
highlight_legend = ListLegend(handles=handles, handlelength=2)
|
|
950
|
-
highlight_legend.
|
|
950
|
+
# highlight_legend.set_figure(None)
|
|
951
951
|
return {"highlight_subsets": [highlight_legend]}
|
|
952
952
|
|
|
953
953
|
def render(self, figure=None, scale=1):
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: marsilea
|
|
3
|
-
Version: 0.
|
|
4
|
-
|
|
3
|
+
Version: 0.5.0rc1
|
|
4
|
+
Summary: Declarative creation of composable visualizations
|
|
5
5
|
Project-URL: Home, https://github.com/Marsilea-viz/marsilea
|
|
6
|
+
Project-URL: Documentation, https://marsilea.readthedocs.io
|
|
6
7
|
Author: Zhihang Zheng
|
|
7
|
-
Author-email:
|
|
8
|
+
Author-email: Yimin Zheng <yzheng@cemm.at>
|
|
8
9
|
License: The MIT License (MIT)
|
|
9
10
|
|
|
10
11
|
Copyright (c) 2024 Mr-Milk
|
|
@@ -30,6 +31,8 @@ License-File: LICENSE
|
|
|
30
31
|
Classifier: Framework :: Matplotlib
|
|
31
32
|
Classifier: License :: OSI Approved :: MIT License
|
|
32
33
|
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: Topic :: Scientific/Engineering
|
|
35
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
33
36
|
Requires-Python: >=3.8
|
|
34
37
|
Requires-Dist: legendkit
|
|
35
38
|
Requires-Dist: matplotlib>=3.6
|
|
@@ -38,20 +41,6 @@ Requires-Dist: pandas[parquet]
|
|
|
38
41
|
Requires-Dist: platformdirs
|
|
39
42
|
Requires-Dist: scipy
|
|
40
43
|
Requires-Dist: seaborn
|
|
41
|
-
Provides-Extra: dev
|
|
42
|
-
Requires-Dist: icecream; extra == 'dev'
|
|
43
|
-
Requires-Dist: mpl-fontkit; extra == 'dev'
|
|
44
|
-
Requires-Dist: numpydoc; extra == 'dev'
|
|
45
|
-
Requires-Dist: pre-commit; extra == 'dev'
|
|
46
|
-
Requires-Dist: pydata-sphinx-theme; extra == 'dev'
|
|
47
|
-
Requires-Dist: pytest; extra == 'dev'
|
|
48
|
-
Requires-Dist: python-hmr; extra == 'dev'
|
|
49
|
-
Requires-Dist: ruff; extra == 'dev'
|
|
50
|
-
Requires-Dist: scikit-learn; extra == 'dev'
|
|
51
|
-
Requires-Dist: sphinx; extra == 'dev'
|
|
52
|
-
Requires-Dist: sphinx-copybutton; extra == 'dev'
|
|
53
|
-
Requires-Dist: sphinx-design; extra == 'dev'
|
|
54
|
-
Requires-Dist: sphinx-gallery; extra == 'dev'
|
|
55
44
|
Description-Content-Type: text/markdown
|
|
56
45
|
|
|
57
46
|
<p align="center">
|
|
@@ -66,6 +55,7 @@ Description-Content-Type: text/markdown
|
|
|
66
55
|

|
|
67
56
|

|
|
68
57
|

|
|
58
|
+
[](https://doi.org/10.1186/s13059-024-03469-3)
|
|
69
59
|
|
|
70
60
|
# Marsilea: Declarative creation of composable visualization!
|
|
71
61
|
|
|
@@ -104,6 +94,16 @@ and then create a bar chart to show the expression of genes in different cell ty
|
|
|
104
94
|
A visualization contains multiple plots is called a composable visualization.
|
|
105
95
|
In Marsilea, we employ a declarative approach for user to create composable visualization incrementally.
|
|
106
96
|
|
|
97
|
+
## Citation
|
|
98
|
+
|
|
99
|
+
If you use Marsilea in your research, please cite the following:
|
|
100
|
+
|
|
101
|
+
> Marsilea: an intuitive generalized paradigm for composable visualizations
|
|
102
|
+
>
|
|
103
|
+
> Yimin Zheng, Zhihang Zheng, André F. Rendeiro & Edwin Cheung
|
|
104
|
+
>
|
|
105
|
+
> _Genome Biology_ 2025 Jan 06. DOI: [10.1186/s13059-017-1382-0](https://doi.org/10.1186/s13059-024-03469-3)
|
|
106
|
+
|
|
107
107
|
## Examples
|
|
108
108
|
|
|
109
109
|
<table>
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
marsilea/__init__.py,sha256=
|
|
1
|
+
marsilea/__init__.py,sha256=_eGLcXHTDSPWqHXJEpLBbU9NJ9V2Obemv-GsjsrZOmU,598
|
|
2
2
|
marsilea/_api.py,sha256=tymWZHfjhx8-0NNd9762znfdIu36NrARRweEIr5L1mA,283
|
|
3
3
|
marsilea/_deform.py,sha256=QRz4OGXMsQzbiIkC3ASzZayMPhHhoFsEK38oBzSeQG8,14440
|
|
4
|
-
marsilea/base.py,sha256=
|
|
4
|
+
marsilea/base.py,sha256=WTQ1L2Geyt4KjrWWQMSrS-0Z2do2R7FOdBx5_2W8Z7w,51206
|
|
5
5
|
marsilea/dataset.py,sha256=Qh8k1DhTiwP_Me709CkpNwRaYLDzlenRTIk0U6D58_g,4631
|
|
6
6
|
marsilea/dendrogram.py,sha256=Ung43zseybZKzTEvH5P_ge3WGfsr7i7qsX7YEVDlC74,15590
|
|
7
7
|
marsilea/exceptions.py,sha256=wN5ElUZxuaJKSnnwWdkNx6P-Oc16dzSuaRPbRKWIBEM,1046
|
|
8
|
-
marsilea/heatmap.py,sha256=
|
|
8
|
+
marsilea/heatmap.py,sha256=8Wo1NxFTBp1a7NOISmer0yQYWWgf51Xsvjav1h1vTYk,4316
|
|
9
9
|
marsilea/layers.py,sha256=puXLlGGpEqAzaTqadpgpsYmIDPH33WyyHIuysRSqFZQ,12163
|
|
10
10
|
marsilea/layout.py,sha256=yNuGvIDfWjbCksQZO-4aUWSA78LJwBBKF5Z5cthC6fM,39741
|
|
11
|
-
marsilea/upset.py,sha256=
|
|
11
|
+
marsilea/upset.py,sha256=JnqV9HYYpoeLt-6yMy0HN_PUSgV-ENasf6vq6HsX3cI,30393
|
|
12
12
|
marsilea/utils.py,sha256=y_KYs4ToiuKEsiBdmcIVtmxMXFpD4wKiJ0k7iBa11z8,2854
|
|
13
13
|
marsilea/plotter/__init__.py,sha256=la30o20zYiHWN2RzElhS8MMCbGKbDDEe0WHXakq9OBQ,806
|
|
14
14
|
marsilea/plotter/_seaborn.py,sha256=Ahy5id35KV-PZ50rI5lmEpA4Oov51u8w6VVQzVZH6hM,8330
|
|
15
15
|
marsilea/plotter/_utils.py,sha256=Efhdk-TrrAanhbXRiEVWThMYvZ4vVHZMVYMs5X3JvIM,710
|
|
16
|
-
marsilea/plotter/arc.py,sha256=
|
|
17
|
-
marsilea/plotter/area.py,sha256=
|
|
18
|
-
marsilea/plotter/bar.py,sha256=
|
|
16
|
+
marsilea/plotter/arc.py,sha256=44BKVGvDc_OpghfgEvaiVCovZe7_OwZiM20iepaRMFw,8139
|
|
17
|
+
marsilea/plotter/area.py,sha256=zjjAhvgKHYe9rqzcseqZqhwfpgvzm0w2FRJ_vr9Fxm4,2650
|
|
18
|
+
marsilea/plotter/bar.py,sha256=RWDsNbyCUKbybpsBOgbl43lVZc_ynZmTOevE-CtJ5KE,12354
|
|
19
19
|
marsilea/plotter/base.py,sha256=b_NmrW_oNPc-HwQsjx1NsC2lknYK6qSaDp_7SxeoUEM,18938
|
|
20
|
-
marsilea/plotter/bio.py,sha256=
|
|
20
|
+
marsilea/plotter/bio.py,sha256=34tucmxs4LM3TFZoGsrjnXTolyrzYaHVEiRe4dzDH68,5040
|
|
21
21
|
marsilea/plotter/images.py,sha256=gb0xIQhUch3rNAt3FfvuUoamSGEynoBBBky2eE754ec,9560
|
|
22
22
|
marsilea/plotter/mesh.py,sha256=4jTa05GQsxStDur6FkrNGXAIHUsoipFEDydP8CMCExE,24376
|
|
23
|
-
marsilea/plotter/range.py,sha256=
|
|
23
|
+
marsilea/plotter/range.py,sha256=sXWKrvpq7nU7giiHPjayM7h9Q7gblhjXxHm8ioB3cm4,3770
|
|
24
24
|
marsilea/plotter/text.py,sha256=6S4mnAxLJLMkduKiyor03lPd86oTOJ5TojVREA9oU6s,37466
|
|
25
25
|
oncoprinter/__init__.py,sha256=efshcAD1h9s-NVJj4HLU9-hXc_LtTeIrNYqLHl-sm_g,106
|
|
26
26
|
oncoprinter/core.py,sha256=5KPnKW5ivlxPp14uJd0OtfTv-pXV2UEym8EbII2VCcw,11846
|
|
27
27
|
oncoprinter/preset.py,sha256=mBk2tFCqoTj_1ZZKRYuv4j2I3NTBa6Swc9wjzbmxRVw,8238
|
|
28
|
-
marsilea-0.
|
|
29
|
-
marsilea-0.
|
|
30
|
-
marsilea-0.
|
|
31
|
-
marsilea-0.
|
|
28
|
+
marsilea-0.5.0rc1.dist-info/METADATA,sha256=iQf49kl4rB5G0nDjejE6-BGqZ3y8z0pLs7tLrWEeGUs,6996
|
|
29
|
+
marsilea-0.5.0rc1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
30
|
+
marsilea-0.5.0rc1.dist-info/licenses/LICENSE,sha256=2TLD8FnLJqXzg8YBRs7W3VZBwfWfp4ArDfBl-rn96Qc,1074
|
|
31
|
+
marsilea-0.5.0rc1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|