Skip to main content

CytoDataFrame

PyPI - Version Build Status Coverage Status Ruff uv Software DOI badge

CytoDataFrame extends Pandas functionality to help display single-cell profile data alongside related images.

CytoDataFrame is an advanced in-memory data analysis format designed for single-cell profiling, integrating not only the data profiles but also their corresponding microscopy images and segmentation masks. Traditional single-cell profiling often excludes the associated images from analysis, limiting the scope of research. CytoDataFrame bridges this gap, offering a purpose-built solution for comprehensive analysis that incorporates both the data and images, empowering more detailed and visual insights in single-cell research.

CytoDataFrame is best suited for work within Jupyter notebooks. With CytoDataFrame you can:

  • View image objects alongside their feature data using a Pandas DataFrame-like interface.
  • Highlight image objects using mask or outline files to understand their segmentation.
  • Merge multiple channels into a single single-cell crop composite (similar to a Fiji composite) with display_options={"composite_channels": "all"} or a per-channel color mapping such as display_options={"composite_channels": {"OrigDNA": "cyan", "OrigRNA": "#ff00ff"}} (colors may be names, hex codes, or RGB tuples; cyan/magenta/yellow read more clearly than red/green/blue where channels overlap). A color legend is shown with the table, and display_options={"equalize_clip_limit": 0.01} gives a milder, less over-saturated result.
  • Adjust image displays on-the-fly using interactive slider widgets.
  • Display image objects even when bounding box columns are missing, by cropping from compartment-center offsets or rendering whole fields of view.
  • Automatically detect 3D image volumes and render interactive trame views in notebooks when 3D dependencies are installed (with graceful fallback otherwise).

For 3D notebook display behavior:

  • 3D-aware rendering is enabled by default (display_options={"auto_trame_for_3d": True}).
  • Disable automatic trame switching with display_options={"auto_trame_for_3d": False}.
  • Force trame layout regardless of auto-detection with display_options={"view": "trame"}.

For images without bounding box columns (e.g. older CellProfiler outputs or image-level data):

  • Crop from compartment-center coordinates plus pixel offsets with display_options={"offset_bounding_box": {"x_min": -20, "y_min": -20, "x_max": 20, "y_max": 20}} (requires compartment center columns such as Nuclei_Location_Center_X/Y).
  • Render the full field of view without cropping with display_options={"render_whole_image": True} (works even with no bounding box and no center columns).

For row display in notebook/widget tables:

  • CytoDataFrame respects pandas display settings (display.max_rows, display.min_rows).
  • When the table is larger than display.max_rows, the widget table inserts a midpoint ellipsis row () to indicate omitted rows.
  • You can control truncation behavior by changing pandas display options before rendering.

📓 Want to see CytoDataFrame in action? Check out our example notebook for a quick tour of its key features.

✨ CytoDataFrame development began within coSMicQC - a single-cell profile quality control package. Please check out our work there as well!

Installation

Install CytoDataFrame from source using the following:

# install from pypi
pip install cytodataframe

# or install directly from source
pip install git+https://github.com/cytomining/CytoDataFrame.git

Contributing, Development, and Testing

Please see our contributing documentation for more details on contributions, development, and testing.

References

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cytodataframe-0.3.3.tar.gz (286.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cytodataframe-0.3.3-py3-none-any.whl (69.2 kB view details)

Uploaded Python 3

File details

Details for the file cytodataframe-0.3.3.tar.gz.

File metadata

  • Download URL: cytodataframe-0.3.3.tar.gz
  • Upload date:
  • Size: 286.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cytodataframe-0.3.3.tar.gz
Algorithm Hash digest
SHA256 aa4a23c7387cf1c42a1ec7e01422fa40b9ce297e5fa94a83933ca49dfa4e467e
MD5 ca8ff30c13714fa5a8f98f488cacfa94
BLAKE2b-256 fe24d1dbbd1e714df98accd72b44fb83dd7e4fcde25cd2283fd084a4c0255869

See more details on using hashes here.

Provenance

The following attestation bundles were made for cytodataframe-0.3.3.tar.gz:

Publisher: publish-pypi.yml on cytomining/CytoDataFrame

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cytodataframe-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: cytodataframe-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 69.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cytodataframe-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2ee0c87545283df68213303e5d28439fe9efefbe11a428c6b8b45229c4b1f8ba
MD5 36f9a21e28a4bf2461ddaff4a0363e2f
BLAKE2b-256 bdbbe1dc1e3f7822458545e8185ad02020edfabf7d72894d3b4f15a762251143

See more details on using hashes here.

Provenance

The following attestation bundles were made for cytodataframe-0.3.3-py3-none-any.whl:

Publisher: publish-pypi.yml on cytomining/CytoDataFrame

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page