marsilea 0.4.8__py3-none-any.whl → 0.5.0__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 CHANGED
@@ -1,6 +1,6 @@
1
1
  """Declarative creation of composable visualization"""
2
2
 
3
- __version__ = "0.4.8"
3
+ __version__ = "0.5.0"
4
4
 
5
5
  import marsilea.plotter as plotter
6
6
  from ._deform import Deformation
marsilea/base.py CHANGED
@@ -1142,142 +1142,6 @@ class ClusterBoard(WhiteBoard):
1142
1142
  rasterized=rasterized,
1143
1143
  )
1144
1144
 
1145
- def hsplit(self, cut=None, labels=None, order=None, spacing=0.01):
1146
- """Split the main canvas horizontally
1147
-
1148
- .. deprecated:: 0.5.0
1149
- Use :meth:`~marsilea.base.ClusterBoard.cut_rows` \
1150
- or :meth:`~marsilea.base.ClusterBoard.group_rows` instead
1151
-
1152
- Parameters
1153
- ----------
1154
- cut : array-like, optional
1155
- The index of your data to specify where to split the canvas
1156
- labels : array-like, optional
1157
- The labels of your data, must be the same length as the data
1158
- order : array-like, optional
1159
- The order of the unique labels
1160
- spacing : float, optional
1161
- The spacing between each split chunks, default is 0.01
1162
-
1163
- Examples
1164
- --------
1165
- Split the canvas by the unique labels
1166
-
1167
- .. plot::
1168
- :context: close-figs
1169
-
1170
- >>> data = np.random.rand(10, 11)
1171
- >>> import marsilea as ma
1172
- >>> h = ma.Heatmap(data)
1173
- >>> labels = ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A"]
1174
- >>> h.hsplit(labels=labels, order=["A", "B", "C"])
1175
- >>> h.add_left(ma.plotter.Labels(labels), pad=.1)
1176
- >>> h.render()
1177
-
1178
-
1179
- Split the canvas by the index
1180
-
1181
- .. plot::
1182
- :context: close-figs
1183
-
1184
- >>> h = ma.Heatmap(data)
1185
- >>> h.hsplit(cut=[4, 8])
1186
- >>> h.render()
1187
-
1188
-
1189
- """
1190
- warnings.warn(
1191
- DeprecationWarning(
1192
- "`hsplit` will be deprecated in v0.5.0, use `cut_rows` or `group_rows` instead"
1193
- ),
1194
- stacklevel=2,
1195
- )
1196
- if self._split_row:
1197
- raise SplitTwice(axis="horizontally")
1198
- self._split_row = True
1199
-
1200
- deform = self.get_deform()
1201
- deform.hspace = spacing
1202
- if cut is not None:
1203
- deform.set_split_row(breakpoints=cut)
1204
- else:
1205
- labels = np.asarray(labels)
1206
-
1207
- reindex, order = reorder_index(labels, order=order)
1208
- deform.set_data_row_reindex(reindex)
1209
-
1210
- breakpoints = get_breakpoints(labels[reindex])
1211
- deform.set_split_row(breakpoints=breakpoints, order=order)
1212
-
1213
- def vsplit(self, cut=None, labels=None, order=None, spacing=0.01):
1214
- """Split the main canvas vertically
1215
-
1216
- .. deprecated:: 0.5.0
1217
- Use :meth:`~marsilea.base.ClusterBoard.cut_cols` \
1218
- or :meth:`~marsilea.base.ClusterBoard.group_cols` instead
1219
-
1220
- Parameters
1221
- ----------
1222
- cut : array-like, optional
1223
- The index of your data to specify where to split the canvas
1224
- labels : array-like, optional
1225
- The labels of your data, must be the same length as the data
1226
- order : array-like, optional
1227
- The order of the unique labels
1228
- spacing : float, optional
1229
- The spacing between each split chunks, default is 0.01
1230
-
1231
- Examples
1232
- --------
1233
- Split the canvas by the unique labels
1234
-
1235
- .. plot::
1236
- :context: close-figs
1237
-
1238
- >>> data = np.random.rand(10, 11)
1239
- >>> import marsilea as ma
1240
- >>> h = ma.Heatmap(data)
1241
- >>> labels = ["A", "B", "C", "A", "B", "C", "A", "B", "C", "A", "B"]
1242
- >>> h.vsplit(labels=labels, order=["A", "B", "C"])
1243
- >>> h.add_top(ma.plotter.Labels(labels), pad=.1)
1244
- >>> h.render()
1245
-
1246
-
1247
- Split the canvas by the index
1248
-
1249
- .. plot::
1250
- :context: close-figs
1251
-
1252
- >>> h = ma.Heatmap(data)
1253
- >>> h.vsplit(cut=[4, 8])
1254
- >>> h.render()
1255
-
1256
-
1257
- """
1258
- warnings.warn(
1259
- DeprecationWarning(
1260
- "`vsplit` will be deprecated in v0.5.0, use `cut_cols` or `group_cols` instead"
1261
- ),
1262
- stacklevel=2,
1263
- )
1264
- if self._split_col:
1265
- raise SplitTwice(axis="vertically")
1266
- self._split_col = True
1267
-
1268
- deform = self.get_deform()
1269
- deform.wspace = spacing
1270
- if cut is not None:
1271
- deform.set_split_col(breakpoints=cut)
1272
- else:
1273
- labels = np.asarray(labels)
1274
-
1275
- reindex, order = reorder_index(labels, order=order)
1276
- deform.set_data_col_reindex(reindex)
1277
-
1278
- breakpoints = get_breakpoints(labels[reindex])
1279
- deform.set_split_col(breakpoints=breakpoints, order=order)
1280
-
1281
1145
  def group_rows(self, group, order=None, spacing=0.01):
1282
1146
  """Group rows into chunks
1283
1147
 
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)
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: marsilea
3
- Version: 0.4.8
4
- Dynamic: Summary
3
+ Version: 0.5.0
4
+ Summary: Declarative creation of composable visualizations
5
5
  Project-URL: Home, https://github.com/Marsilea-viz/marsilea
6
- Author: Zhihang Zheng
7
- Author-email: Mr-Milk <yzheng@cemm.at>
6
+ Project-URL: Documentation, https://marsilea.readthedocs.io
7
+ Author-email: Yimin Zheng <yzheng@cemm.at>, Zhihang Zheng <zhihang.zheng@connect.polyu.hk>
8
8
  License: The MIT License (MIT)
9
9
 
10
- Copyright (c) 2024 Mr-Milk
10
+ Copyright (c) 2025 Yimin Zheng
11
11
 
12
12
  Permission is hereby granted, free of charge, to any person obtaining a copy
13
13
  of this software and associated documentation files (the "Software"), to deal
@@ -30,6 +30,8 @@ License-File: LICENSE
30
30
  Classifier: Framework :: Matplotlib
31
31
  Classifier: License :: OSI Approved :: MIT License
32
32
  Classifier: Programming Language :: Python :: 3
33
+ Classifier: Topic :: Scientific/Engineering
34
+ Classifier: Topic :: Scientific/Engineering :: Visualization
33
35
  Requires-Python: >=3.8
34
36
  Requires-Dist: legendkit
35
37
  Requires-Dist: matplotlib>=3.6
@@ -38,20 +40,6 @@ Requires-Dist: pandas[parquet]
38
40
  Requires-Dist: platformdirs
39
41
  Requires-Dist: scipy
40
42
  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
43
  Description-Content-Type: text/markdown
56
44
 
57
45
  <p align="center">
@@ -66,6 +54,7 @@ Description-Content-Type: text/markdown
66
54
  ![pypi version](https://img.shields.io/pypi/v/marsilea?color=0098FF&logo=python&logoColor=white&style=flat-square)
67
55
  ![Conda Version](https://img.shields.io/conda/vn/conda-forge/marsilea?style=flat-square&logo=anaconda&logoColor=white&color=%2344A833)
68
56
  ![PyPI - License](https://img.shields.io/pypi/l/marsilea?color=FFD43B&style=flat-square)
57
+ [![DOI](https://img.shields.io/badge/DOI-10.1186%2Fs13059--024--03469--3-blue?color=0098FF&style=flat-square)](https://doi.org/10.1186/s13059-024-03469-3)
69
58
 
70
59
  # Marsilea: Declarative creation of composable visualization!
71
60
 
@@ -104,6 +93,16 @@ and then create a bar chart to show the expression of genes in different cell ty
104
93
  A visualization contains multiple plots is called a composable visualization.
105
94
  In Marsilea, we employ a declarative approach for user to create composable visualization incrementally.
106
95
 
96
+ ## Citation
97
+
98
+ If you use Marsilea in your research, please cite the following:
99
+
100
+ > Marsilea: an intuitive generalized paradigm for composable visualizations
101
+ >
102
+ > Yimin Zheng, Zhihang Zheng, André F. Rendeiro & Edwin Cheung
103
+ >
104
+ > _Genome Biology_ 2025 Jan 06. DOI: [10.1186/s13059-017-1382-0](https://doi.org/10.1186/s13059-024-03469-3)
105
+
107
106
  ## Examples
108
107
 
109
108
  <table>
@@ -1,11 +1,11 @@
1
- marsilea/__init__.py,sha256=4gKfHq47N9IViIzNNmV_ESrbrDwd1Lx2HnVonhJH42c,595
1
+ marsilea/__init__.py,sha256=0ws5dRLTu-1jr567U5FStwBhguxacSpj6oijY_23Eio,595
2
2
  marsilea/_api.py,sha256=tymWZHfjhx8-0NNd9762znfdIu36NrARRweEIr5L1mA,283
3
3
  marsilea/_deform.py,sha256=QRz4OGXMsQzbiIkC3ASzZayMPhHhoFsEK38oBzSeQG8,14440
4
- marsilea/base.py,sha256=WTQ1L2Geyt4KjrWWQMSrS-0Z2do2R7FOdBx5_2W8Z7w,51206
4
+ marsilea/base.py,sha256=CmzuwFu0JzgkNpPdI1SqAnkUxINShjT73hrJpksKjhE,46872
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=UhRcBFhx1JKrtndZPvQCDaiMt8Pb314PT1BtL-JndCY,4208
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
11
  marsilea/upset.py,sha256=JnqV9HYYpoeLt-6yMy0HN_PUSgV-ENasf6vq6HsX3cI,30393
@@ -25,7 +25,7 @@ marsilea/plotter/text.py,sha256=6S4mnAxLJLMkduKiyor03lPd86oTOJ5TojVREA9oU6s,3746
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.4.8.dist-info/METADATA,sha256=NAJopsdO64Z8Mtl5HQjEzZ2wm51Jv2eCjkD7UhKOqQc,6866
29
- marsilea-0.4.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
- marsilea-0.4.8.dist-info/licenses/LICENSE,sha256=2TLD8FnLJqXzg8YBRs7W3VZBwfWfp4ArDfBl-rn96Qc,1074
31
- marsilea-0.4.8.dist-info/RECORD,,
28
+ marsilea-0.5.0.dist-info/METADATA,sha256=lC8_51jHvIq0C6-k536cXZzsNGvYrx3ZqnOnOR74s2M,7023
29
+ marsilea-0.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
+ marsilea-0.5.0.dist-info/licenses/LICENSE,sha256=RhHHDuP61qzKmfHtOQUVLZfCgMkKx9PXzxzkLtmAjHo,1078
31
+ marsilea-0.5.0.dist-info/RECORD,,
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 Mr-Milk
3
+ Copyright (c) 2025 Yimin Zheng
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal