What it simulates
tyssue is a Python library for mechanical models of epithelia. Its main focus is vertex models. A vertex model draws a sheet of cells as polygons that share corners (vertices). Each cell has an area, a perimeter and edges. An energy function sums the mechanical terms. The solver moves the vertices to lower that energy.
The example builds a flat sheet from a 6 by 6 grid, trims the border cells, and gets 20 cells with 38 vertices and 100 half-edges. It then applies three energy terms and relaxes the sheet to a local energy minimum:
- Line tension on every edge, with random noise on each edge.
- Perimeter contractility per cell.
- Area elasticity, which pulls each cell toward a preferred area.
The key assumption is that the tissue is a 2D sheet at the apical surface, in a quasi-static state. The solver finds an energy minimum. It does not follow time. The result is the shape of the sheet at that minimum.
When to use it
Use tyssue to ask how cell-level mechanics set tissue shape:
- How do tension and contractility change cell area and the number of sides?
- Where does the sheet settle for a given set of parameters?
- Which cells shrink first when a few edges are stiffer?
On biosimhub, pyafv models cells as active Voronoi cells that can detach and move, which fits migrating or fragmenting tissue. Artistoo fits cells that deform and crawl on a pixel grid. tyssue fits a fixed network of polygons with a defined energy.
Install it yourself
The conda-forge package is tyssue. The dry run micromamba create -n t --dry-run -c conda-forge -c bioconda tyssue=0.9.0 resolves tyssue 0.9.0 with Python 3.9.23.
conda create -n tyssue -c conda-forge python=3.9 "numpy<2" "pandas<2" scipy matplotlib-base pytables quantities
conda activate tyssue
conda install -c conda-forge --no-deps tyssue=0.9.0
The recipe's image pins numpy<2 and pandas<2. tyssue 0.9.0 still calls DataFrame.append, which pandas marks as deprecated. The minimal script below is the recipe's helper script without the CSV and plot code. It uses tyssue's own API:
from tyssue import Sheet
from tyssue.dynamics import effectors, model_factory
from tyssue.geometry.sheet_geometry import SheetGeometry as geom
from tyssue.solvers.quasistatic import QSSolver
sheet = Sheet.planar_sheet_3d("epithelium", nx=6, ny=6, distx=1.0, disty=1.0)
sheet.sanitize(trim_borders=True, order_edges=True)
geom.update_all(sheet)
sheet.update_specs({
"edge": {"is_active": 1, "line_tension": 0.12},
"face": {"is_alive": 1, "contractility": 0.04, "prefered_area": 1.0,
"area_elasticity": 1.0, "prefered_vol": 1.0, "vol_elasticity": 0.0},
"vert": {"is_active": 1},
}, reset=True)
geom.update_all(sheet)
model = model_factory([effectors.LineTension, effectors.FaceContractility,
effectors.FaceAreaElasticity])
res = QSSolver().find_energy_min(sheet, geom, model)