Skip to main content

Surface-based Cell Neighbor Detection and Interscellar Volume Computation for 2D & 3D Spatial Omics

Project description

InterSCellar

PyPI License: MIT

InterSCellar is a Python package for surface-Based cell neighborhood and interaction volume analysis in 3D spatial omics.

Package workflow

Installation

Install package:

pip install interscellar

Usage

Import:

import interscellar

3D Pipeline:

(1) Cell Neighbor Detection & Graph Construction

neighbors_3d, adata, conn = interscellar.find_cell_neighbors_3d(
    ome_zarr_path="data/segmentation.zarr",
    metadata_csv_path="data/cell_metadata.csv",
    max_distance_um=0.5,
    voxel_size_um=(0.56, 0.28, 0.28),
    n_jobs=4
)

(2) Interscellar Volume Computation

# Interscellar volumes
volumes_3d, adata, conn = interscellar.compute_interscellar_volumes_3d(
    ome_zarr_path="data/segmentation.zarr",
    neighbor_pairs_csv="results/neighbors_3d.csv",
    neighbor_db_path="/results/neighbor_graph.db",
    voxel_size_um=(0.56, 0.28, 0.28),
    max_distance_um=3.0,
    intracellular_threshold_um=1.0,
    n_jobs=4
)
# Cell-only volumes
cellonly_3d = interscellar.compute_cell_only_volumes_3d(
    ome_zarr_path="data/segmentation.zarr",
    interscellar_volumes_zarr="results/interscellar_volumes.zarr"
)

2D Pipeline:

(1) Cell Neighbor Detection & Graph Construction

neighbors_2d, adata, conn = interscellar.find_cell_neighbors_2d(
    polygon_json_path="data/cell_polygons.json",
    metadata_csv_path="data/cell_metadata.csv",
    max_distance_um=1.0,
    pixel_size_um=0.1085,
    n_jobs=4
)

Utilities:

Volume Visualization

# Full dataset (Napari)
visualize-all-3d \
  --cell-only-zarr "results/cell_only_volumes.zarr" \
  --interscellar-zarr "results/interscellar_volumes.zarr" \
  --cell-only-opacity 0.7 \
  --interscellar-opacity 0.9
# Single pair (Napari)
visualize-pair-3d \
  --pair-id 123 \
  --cell-only-zarr "results/cell_only_volumes.zarr" \
  --interscellar-zarr "results/interscellar_volumes.zarr" \
  --pair-opacity 0.6 \
  --cells-opacity 0.7

Project details


Download files

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

Source Distribution

interscellar-0.1.0.tar.gz (46.4 kB view details)

Uploaded Source

Built Distribution

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

interscellar-0.1.0-py3-none-any.whl (54.3 kB view details)

Uploaded Python 3

File details

Details for the file interscellar-0.1.0.tar.gz.

File metadata

  • Download URL: interscellar-0.1.0.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for interscellar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b68d918d0955ffcd8d5ccfe0ee637eb4011604c8127a1f072794a8b7f78c18e6
MD5 1718d60a30ed81e90bfefaec7abff05d
BLAKE2b-256 a98343e09133958ca2175ca7abd911e7947b8d50b60c5040c91c7f757f0f0081

See more details on using hashes here.

File details

Details for the file interscellar-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: interscellar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 54.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for interscellar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 824951d48dac9f4ec561684f654338d8d0986b44b996c270d14f338f49460ab7
MD5 772d86719a61745ac1083a1a6def60e5
BLAKE2b-256 6b5302bd72dac4930fadfa4c09677981050d3af12911255bb31849122adcc0de

See more details on using hashes here.

Supported by

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