Skip to content

BiocPy/SpatialFeatureExperiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4488f04 · Apr 25, 2025

History

8 Commits
Apr 24, 2025
Apr 16, 2025
Apr 24, 2025
Apr 24, 2025
Mar 1, 2025
Mar 1, 2025
Apr 22, 2025
Mar 1, 2025
Mar 1, 2025
Apr 25, 2025
Mar 1, 2025
Mar 1, 2025
Mar 3, 2025
Mar 1, 2025
Apr 24, 2025
Apr 16, 2025
Mar 1, 2025

Repository files navigation

PyPI-Server Unit tests

SpatialFeatureExperiment

A Python package for storing and analyzing spatial-omics experimental data. This package provide the SpatialFeatureExperiment class, based on the R package and class.

Install

To get started, install the package from PyPI

pip install spatialfeatureexperiment

Quick Usage

This package uses shapely and geopandas to support the *_geometries slots.

from spatialexperiment import SpatialFeatureExperiment
import numpy as np
import geopandas as gpd
from shapely.geometry import Polygon

nrows = 200
ncols = 500
counts = np.random.rand(nrows, ncols)
polys = gpd.GeoSeries(
    [
        Polygon([(1, -1), (1, 0), (0, 0)]),
        Polygon([(3, -1), (4, 0), (3, 1)]),
    ]
)

colgeoms = {"polygons" : gpd.GeoDataFrame({"geometry": polys})}
tspe = SpatialFeatureExperiment(assays={"spots": counts}, col_geometries=colgeoms)

Note

This project has been set up using BiocSetup and PyScaffold.