Skip to main content

DOI PyPI version PyPI - Downloads codecov Documentation Status

ForSys

ForSys: a non-invasive open-source analysis software to infer stress from microscopic time series


What is ForSys ?

ForSys can infer membrane stress and cell pressure from a skeletonized microscopy image or a time series.

Documentation:

Available at https://forsys.readthedocs.io/en/latest/


Installation

To install, just run

pip install forsys

Usage

Static ForSys: Inferring on a single frame

After importing ForSys, the segmented image needs to be parsed into the Skeleton class

import forsys as fsys
skeleton = fsys.skeleton.Skeleton("path/to/segmented/image.tif")
vertices, edges, cells = skeleton.create_lattice()

Then, the skeleton should be meshed to the desired amount of vertices per edge (in order to account for the curved edges) in this example, the number is set to 6, using the ne keyworded argument.

vertices, edges, cells, _ = fsys.virtual_edges.generate_mesh(vertices, edges, cells, ne=6)

Next, we create a Frame object with our vertices, edges and cells. Finally creating the forsys object

frames[0] = fsys.frames.Frame(0, vertices, edges, cells, time=0)
forsys = fsys.ForSys(frames)

Now, we can create the matrix representation of the system for the stress or the pressures and solve it to get the inferred values. This is done for the stress as

fsys.build_force_matrix(when=0)
fsys.solve_stress(when=0, allow_negatives=False)

and similarly for the pressure

fsys.build_pressure_matrix(when=0)
fsys.solve_pressure(when=0, method="lagrange_pressure")

Dynamical ForSys: Inferring on a time-series

The main difference in this context is the necessity to create more than one frame. We followed the same steps as before to create generate each frame's mesh, but now create a different frame for each image in the time-series. Now, each frame will have a frame_number and a time. The first number works as an ID of the frame and tells the order of the frames, while the second one, time, is used to calculate the dynamical variables, such as velocity.

import forsys as fsys

for frame_id, frames in enumerate(images_path):
    real_time = 5 * frame_id # Image every 5 seconds
    skeleton = fsys.skeleton.Skeleton(frames)
    vertices, edges, cells = skeleton.create_lattice()
    vertices, edges, cells, _ = fsys.virtual_edges.generate_mesh(vertices, edges, cells, ne=6)
    frames[frame_id] = fsys.frames.Frame(frame_id,
                                         vertices,
                                         edges, 
                                         cells,
                                         time=real_time)
forsys = fsys.ForSys(frames, cm=False)

Then, after all frames have been created we again use the fsys.ForSys() class to create the mesh. If there is more than one element in the frames it will automatically try to track the vertices during the series. Creation of the matrices and its solution is done identically, but we have to specify at which time we want to do it

fsys.build_force_matrix(when=frame_number_to_solve)
fsys.solve_stress(when=frame_number_to_solve, 
                    allow_negatives=False,
                    b_matrix="velocity")

fsys.build_pressure_matrix(when=frame_number_to_solve)
fsys.solve_pressure(when=frame_number_to_solve, method="lagrange_pressure")

Importantly, the b_matrix parameter indicates ForSys to use the vertex velocity in the right hand side of the equation (please refer to the Materials and Methods section of th paper for the details).

Plotting the results

For plotting the results, the main function to use is forsys.plot.plot_inference() and then specify whether to include the pressure or not. If the system was already solved,

fsys.plot.plot_inference(forsys.frames[0],
                       step="file_name_to_write",
                       folder="path/to/save/folder",
                       pressure=True,
                       normalized="max",
                       mirror_y=True,
                       colorbar=True)

By default, the membrane tension is always plotted, the pressure=True parameter plots the inferred pressures as the color filling the cells.

How to cite us

Our tool's manuscript is available at https://www.cell.com/iscience/fulltext/S2589-0042(25)01946-7

To cite the tool, you can use:

ForSys: Non-invasive stress inference from time-lapse microscopy. Augusto Borges, Jerónimo R. Miranda-Rodríguez, Alberto Sebastián Ceccarelli, Guilherme Ventura, Jakub Sedzinski, Hernán López-Schier, Osvaldo Chara. iScience 28 (11); doi:10.1016/j.isci.2025.11368

Metadata

Release files for forsys 1.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forsys 1.1.6
File Size Uploaded Provenance Actions
forsys-1.1.6.tar.gz 68.8 kB Without provenance Details for forsys-1.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for forsys 1.1.6
File Interpreter ABI Platform Actions
forsys-1.1.6-py3-none-any.whl Python 3 none any Details for forsys-1.1.6-py3-none-any.whl

Total release size: 136.7 kB

Release files / forsys-1.1.6.tar.gz

Download URL forsys-1.1.6.tar.gz
Size 68.8 kB
Tags Source
SHA-256 checksum
How to use checksums
628e37fb940e032dd05124676c369a10614242e661117178f39ff9d92dff8b25
BLAKE2b-256 checksum
How to use checksums
e4b53b6b0dbda5fea176d93fd7f1e14f90c3972531252cda777f70f33b39f278
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / forsys-1.1.6-py3-none-any.whl

Download URL forsys-1.1.6-py3-none-any.whl
Size 68.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b251ebd8d4ced5864e42bc12396c119fe3b3b7c7d36f7248139f00fae8d2e800
BLAKE2b-256 checksum
How to use checksums
cbed948fd4d22a881b230c0a78220fe9c8ef2176e491e95d6e5e14d69476b40d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for forsys 1.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page