SpatialDataSimulator.py
High-level description
The SpatialDataSimulator
class in SpatialDataSimulator.py
defines an abstract base class for simulating spatial data on a CassiopeiaTree
. It provides a blueprint for overlaying spatial coordinates onto the tree, mimicking the spatial organization of cells in a tissue. This abstract class is intended to be subclassed for specific spatial simulation models.
Code Structure
This code defines a single abstract class SpatialDataSimulator
which inherits from the DataSimulator
class. The SpatialDataSimulator
class doesn’t directly interact with other symbols in the code, but it defines an abstract method overlay_data
that needs to be implemented by its subclasses.
References
This code references the following code symbols:
cassiopeia.data.CassiopeiaTree
cassiopeia.simulator.DataSimulator.DataSimulator
Symbols
SpatialDataSimulator
Description
This abstract class serves as a template for simulating spatial data on a CassiopeiaTree
. It defines the structure for overlaying spatial coordinates onto the tree nodes, representing the spatial arrangement of cells. Subclasses of SpatialDataSimulator
implement the overlay_data
method to apply specific spatial models.
Inputs
This class doesn’t have an __init__
method and therefore doesn’t take any direct inputs.
Outputs
This class doesn’t directly return any outputs.
Internal Logic
This class doesn’t have any internal logic as it’s an abstract class.
Side Effects
This class doesn’t have any side effects as it’s an abstract class.
Dependencies
This code depends on the following external libraries:
Dependency | Purpose |
---|---|
abc | Provides the abstract base class functionality. |
overlay_data
Description
This abstract method defines the interface for overlaying spatial data onto a CassiopeiaTree
. Subclasses must implement this method to apply specific spatial simulation models.
Inputs
Name | Type | Description |
---|---|---|
tree | CassiopeiaTree | The CassiopeiaTree object to overlay spatial data onto. |
Outputs
This method doesn’t return any value, it modifies the CassiopeiaTree
object in-place.
Internal Logic
This method is abstract and doesn’t have an implementation in this class. Subclasses are responsible for providing the implementation based on the specific spatial model.