Skip to main content

Cell Segmentation for Spatial Transcriptomics Data using BOMS

Project description

BOMS : Cell Segmentation method for Spatial Transcriptomics

BOMS Overview

BOMS is a tool for cell segmentation in fluorescent in-situ hybridization (FISH) based Spatial Transcriptomics datasets. It takes as input the gene locations and labels. It assumes that a cell body is homogenous in its transcriptional signature and uses the similarity of these neighborhoods to cluster them together as one cell. The method can also incorporate the flows obtained from Cellpose Segmentation on DAPI/Cell Membrane channels to improve its cell segmentation.

Installation

The package requires Python > 3.9. The package can be installed using pip as follows:

pip install boms

Usage

The data for the method is provided in the form of three numpy arrays : x representing the x coordinates of the mRNA spots, y representing the y coordinates of the mRNA spots and g representing the labels of the mRNA spots. The cell segmentation can be performed as follows:

from boms import run_boms

"""
:param epochs: Number of iterations for the BOMS algorithm. Recommendation: 30
:param h_s: Spatial Bandwidth. Recommendation: Roughly equal to the radius of the cell body.
:param h_r: Range Bandwidth. Recommendation: 0.3 - 0.5
:param K: Number of Nearest Neighbors to form the Neighborhood Gene Expression Profile. Recommendation: 30

:return modes: N x (2 + no. of genes) array containing the final modes.
:return seg: N x 1 array containing the final segmentation.
"""

modes, seg = run_boms(x, y, g, epochs=30, h_s=10, h_r=0.3, K=30)

Demo

A demo notebook is available to run on Google Colab - BOMS Demo

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

boms-1.1.0.tar.gz (37.7 kB view hashes)

Uploaded Source

Built Distributions

boms-1.1.0-pp310-pypy310_pp73-win_amd64.whl (161.3 kB view hashes)

Uploaded PyPy Windows x86-64

boms-1.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (198.1 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

boms-1.1.0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (205.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

boms-1.1.0-pp39-pypy39_pp73-win_amd64.whl (161.4 kB view hashes)

Uploaded PyPy Windows x86-64

boms-1.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (198.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

boms-1.1.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (205.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

boms-1.1.0-cp310-cp310-win_amd64.whl (161.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

boms-1.1.0-cp310-cp310-win32.whl (142.2 kB view hashes)

Uploaded CPython 3.10 Windows x86

boms-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl (716.5 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

boms-1.1.0-cp310-cp310-musllinux_1_1_i686.whl (752.0 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

boms-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (195.7 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

boms-1.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (204.4 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

boms-1.1.0-cp39-cp39-win_amd64.whl (160.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

boms-1.1.0-cp39-cp39-win32.whl (142.5 kB view hashes)

Uploaded CPython 3.9 Windows x86

boms-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl (716.5 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

boms-1.1.0-cp39-cp39-musllinux_1_1_i686.whl (752.1 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

boms-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (195.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

boms-1.1.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (204.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

Supported by

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