Documentation#

MuSpAn is organised into several modules, each of which provides tools for working with different aspects of spatial data and analysis. The organisation of the package is designed to group tools and spatial analysis methods that are closely related in terms of their functionality and mathematical underpinnings.

Subpackage

Description

domain

A container for spatial data

objects

Objects that can be used to represent spatial data

query

Querying domain objects

shape_operations

Manipulating shape objects

spatial_statistics

Spatial statistics

region_based

Region-based analysis of spatial data

networks

Network analysis for spatial data

geometry

Geometric descriptors of shape-like objects

topology

Topological data analysis

distribution

Distribution analysis of spatial data

summary_statistics

Non-spatial summary statistics

visualise

Visualisation

io

Data input and output helper operations

datasets

Datasets for testing and demonstration

helpers

Helper functions for spatial analysis and data manipulation

Overall, the MuSpAn package can conveniently be divided into three main categories of submodules:

  1. Core functionality: This includes the core classes and functions that are used to generate, manipulate, view and filter the spatial data contained within a spatial domain.

  2. Spatial analysis: These modules provide a range of tools for analysing spatial data subcategorised by type of mathematical underpinnings.

  3. Extra features: These modules provide extra features that are not strictly necessary for the core functionality of the package, but are useful for specific applications or use cases. This includes modules data input and output, helper functions and example datasets for demonstration and method development.

_images/ms_overview.png

Above all this is a MuSpAn domain object, which is a container for all the spatial data. The domain object is the main entry point for working with the MuSpAn package, and it provides a convenient way to access all of the functionality of the package.

In a typical workflow, the user begins by creating a MuSpAn domain object and adding spatial data to it. Metadata is linked to objects via labels. All objects and their associated metadata are stored within the MuSpAn domain. From there, subsets of the data can be filtered using the query module, and visualised through the visualisation module. These filtered subsets can then undergo spatial analysis, with the results also available for visualisation and further downstream analysis. All outputs can be saved either through standard Python methods or via the MuSpAn IO module.

MuSpAn Workflow

With the support of detailed documentation, tutorials, and paper examples, the MuSpAn package empowers users to thoroughly explore and analyse spatial data—from initial investigation to the integration and development of high-throughput pipelines.

Import functions from MuSpAn#

All of the functions and classes in the MuSpAn package are publically available and can be imported using the following import statement:

import muspan

Or alternatively, you can import specific functions or classes from the package. For example, if we only wanted use a specific function, say network_distance from the networks module, we could import it as follows:

from muspan.networks import network_distance
distance = network_distance(...)

MuSpAn reference list#

All of the modules are listed below, and each module has its own documentation page that provides a detailed description of the functions and classes that are available in that module.