A Python package for storing and analyzing spatial-omics experimental data. This package provide the SpatialFeatureExperiment class, based on the R package and class.
To get started, install the package from PyPI
pip install spatialfeatureexperimentThis package uses shapely and geopandas to support the *_geometries slots.
fromspatialexperimentimportSpatialFeatureExperimentimportnumpyasnpimportgeopandasasgpdfromshapely.geometryimportPolygonnrows=200ncols=500counts=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)This project has been set up using BiocSetup and PyScaffold.