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.2.1.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.2.1-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ovrlpy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3b160bd67ecf3b576086834279ed313bbdc9f97b520bea932078c688e3c8f3f5
MD5 a4bd39e0ffb4f08ac2cb19e1f919fe89
BLAKE2b-256 6584b8eea2d6c25808505236ea006469590afc84ed548516132661b51a024fa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ovrlpy-0.2.1.tar.gz:

Publisher: publish-pypi.yml on HiDiHlabs/ovrl.py

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

File details

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

File metadata

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

File hashes

Hashes for ovrlpy-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb3873057f350dbeb3f60d8089b4e8e65e90a78aae1ae677b4545172f5d6d2d2
MD5 c85be275a18cd9120723b6bc37791262
BLAKE2b-256 01b09545705c6c3a9483b486d17d2ea4de568dd75d5873780bd723128ab617be

See more details on using hashes here.

Provenance

The following attestation bundles were made for ovrlpy-0.2.1-py3-none-any.whl:

Publisher: publish-pypi.yml on HiDiHlabs/ovrl.py

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 Pingdom Monitoring Sentry Error logging StatusPage Status page