cellestial 0.48.2__tar.gz → 0.48.3__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.
- {cellestial-0.48.2 → cellestial-0.48.3}/PKG-INFO +1 -1
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/datasets/datasets.py +34 -24
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/layers/_deferred.py +16 -14
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/layers/arrow.py +2 -2
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/layers/bracket.py +22 -20
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/layers/ondata_legend.py +2 -2
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/layers/outline.py +2 -2
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/layers/stream.py +3 -3
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/basic/bar.py +2 -1
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/basic/scatter.py +2 -2
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/core/dimensional.py +0 -32
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/core/distribution.py +2 -38
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/core/distributions.py +2 -38
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/core/subdimensional.py +0 -128
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/core/subdimensionals.py +0 -162
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/differential/markers.py +27 -23
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/differential/volcano.py +73 -68
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/heatmap/_key_groups.py +17 -17
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/heatmap/_rank_genes_groups.py +10 -10
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/heatmap/dotplot.py +11 -11
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/heatmap/heatmap.py +39 -37
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/heatmap/stacked_violin.py +23 -27
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/quick/elbow.py +7 -5
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/spatial/_components.py +10 -8
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/spatial/spatial.py +4 -4
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/spatial/spatials.py +2 -2
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/util/save.py +5 -10
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/util/utilities.py +24 -20
- {cellestial-0.48.2 → cellestial-0.48.3}/pyproject.toml +1 -1
- {cellestial-0.48.2 → cellestial-0.48.3}/LICENSE +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/README.md +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/_version.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/datasets/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/frames/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/frames/build.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/frames/operations.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/layers/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/layers/utilities.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/base/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/base/base.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/basic/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/common/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/common/xyplot.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/common/xyplots.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/core/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/differential/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/heatmap/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/quick/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/quick/highest.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/single/quick/ridge.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/spatial/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/themes/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/themes/_distributions.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/themes/_heatmaps.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/themes/_scatters.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/util/__init__.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/util/colors.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/util/dendrogram.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/util/errors.py +0 -0
- {cellestial-0.48.2 → cellestial-0.48.3}/cellestial/util/operations.py +0 -0
|
@@ -70,19 +70,21 @@ def _run_steps(
|
|
|
70
70
|
"""
|
|
71
71
|
Drive a sequence of preprocessing steps with a tqdm progress bar.
|
|
72
72
|
|
|
73
|
-
Each step is a ``(label, code, action)`` triple. The bar description is set
|
|
74
|
-
to ``"{desc} | {label}: {code}"`` before ``action`` runs, so the user sees
|
|
75
|
-
both a human label and the underlying call. ``FutureWarning`` and
|
|
76
|
-
``UserWarning`` are silenced for the duration so they don't clutter the bar;
|
|
77
|
-
the suppression is scoped to this call only.
|
|
78
|
-
|
|
79
73
|
Parameters
|
|
80
74
|
----------
|
|
81
75
|
steps : Sequence[tuple[str, str, Callable[[], object]]]
|
|
82
|
-
Steps to execute in order.
|
|
83
|
-
short representation of the call,
|
|
76
|
+
Steps to execute in order. `label` is human-readable, `code` is a
|
|
77
|
+
short representation of the call, `action` performs the work.
|
|
84
78
|
desc : str
|
|
85
|
-
Prefix shown on every step's description, e.g.
|
|
79
|
+
Prefix shown on every step's description, e.g. `"Preprocessing pbmc3k"`.
|
|
80
|
+
|
|
81
|
+
Notes
|
|
82
|
+
-----
|
|
83
|
+
Each step is a `(label, code, action)` triple. The bar description is set
|
|
84
|
+
to `"{desc} | {label}: {code}"` before `action` runs, so the user sees
|
|
85
|
+
both a human label and the underlying call. `FutureWarning` and
|
|
86
|
+
`UserWarning` are silenced for the duration so they don't clutter the bar;
|
|
87
|
+
the suppression is scoped to this call only.
|
|
86
88
|
"""
|
|
87
89
|
import contextlib
|
|
88
90
|
import os
|
|
@@ -165,9 +167,6 @@ def pbmc3k(
|
|
|
165
167
|
"""
|
|
166
168
|
Download and preprocess the pbmc3k dataset.
|
|
167
169
|
|
|
168
|
-
Adopted from
|
|
169
|
-
https://scanpy.readthedocs.io/en/stable/tutorials/basics/clustering.html.
|
|
170
|
-
|
|
171
170
|
Parameters
|
|
172
171
|
----------
|
|
173
172
|
cache_directory : str | Path | PathLike
|
|
@@ -184,6 +183,11 @@ def pbmc3k(
|
|
|
184
183
|
-------
|
|
185
184
|
AnnData
|
|
186
185
|
The preprocessed pbmc3k dataset.
|
|
186
|
+
|
|
187
|
+
Notes
|
|
188
|
+
-----
|
|
189
|
+
Adopted from
|
|
190
|
+
https://scanpy.readthedocs.io/en/stable/tutorials/basics/clustering.html.
|
|
187
191
|
"""
|
|
188
192
|
_require_extras("pbmc3k", "scanpy", "pooch")
|
|
189
193
|
|
|
@@ -426,15 +430,12 @@ def from_url(
|
|
|
426
430
|
bring: bool = True,
|
|
427
431
|
) -> AnnData:
|
|
428
432
|
"""
|
|
429
|
-
Download an
|
|
430
|
-
|
|
431
|
-
Generic loader for any host that serves an AnnData ``.h5ad`` file at a
|
|
432
|
-
stable URL (CELLxGENE, Zenodo, Figshare, S3 buckets, etc.).
|
|
433
|
+
Download an `.h5ad` dataset from a direct HTTP(S) URL.
|
|
433
434
|
|
|
434
435
|
Parameters
|
|
435
436
|
----------
|
|
436
437
|
url : str
|
|
437
|
-
Direct URL to a downloadable
|
|
438
|
+
Direct URL to a downloadable `.h5ad` file.
|
|
438
439
|
name : str, optional
|
|
439
440
|
Name for the cached file (without extension). If omitted, the cache
|
|
440
441
|
filename is derived from the URL's last path segment.
|
|
@@ -459,6 +460,11 @@ def from_url(
|
|
|
459
460
|
If `name` is not given and no filename can be derived from `url`.
|
|
460
461
|
OSError
|
|
461
462
|
If the downloaded file size does not match the expected size.
|
|
463
|
+
|
|
464
|
+
Notes
|
|
465
|
+
-----
|
|
466
|
+
Generic loader for any host that serves an AnnData `.h5ad` file at a
|
|
467
|
+
stable URL (CELLxGENE, Zenodo, Figshare, S3 buckets, etc.).
|
|
462
468
|
"""
|
|
463
469
|
from urllib.parse import urlparse
|
|
464
470
|
from urllib.request import urlopen
|
|
@@ -528,15 +534,12 @@ def from_cellxgene(
|
|
|
528
534
|
"""
|
|
529
535
|
Download a dataset from CELLxGENE by URL or UUID.
|
|
530
536
|
|
|
531
|
-
Thin wrapper around `from_url` that accepts a CELLxGENE dataset UUID
|
|
532
|
-
directly and constructs the canonical download URL.
|
|
533
|
-
|
|
534
537
|
Parameters
|
|
535
538
|
----------
|
|
536
539
|
source : str
|
|
537
540
|
A CELLxGENE dataset UUID (e.g.
|
|
538
|
-
|
|
539
|
-
|
|
541
|
+
`7cdea341-ca7a-40fd-8192-b8ecb2d7b91e`) or a full `.h5ad` URL (e.g.
|
|
542
|
+
`https://datasets.cellxgene.cziscience.com/<uuid>.h5ad`).
|
|
540
543
|
name : str, optional
|
|
541
544
|
Name for the cached file (without extension). Defaults to the dataset
|
|
542
545
|
UUID parsed from `source`.
|
|
@@ -561,6 +564,11 @@ def from_cellxgene(
|
|
|
561
564
|
If `source` is neither a CELLxGENE dataset UUID nor a URL containing one.
|
|
562
565
|
OSError
|
|
563
566
|
If the downloaded file size does not match the expected size.
|
|
567
|
+
|
|
568
|
+
Notes
|
|
569
|
+
-----
|
|
570
|
+
Thin wrapper around `from_url` that accepts a CELLxGENE dataset UUID
|
|
571
|
+
directly and constructs the canonical download URL.
|
|
564
572
|
"""
|
|
565
573
|
match = _UUID_PATTERN.search(source)
|
|
566
574
|
if match is None:
|
|
@@ -594,8 +602,6 @@ def breast_cancer_atlas(
|
|
|
594
602
|
"""
|
|
595
603
|
Download the breast cancer cell atlas from CELLxGENE.
|
|
596
604
|
|
|
597
|
-
Thin wrapper around `from_cellxgene` with the atlas UUID baked in.
|
|
598
|
-
|
|
599
605
|
Parameters
|
|
600
606
|
----------
|
|
601
607
|
cache_directory : str | Path | PathLike
|
|
@@ -617,6 +623,10 @@ def breast_cancer_atlas(
|
|
|
617
623
|
------
|
|
618
624
|
OSError
|
|
619
625
|
If the downloaded file size does not match the expected size.
|
|
626
|
+
|
|
627
|
+
Notes
|
|
628
|
+
-----
|
|
629
|
+
Thin wrapper around `from_cellxgene` with the atlas UUID baked in.
|
|
620
630
|
"""
|
|
621
631
|
return from_cellxgene(
|
|
622
632
|
"7cdea341-ca7a-40fd-8192-b8ecb2d7b91e",
|
|
@@ -14,25 +14,27 @@ class DeferredLayer(PlotSpec):
|
|
|
14
14
|
"""
|
|
15
15
|
A layer whose construction depends on an existing plot's data and aesthetics.
|
|
16
16
|
|
|
17
|
-
Built by cellestial layer functions that need to introspect the plot they are
|
|
18
|
-
added to. Rather than taking the plot explicitly (``plot + cl.layer(plot)``),
|
|
19
|
-
the real layer is assembled at ``+`` time via :meth:`__radd__`, so callers
|
|
20
|
-
write ``plot + cl.layer()``.
|
|
21
|
-
|
|
22
|
-
Why subclass ``PlotSpec``? Python's reflected operator priority rule says
|
|
23
|
-
that when the right operand's class is a subclass of the left operand's
|
|
24
|
-
class, ``b.__radd__(a)`` is tried *before* ``a.__add__(b)``. Lets-Plot's
|
|
25
|
-
``PlotSpec.__add__`` raises ``TypeError`` for unknown types instead of
|
|
26
|
-
returning ``NotImplemented``, so the usual ``__radd__`` fallback would
|
|
27
|
-
never fire, subclassing restores that fallback via the priority rule.
|
|
28
|
-
The base ``__init__`` is deliberately bypassed because ``DeferredLayer``
|
|
29
|
-
does not carry real plot data; only :meth:`__radd__` is ever used.
|
|
30
|
-
|
|
31
17
|
Parameters
|
|
32
18
|
----------
|
|
33
19
|
builder : Callable[[PlotSpec], LayerSpec | FeatureSpec | FeatureSpecArray]
|
|
34
20
|
Callable that accepts the receiving plot and returns the concrete layer
|
|
35
21
|
(or a feature array) to add to it.
|
|
22
|
+
|
|
23
|
+
Notes
|
|
24
|
+
-----
|
|
25
|
+
Built by cellestial layer functions that need to introspect the plot they are
|
|
26
|
+
added to. Rather than taking the plot explicitly (`plot + cl.layer(plot)`),
|
|
27
|
+
the real layer is assembled at `+` time via :meth:`__radd__`, so callers
|
|
28
|
+
write `plot + cl.layer()`.
|
|
29
|
+
|
|
30
|
+
Why subclass `PlotSpec`? Python's reflected operator priority rule says
|
|
31
|
+
that when the right operand's class is a subclass of the left operand's
|
|
32
|
+
class, `b.__radd__(a)` is tried *before* `a.__add__(b)`. Lets-Plot's
|
|
33
|
+
`PlotSpec.__add__` raises `TypeError` for unknown types instead of
|
|
34
|
+
returning `NotImplemented`, so the usual `__radd__` fallback would
|
|
35
|
+
never fire, subclassing restores that fallback via the priority rule.
|
|
36
|
+
The base `__init__` is deliberately bypassed because `DeferredLayer`
|
|
37
|
+
does not carry real plot data; only :meth:`__radd__` is ever used.
|
|
36
38
|
"""
|
|
37
39
|
|
|
38
40
|
__slots__ = ("_builder",)
|
|
@@ -148,8 +148,8 @@ def arrow_axis(
|
|
|
148
148
|
----------
|
|
149
149
|
plot : PlotSpec | None, default=None
|
|
150
150
|
If provided, the arrow axis is built from this plot's data and aesthetics
|
|
151
|
-
regardless of which plot the resulting layer is added to. When
|
|
152
|
-
the layer is deferred and introspects the plot it is added to via
|
|
151
|
+
regardless of which plot the resulting layer is added to. When `None`,
|
|
152
|
+
the layer is deferred and introspects the plot it is added to via `+`.
|
|
153
153
|
size : float
|
|
154
154
|
Size of the arrow.
|
|
155
155
|
color : str
|
|
@@ -278,21 +278,18 @@ def bracket(
|
|
|
278
278
|
"""
|
|
279
279
|
Layer of `geom_bracket` annotating pairwise significance between groups.
|
|
280
280
|
|
|
281
|
-
Pairwise tests are computed from the plot's retrieved DataFrame using the `x`
|
|
282
|
-
aesthetic as the grouping column and the `y` aesthetic as the value column.
|
|
283
|
-
|
|
284
281
|
Parameters
|
|
285
282
|
----------
|
|
286
283
|
plot : PlotSpec | None, default=None
|
|
287
284
|
If provided, brackets are computed from this plot's data and aesthetics
|
|
288
|
-
regardless of which plot the resulting layer is added to. When
|
|
289
|
-
the layer is deferred and introspects the plot it is added to via
|
|
285
|
+
regardless of which plot the resulting layer is added to. When `None`,
|
|
286
|
+
the layer is deferred and introspects the plot it is added to via `+`.
|
|
290
287
|
Expected to be a distribution plot (e.g. `violin`, `boxplot`).
|
|
291
288
|
comparisons : Sequence[Sequence[str]] | None, default=None
|
|
292
|
-
Specific group pairs to test, e.g.
|
|
289
|
+
Specific group pairs to test, e.g. `[("A", "B"), ("A", "C")]`.
|
|
293
290
|
If None, every pair of groups present in the plot is compared.
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
`"*"` on either side expands to all other groups, so
|
|
292
|
+
`[("A", "*")]` compares `A` against every remaining group.
|
|
296
293
|
test : {'mannwhitney', 'ttest'}, default='mannwhitney'
|
|
297
294
|
Statistical test used for each pairwise comparison.
|
|
298
295
|
'mannwhitney' is non-parametric and recommended for expression data.
|
|
@@ -303,41 +300,41 @@ def bracket(
|
|
|
303
300
|
Multiple-testing correction applied across the pairwise p-values.
|
|
304
301
|
label : {'stars', 'pvalue', 'padj'} or sequence of those, default='stars'
|
|
305
302
|
The bracket label to draw.
|
|
306
|
-
'stars' maps p-values to asterisks (
|
|
307
|
-
|
|
303
|
+
'stars' maps p-values to asterisks (`****` < 0.0001, `***` < 0.001,
|
|
304
|
+
`**` < 0.01, `*` < 0.05, `ns` otherwise).
|
|
308
305
|
'pvalue' prints the raw p-value and 'padj' prints the adjusted p-value.
|
|
309
306
|
A sequence merges each component with a newline, e.g.
|
|
310
|
-
|
|
307
|
+
`label=("stars", "padj")` stacks the stars on top of the adjusted p-value.
|
|
311
308
|
label_format : str, default='.3g'
|
|
312
309
|
Format string used when `label` contains 'pvalue' or 'padj'.
|
|
313
310
|
prefix : str, default=''
|
|
314
311
|
Text prepended to the numeric p-value/padj labels. Ignored for the
|
|
315
312
|
'stars' component. When `prefix_style` is '=' or '<', the symbol is
|
|
316
313
|
inserted between `prefix` and the value with whitespace around it,
|
|
317
|
-
so
|
|
314
|
+
so `prefix='p'` with `prefix_style='='` renders `'p = 0.001'`.
|
|
318
315
|
When `prefix_style` is None, `prefix` is used as-is, so the caller
|
|
319
316
|
is responsible for including any symbol and spacing.
|
|
320
317
|
prefix_style : {'=', '<'} or None, default='='
|
|
321
318
|
How the numeric portion of the label is rendered.
|
|
322
|
-
'=' shows the actual p-value with
|
|
319
|
+
'=' shows the actual p-value with `' = '` inserted after `prefix`.
|
|
323
320
|
'<' replaces the p-value with the star-bracket threshold it falls
|
|
324
|
-
below, with
|
|
325
|
-
|
|
326
|
-
Non-significant comparisons render as
|
|
321
|
+
below, with `' < '` inserted after `prefix`, giving
|
|
322
|
+
`'p < 0.0001'`, `'p < 0.001'`, `'p < 0.01'`, or `'p < 0.05'`.
|
|
323
|
+
Non-significant comparisons render as `'p > 0.05'`.
|
|
327
324
|
None disables symbol insertion; the caller supplies any symbol via
|
|
328
325
|
`prefix`.
|
|
329
326
|
separator : str, default=' '
|
|
330
327
|
Separator used to join components when `label` is a sequence with
|
|
331
|
-
more than one entry (e.g.
|
|
328
|
+
more than one entry (e.g. `('stars', 'padj')`).
|
|
332
329
|
threshold : float | None, default=None
|
|
333
330
|
If provided, only comparisons whose p-value (adjusted if `correction` is not
|
|
334
331
|
'none') is below this threshold are drawn.
|
|
335
332
|
y_position : float | None, default=None
|
|
336
333
|
Vertical position of the lowest bracket. If None, it is placed above
|
|
337
|
-
the maximum `y` value with a gap of
|
|
334
|
+
the maximum `y` value with a gap of `y_padding * y_range`.
|
|
338
335
|
y_step : float | None, default=None
|
|
339
336
|
Vertical spacing between stacked brackets. If None, defaults to
|
|
340
|
-
|
|
337
|
+
`y_padding * y_range`.
|
|
341
338
|
y_padding : float, default=0.08
|
|
342
339
|
Fraction of the `y` range used as vertical padding above the data
|
|
343
340
|
and as the default spacing between stacked brackets.
|
|
@@ -377,6 +374,11 @@ def bracket(
|
|
|
377
374
|
If a statistical option or label option is invalid, or there are too
|
|
378
375
|
few observations to compute brackets.
|
|
379
376
|
|
|
377
|
+
Notes
|
|
378
|
+
-----
|
|
379
|
+
Pairwise tests are computed from the plot's retrieved DataFrame using the `x`
|
|
380
|
+
aesthetic as the grouping column and the `y` aesthetic as the value column.
|
|
381
|
+
|
|
380
382
|
Examples
|
|
381
383
|
--------
|
|
382
384
|
Annotate a violin plot (or boxplot) with pairwise significance stars.
|
|
@@ -414,7 +416,7 @@ def bracket(
|
|
|
414
416
|
y_padding=0.2,
|
|
415
417
|
)
|
|
416
418
|
|
|
417
|
-
Use
|
|
419
|
+
Use `"*"` to compare one group against every other.
|
|
418
420
|
|
|
419
421
|
.. jupyter-execute::
|
|
420
422
|
:emphasize-lines: 2
|
|
@@ -52,8 +52,8 @@ def ondata_legend(
|
|
|
52
52
|
----------
|
|
53
53
|
plot : PlotSpec | None, default=None
|
|
54
54
|
If provided, labels are computed from this plot's data and aesthetics
|
|
55
|
-
regardless of which plot the resulting layer is added to. When
|
|
56
|
-
the layer is deferred and introspects the plot it is added to via
|
|
55
|
+
regardless of which plot the resulting layer is added to. When `None`,
|
|
56
|
+
the layer is deferred and introspects the plot it is added to via `+`.
|
|
57
57
|
x : str | None, default=None
|
|
58
58
|
The column name in the data used for x-axis coordinates. e.g 'X_UMAP1'.
|
|
59
59
|
If None, it will be inferred from the plot aesthetics.
|
|
@@ -120,8 +120,8 @@ def cluster_outlines(
|
|
|
120
120
|
E.g `groups=[['A', 'B']]` will outline groups A and B as if they were one cluster.
|
|
121
121
|
plot : PlotSpec | None, default=None
|
|
122
122
|
If provided, outlines are computed from this plot's data and aesthetics
|
|
123
|
-
regardless of which plot the resulting layer is added to. When
|
|
124
|
-
the layer is deferred and introspects the plot it is added to via
|
|
123
|
+
regardless of which plot the resulting layer is added to. When `None`,
|
|
124
|
+
the layer is deferred and introspects the plot it is added to via `+`.
|
|
125
125
|
padding : float, default=1.5
|
|
126
126
|
The spatial buffer added to the cluster's bounding box before calculating density.
|
|
127
127
|
Increasing this value allows the density 'cloud' to expand further from the outermost
|
|
@@ -50,8 +50,8 @@ def stream(
|
|
|
50
50
|
----------
|
|
51
51
|
plot : PlotSpec | None, default=None
|
|
52
52
|
If provided, streams are computed from this plot's data and aesthetics
|
|
53
|
-
regardless of which plot the resulting layer is added to. When
|
|
54
|
-
the layer is deferred and introspects the plot it is added to via
|
|
53
|
+
regardless of which plot the resulting layer is added to. When `None`,
|
|
54
|
+
the layer is deferred and introspects the plot it is added to via `+`.
|
|
55
55
|
color : str, default="#1f1f1f"
|
|
56
56
|
Color of the stream lines.
|
|
57
57
|
alpha : float, default=0.7
|
|
@@ -153,7 +153,7 @@ def stream(
|
|
|
153
153
|
|
|
154
154
|
Stream as a separate layer to showcase the modularity of layers in Cellestial.
|
|
155
155
|
Here the data source is passed explicitly because the receiving plot
|
|
156
|
-
(
|
|
156
|
+
(`ggplot()`) has no embedding to introspect.
|
|
157
157
|
|
|
158
158
|
.. jupyter-execute::
|
|
159
159
|
|
|
@@ -97,7 +97,8 @@ def bar(
|
|
|
97
97
|
if variable_keys is None:
|
|
98
98
|
variable_keys = _select_variable_keys(data, keys)
|
|
99
99
|
else:
|
|
100
|
-
list(variable_keys)
|
|
100
|
+
variable_keys = list(variable_keys)
|
|
101
|
+
variable_keys.extend(_select_variable_keys(data, keys))
|
|
101
102
|
axis = axis or _determine_axis(data=data, keys=keys)
|
|
102
103
|
# BUILD: the bar plot
|
|
103
104
|
br = baseplot(
|
|
@@ -123,8 +123,8 @@ def scatter(
|
|
|
123
123
|
if variable_keys is None:
|
|
124
124
|
variable_keys = _select_variable_keys(data, keys)
|
|
125
125
|
else:
|
|
126
|
-
list(variable_keys)
|
|
127
|
-
|
|
126
|
+
variable_keys = list(variable_keys)
|
|
127
|
+
variable_keys.extend(_select_variable_keys(data, keys))
|
|
128
128
|
axis = axis or _determine_axis(data=data, keys=keys)
|
|
129
129
|
# BUILD: the scatter plot
|
|
130
130
|
scttr = baseplot(
|
|
@@ -102,34 +102,10 @@ def dimensional(
|
|
|
102
102
|
The name to give to barcode (or index) column in the dataframe.
|
|
103
103
|
color_low : str, default='#e6e6e6'
|
|
104
104
|
The color to use for the low end of the color gradient.
|
|
105
|
-
|
|
106
|
-
**Accepts:**
|
|
107
|
-
|
|
108
|
-
- hex code e.g. '#f1f1f1'
|
|
109
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
110
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
111
|
-
- Applies to continuous (non-categorical) data.
|
|
112
|
-
|
|
113
105
|
color_mid : str, default=None
|
|
114
106
|
The color to use for the middle part of the color gradient.
|
|
115
|
-
|
|
116
|
-
**Accepts:**
|
|
117
|
-
|
|
118
|
-
- hex code e.g. '#f1f1f1'
|
|
119
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
120
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
121
|
-
- Applies to continuous (non-categorical) data.
|
|
122
|
-
|
|
123
107
|
color_high : str, default='#377EB8'
|
|
124
108
|
The color to use for the high end of the color gradient.
|
|
125
|
-
|
|
126
|
-
**Accepts:**
|
|
127
|
-
|
|
128
|
-
- hex code e.g. '#f1f1f1'
|
|
129
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
130
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
131
|
-
- Applies to continuous (non-categorical) data.
|
|
132
|
-
|
|
133
109
|
mid_point : {'mean', 'median', 'mid'} | float, default='median'
|
|
134
110
|
The midpoint (in data value) of the color gradient.
|
|
135
111
|
Can be 'mean', 'median' and 'mid' or a number (float or int).
|
|
@@ -145,14 +121,6 @@ def dimensional(
|
|
|
145
121
|
Size of the arrow.
|
|
146
122
|
arrow_color : str, default='#3f3f3f'
|
|
147
123
|
Color of the arrows.
|
|
148
|
-
|
|
149
|
-
**Accepts:**
|
|
150
|
-
|
|
151
|
-
- hex code e.g. '#f1f1f1'
|
|
152
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
153
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
154
|
-
|
|
155
|
-
|
|
156
124
|
arrow_angle : float, default=10
|
|
157
125
|
Angle of the arrow head in degrees.
|
|
158
126
|
legend_ondata: bool, default=False
|
|
@@ -259,7 +259,7 @@ def violin(
|
|
|
259
259
|
e.g., 'total_counts' or a gene name.
|
|
260
260
|
group_by : str | None, default=None
|
|
261
261
|
Column to group observations on the x-axis.
|
|
262
|
-
If not provided, falls back to
|
|
262
|
+
If not provided, falls back to `fill`, `color`, or the variable column.
|
|
263
263
|
mapping : FeatureSpec | None, default=None
|
|
264
264
|
Additional aesthetic mappings for the plot, the result of `aes()`.
|
|
265
265
|
axis : {0,1} | None, default=None
|
|
@@ -282,28 +282,10 @@ def violin(
|
|
|
282
282
|
Use 'none' to disable tooltips.
|
|
283
283
|
geom_fill : str | None, default=None
|
|
284
284
|
Fill color for all violins in the violin plot.
|
|
285
|
-
|
|
286
|
-
**Accepts:**
|
|
287
|
-
|
|
288
|
-
- hex code e.g. '#f1f1f1'
|
|
289
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
290
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
291
285
|
geom_color : str | None, default=None
|
|
292
286
|
Border color for all violins in the violin plot.
|
|
293
|
-
|
|
294
|
-
**Accepts:**
|
|
295
|
-
|
|
296
|
-
- hex code e.g. '#f1f1f1'
|
|
297
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
298
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
299
287
|
point_color : str, default='#1f1f1f'
|
|
300
288
|
Color for the points in the violin plot.
|
|
301
|
-
|
|
302
|
-
**Accepts:**
|
|
303
|
-
|
|
304
|
-
- hex code e.g. '#f1f1f1'
|
|
305
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
306
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
307
289
|
point_alpha : float, default=0.7
|
|
308
290
|
Alpha (transparency) for the points in the violin plot.
|
|
309
291
|
point_size : float, default=0.5
|
|
@@ -501,7 +483,7 @@ def boxplot(
|
|
|
501
483
|
e.g., 'total_counts' or a gene name.
|
|
502
484
|
group_by : str | None, default=None
|
|
503
485
|
Column to group observations on the x-axis.
|
|
504
|
-
If not provided, falls back to
|
|
486
|
+
If not provided, falls back to `fill`, `color`, or the variable column.
|
|
505
487
|
mapping : FeatureSpec | None, default=None
|
|
506
488
|
Additional aesthetic mappings for the plot, the result of `aes()`.
|
|
507
489
|
axis : {0,1} | None, default=None
|
|
@@ -524,28 +506,10 @@ def boxplot(
|
|
|
524
506
|
Use 'none' to disable tooltips.
|
|
525
507
|
geom_fill : str | None, default=None
|
|
526
508
|
Fill color for all boxplots in the boxplot.
|
|
527
|
-
|
|
528
|
-
**Accepts:**
|
|
529
|
-
|
|
530
|
-
- hex code e.g. '#f1f1f1'
|
|
531
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
532
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
533
509
|
geom_color : str | None, default=None
|
|
534
510
|
Border color for all boxplots in the boxplot.
|
|
535
|
-
|
|
536
|
-
**Accepts:**
|
|
537
|
-
|
|
538
|
-
- hex code e.g. '#f1f1f1'
|
|
539
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
540
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
541
511
|
point_color : str, default='#1f1f1f'
|
|
542
512
|
Color for the points in the boxplot.
|
|
543
|
-
|
|
544
|
-
**Accepts:**
|
|
545
|
-
|
|
546
|
-
- hex code e.g. '#f1f1f1'
|
|
547
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
548
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
549
513
|
point_alpha : float, default=0.7
|
|
550
514
|
Alpha (transparency) for the points in the boxplot.
|
|
551
515
|
point_size : float, default=0.5
|
|
@@ -69,7 +69,7 @@ def violins(
|
|
|
69
69
|
e.g., ['total_counts', 'pct_counts_in_top_50_genes'] or a list of gene names.
|
|
70
70
|
group_by : str | None, default=None
|
|
71
71
|
Column to group observations on the x-axis.
|
|
72
|
-
If not provided, falls back to
|
|
72
|
+
If not provided, falls back to `fill`, `color`, or the variable column.
|
|
73
73
|
mapping : FeatureSpec | None, default=None
|
|
74
74
|
Additional aesthetic mappings for the plot, the result of `aes()`.
|
|
75
75
|
axis : {0,1} | None, default=None
|
|
@@ -90,28 +90,10 @@ def violins(
|
|
|
90
90
|
Use 'none' to disable tooltips.
|
|
91
91
|
geom_fill : str | None, default=None
|
|
92
92
|
Fill color for all violins in the violin plot.
|
|
93
|
-
|
|
94
|
-
**Accepts:**
|
|
95
|
-
|
|
96
|
-
- hex code e.g. '#f1f1f1'
|
|
97
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
98
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
99
93
|
geom_color : str | None, default=None
|
|
100
94
|
Border color for all violins in the violin plot.
|
|
101
|
-
|
|
102
|
-
**Accepts:**
|
|
103
|
-
|
|
104
|
-
- hex code e.g. '#f1f1f1'
|
|
105
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
106
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
107
95
|
point_color : str, default='#1f1f1f'
|
|
108
96
|
Color for the points in the violin plot.
|
|
109
|
-
|
|
110
|
-
**Accepts:**
|
|
111
|
-
|
|
112
|
-
- hex code e.g. '#f1f1f1'
|
|
113
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
114
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
115
97
|
point_alpha : float, default=0.7
|
|
116
98
|
Alpha (transparency) for the points in the violin plot.
|
|
117
99
|
point_size : float, default=0.5
|
|
@@ -326,7 +308,7 @@ def boxplots(
|
|
|
326
308
|
e.g., ['total_counts', 'pct_counts_in_top_50_genes'] or a list of gene names.
|
|
327
309
|
group_by : str | None, default=None
|
|
328
310
|
Column to group observations on the x-axis.
|
|
329
|
-
If not provided, falls back to
|
|
311
|
+
If not provided, falls back to `fill`, `color`, or the variable column.
|
|
330
312
|
mapping : FeatureSpec | None, default=None
|
|
331
313
|
Additional aesthetic mappings for the plot, the result of `aes()`.
|
|
332
314
|
axis : {0,1} | None, default=None
|
|
@@ -347,28 +329,10 @@ def boxplots(
|
|
|
347
329
|
Use 'none' to disable tooltips.
|
|
348
330
|
geom_fill : str | None, default=None
|
|
349
331
|
Fill color for all boxplots in the boxplot.
|
|
350
|
-
|
|
351
|
-
**Accepts:**
|
|
352
|
-
|
|
353
|
-
- hex code e.g. '#f1f1f1'
|
|
354
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
355
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
356
332
|
geom_color : str | None, default=None
|
|
357
333
|
Border color for all boxplots in the boxplot.
|
|
358
|
-
|
|
359
|
-
**Accepts:**
|
|
360
|
-
|
|
361
|
-
- hex code e.g. '#f1f1f1'
|
|
362
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
363
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
364
334
|
point_color : str, default='#1f1f1f'
|
|
365
335
|
Color for the points in the boxplot.
|
|
366
|
-
|
|
367
|
-
**Accepts:**
|
|
368
|
-
|
|
369
|
-
- hex code e.g. '#f1f1f1'
|
|
370
|
-
- color name (https://lets-plot.org/python/pages/named_colors.html).
|
|
371
|
-
- RGB/RGBA e.g. 'rgb(0, 0, 255)', 'rgba(0, 0, 255, 0.5)'.
|
|
372
336
|
point_alpha : float, default=0.7
|
|
373
337
|
Alpha (transparency) for the points in the boxplot.
|
|
374
338
|
point_size : float, default=0.5
|