Skip to content

Commit cf60c30

Browse files
d33bspre-commit-ci-lite[bot]jenna-tomkinson
authored
Add display option for multi-scroll filter selection by column with threshold indicators (#203)
* initial work towards feature scroll filters * scroll bars for filters * relative spacing for scroll plot * scroll filter plot threshold indicators * binning and such * [pre-commit.ci lite] apply automatic fixes * fine tuning and docs * linting * address coderabbit review suggestions * ignore notebook file imports * [pre-commit.ci lite] apply automatic fixes * addressing copilot review suggestions * tighter kde plotting for y-axis visuals * [pre-commit.ci lite] apply automatic fixes * address coderabbit comment * [pre-commit.ci lite] apply automatic fixes * address coderabbit comments * updates from jennas review Co-Authored-By: Jenna Tomkinson <107513215+jenna-tomkinson@users.noreply.github.com> --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Jenna Tomkinson <107513215+jenna-tomkinson@users.noreply.github.com>
1 parent d61c01e commit cf60c30

File tree

7 files changed

+2177
-168
lines changed

7 files changed

+2177
-168
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
- id: check-yaml
1616
- id: detect-private-key
1717
- repo: https://github.com/tox-dev/pyproject-fmt
18-
rev: "v2.18.1"
18+
rev: "v2.19.0"
1919
hooks:
2020
- id: pyproject-fmt
2121
- repo: https://github.com/codespell-project/codespell
@@ -50,7 +50,7 @@ repos:
5050
hooks:
5151
- id: actionlint
5252
- repo: https://github.com/astral-sh/ruff-pre-commit
53-
rev: "v0.15.5"
53+
rev: "v0.15.6"
5454
hooks:
5555
- id: ruff-format
5656
- id: ruff-check

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ For 3D notebook display behavior:
3030
- Disable automatic trame switching with `display_options={"auto_trame_for_3d": False}`.
3131
- Force trame layout regardless of auto-detection with `display_options={"view": "trame"}`.
3232

33+
For row display in notebook/widget tables:
34+
35+
- CytoDataFrame respects pandas display settings (`display.max_rows`, `display.min_rows`).
36+
- When the table is larger than `display.max_rows`, the widget table inserts a midpoint ellipsis row (``) to indicate omitted rows.
37+
- You can control truncation behavior by changing pandas display options before rendering.
38+
3339
📓 ___Want to see CytoDataFrame in action?___ Check out our [example notebook](docs/src/examples/cytodataframe_at_a_glance.ipynb) for a quick tour of its key features.
3440

3541
> ✨ CytoDataFrame development began within **[coSMicQC](https://github.com/cytomining/coSMicQC)** - a single-cell profile quality control package.

docs/src/examples/cytodataframe_at_a_glance.ipynb

Lines changed: 621 additions & 87 deletions
Large diffs are not rendered by default.

docs/src/examples/cytodataframe_at_a_glance.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
[
4646
"Metadata_ImageNumber",
4747
"Cells_Number_Object_Number",
48+
"Nuclei_Texture_Variance_RNA_5_03_256",
4849
"Image_FileName_OrigAGP",
4950
"Image_FileName_OrigDNA",
5051
"Image_FileName_OrigRNA",
@@ -305,6 +306,28 @@
305306
]
306307
][:3]
307308

309+
# %%time
310+
# view nuclear speckles data with images and overlaid outlines from masks
311+
# and also apply a filter to only show rows where the value for
312+
# "Nuclei_Texture_Variance_DAPI_3_03_256".
313+
CytoDataFrame(
314+
data=f"{nuclear_speckles_path}/test_slide1_converted.parquet",
315+
data_context_dir=f"{nuclear_speckles_path}/images/plate1",
316+
data_mask_context_dir=f"{nuclear_speckles_path}/masks/plate1",
317+
display_options={
318+
"filter_columns": ["Nuclei_Texture_Variance_DAPI_3_03_256"],
319+
},
320+
)[
321+
[
322+
"Metadata_ImageNumber",
323+
"Nuclei_Number_Object_Number",
324+
"Nuclei_Texture_Variance_DAPI_3_03_256",
325+
"Image_FileName_A647",
326+
"Image_FileName_DAPI",
327+
"Image_FileName_GOLD",
328+
]
329+
]
330+
308331
# %%time
309332
# view ALSF pediatric cancer atlas plate BR00143976 with images
310333
cdf = CytoDataFrame(
@@ -356,7 +379,6 @@
356379
cdf[["ImageNumber", "ObjectNumber", "FileName_Nuclei"]][:3]
357380
# +
358381
# %%time
359-
360382
# read 3d images with segmentation masks and show the
361383
# segmentation masks are also 3D.
362384
cdf = CytoDataFrame(

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ lint.select = [
110110
]
111111
# Ignore `E402` and `F401` (unused imports) in all `__init__.py` files
112112
lint.per-file-ignores."__init__.py" = [ "E402", "F401" ]
113+
lint.per-file-ignores."docs/src/examples/cytodataframe_at_a_glance.py" = [ "E402" ]
113114
lint.per-file-ignores."src/cytodataframe/*.py" = [ "ANN401", "PLC0415" ]
114115
lint.per-file-ignores."src/cytodataframe/image.py" = [ "PLR2004" ]
115116
# ignore typing rules for tests

0 commit comments

Comments
 (0)