Skip to main content

A python tool to investigate cell overlaps in imaging-based spatial transcriptomics data.

Project description

ovrlpy logo

A python tool to investigate vertical signal properties of imaging-based spatial transcriptomics data.

introduction

Much of spatial biology uses microscopic tissue slices to study the spatial distribution of cells and molecules. In the process, tissue slices are often interpreted as 2D representations of 3D biological structures - which can introduce artefacts and inconsistencies in the data whenever structures overlap in the thin vertical dimension of the slice:

3D slice visualization

Ovrl.py is a quality-control tool for spatial transcriptomics data that can help analysts find sources of vertical signal inconsistency in their data. It is works with imaging-based spatial transcriptomics data, such as 10x genomics' Xenium or vizgen's MERFISH platforms. The main feature of the tool is the production of 'signal integrity maps' that can help analysts identify sources of signal inconsistency in their data. Users can also use the built-in 3D visualisation tool to explore regions of signal inconsistency in their data on a molecular level.

installation

ovrlpy can be installed from PyPI

pip install ovrlpy

quickstart

The simplest use case of ovrlpy is the creation of a signal integrity map from a spatial transcriptomics dataset. In a first step, we define a number of parameters for the analysis:

import pandas as pd
import ovrlpy

# define ovrlpy analysis parameters:
n_expected_celltypes = 20

# load the data
coordinate_df = pd.read_csv('path/to/coordinate_file.csv')
coordinate_df.head()

the coordinate dataframe should contain a gene, x, y, and z column.

you can then fit an ovrlpy model to the data and create a signal integrity map:

# fit the ovrlpy model to the data
signal_integrity, signal_strength, visualizer = ovrlpy.run(
    coordinate_df, n_expected_celltypes=n_expected_celltypes
)

returns a signal integrity map, a signal map and a visualizer object that can be used to visualize the data:

visualizer.plot_fit()

plot_fit output

and visualize the signal integrity map:

fig, ax = ovrlpy.plot_signal_integrity(signal_integrity, signal_strength, signal_threshold=4)

plot_signal_integrity output

Ovrlpy can also identify individual overlap events in the data:

doublet_df = ovrlpy.detect_doublets(
    signal_integrity, signal_strength, minimum_signal_strength=3, integrity_sigma=2
)

doublet_df.head()

And use the visualizer to show a 3D visualization of the overlaps in the tissue:

# Which doublet do you want to visualize?
n_doublet_case = 0

x, y = doublet_df.loc[doublet_case, ["x", "y"]]

ovrlpy.plot_region_of_interest(
    x,
    y,
    coordinate_df,
    visualizer,
    signal_integrity,
    signal_strength,
)

plot_region_of_interest output

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

ovrlpy-0.0.0.tar.gz (12.6 MB view details)

Uploaded Source

Built Distribution

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

ovrlpy-0.0.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file ovrlpy-0.0.0.tar.gz.

File metadata

  • Download URL: ovrlpy-0.0.0.tar.gz
  • Upload date:
  • Size: 12.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for ovrlpy-0.0.0.tar.gz
Algorithm Hash digest
SHA256 4724e03c3df45c2dd1dcf8b9b3dd70cdf7194a9206e3a37cdd8f9143132bfc6a
MD5 7d98d3bcc84528feda15cd75e377b547
BLAKE2b-256 e149d53129f9f4a4e2510995b2643b6cf7abb67295d55c89c9a817b3fbff4751

See more details on using hashes here.

File details

Details for the file ovrlpy-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: ovrlpy-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for ovrlpy-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c51aadd735d2409dcaaa9ec51c057c1be0fe2924f24235ac65d669e45a3fe94d
MD5 e7448843e7281a9e6ff6beeff309c44c
BLAKE2b-256 78630a6b97cda2bf5fb92d462ca1d65e4892e47a67a889bae507e55368a4d915

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