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 MERSCOPE 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 or bioconda

# install from PyPI
pip install ovrlpy

# or install from bioconda
conda install bioconda::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_components = 20 # number pf PCA components

# 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
dataset = ovrlpy.Ovrlp(
    coordinate_df,
    n_components=n_components,
    n_workers=4,  # number of threads to use for processing
)

dataset.analyse()

after fitting we can visualize the data ...

fig = ovrlpy.plot_pseudocells(dataset)

plot_fit output

... and the signal integrity map

fig = ovrlpy.plot_signal_integrity(dataset, signal_threshold=4)

plot_signal_integrity output

Ovrlpy can also identify individual overlap events in the data:

doublets = dataset.detect_doublets(min_signal=4, integrity_sigma=1)

And plot a multi-view visualization of the overlaps in the tissue:

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

x, y = doublets["x", "y"].row(doublet_to_show)

fig = ovrlpy.plot_region_of_interest(dataset, x, y, window_size=50)

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-1.0.1.tar.gz (8.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-1.0.1-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ovrlpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1263b90fd33f42cc6391b76fb121b6e8d6f0ec3faba3ce9ea5b8bb3e1dd59f6e
MD5 bbe97a47c16c3ec04626ab0393f8fe04
BLAKE2b-256 922abb23e7f6b22a61a7d6ddaee6900c664d3eaa60713b5510f607e1f36b7be3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ovrlpy-1.0.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-1.0.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ovrlpy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a035cebae1f1cceff3260e2b721a5ceed4063a5bad395135fbeac822284e5d2
MD5 c3182f630c6f7996a5505f1f9a640458
BLAKE2b-256 75147071af1276986af8690ae2658d36df57e6b8889500ba804bbb81701c3bb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ovrlpy-1.0.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