Skip to main content

Density-Aware Spatial Randomization (DenSR) generates realistic null models for object-based colocalization analysis.

Project description

DenSR

DenSR provides density-aware spatial randomization using KDE-weighted sampling within a 3D cell mesh, plus object-based colocalization analysis for observed RNA spot coordinates, UniSR, and DenSR.

Cite this package

Kannan, S., Voelker, T. L., Snyder, B. S., & Robertson, G. A. (2026). Density-Aware Spatial Randomization (DenSR) generates realistic null models for object-based colocalization analysis. Molecular Biology of the Cell, 37(6), mr6.

Install

pip install densr

Usage

from densr import densr

spots1 = "path/to/folder/C1_1a_xyz.txt"
spots2 = "path/to/folder/C1_1b_xyz.txt"
object = "path/to/folder/C1_volume.obj"
colocalization_threshold = 1

densr(
    spots1=spots1,
    spots2=spots2,
    object=object,
    colocalization_threshold=colocalization_threshold,
)

The RNA spot files are read as tab-separated text files, and the first three columns are used as x, y, and z coordinates. The densr(...) call displays the results table and spot plot automatically.

Built-in sample data

from densr import densr, sample_data

sample = sample_data()

densr(
    spots1=sample.spots1,
    spots2=sample.spots2,
    object=sample.object,
    colocalization_threshold=0.25,
)

Command line

densr C1_volume.obj C1_1a_xyz.txt C1_1b_xyz.txt --colocalization-threshold 1

Functions

  • densr(spots1, spots2, object, colocalization_threshold=1): one-line DenSR analysis using RNA spot files and a 3D cell mesh file.
  • sample_data(): return file paths for the built-in DenSR sample data.

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

densr-0.1.7.tar.gz (211.2 kB view details)

Uploaded Source

Built Distribution

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

densr-0.1.7-py3-none-any.whl (212.0 kB view details)

Uploaded Python 3

File details

Details for the file densr-0.1.7.tar.gz.

File metadata

  • Download URL: densr-0.1.7.tar.gz
  • Upload date:
  • Size: 211.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for densr-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4768f795649ff26730ecae2b23fced2a651406c41c8f4972fd59bee300a3d8d3
MD5 5ec9e69e60e1c28c3b06095a69ead934
BLAKE2b-256 462d1c4ca472cbed9b6012a089d7a3e98950b8b7d5add39fa53d04b0c690870e

See more details on using hashes here.

File details

Details for the file densr-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: densr-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 212.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for densr-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 910805b137306ed8d1af1f6062a096ed386cbe53e634f0a8c22840ff3f988bcd
MD5 763affb76ecdca114065b5d6a8e95f0e
BLAKE2b-256 a80dc3da4cbe1e2449b94fafe9151073f7cf93745cb73c65af3c263b07cb1319

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