forsys


Nameforsys JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryA tissue stress and cell pressure inference package with dynamical information
upload_time2024-05-24 13:53:23
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords systems biology stress pressure inference
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![codecov](https://codecov.io/gh/borgesaugusto/forsys/graph/badge.svg?token=09Z4YKV8IG)](https://codecov.io/gh/borgesaugusto/forsys)
# 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: 
...

---

## Installation
...

---

## Usage
### Static ForSys: Inferring on a single frame
After importing ForSys, the segmented image needs to be parsed into the *Skeleton* class
```python
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.
```python
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
```python
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
```python
fsys.build_force_matrix(when=0)
fsys.solve_stress(when=0, allow_negatives=False)
```
and similarly for the pressure
```python
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. 
```python
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
```python
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,
```python
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
...

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "forsys",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "systems biology, stress, pressure, inference",
    "author": null,
    "author_email": "Augusto Borges <borges.augustoar@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ec/e0/11f905655634bd40a1afa547d9f5e94caf666d0f9d0b0a5ad33d3a3fc1da/forsys-1.0.0.tar.gz",
    "platform": null,
    "description": "[![codecov](https://codecov.io/gh/borgesaugusto/forsys/graph/badge.svg?token=09Z4YKV8IG)](https://codecov.io/gh/borgesaugusto/forsys)\n# ForSys\n#### ForSys: a non-invasive open-source analysis software to infer stress from microscopic time series \n\n---\n## What is ForSys ?\nForsys can infer membrane stress and cell pressure from a skeletonized microscopy image or a time series.\n\n##  Documentation: \n...\n\n---\n\n## Installation\n...\n\n---\n\n## Usage\n### Static ForSys: Inferring on a single frame\nAfter importing ForSys, the segmented image needs to be parsed into the *Skeleton* class\n```python\nimport forsys as fsys\nskeleton = fsys.skeleton.Skeleton(\"path/to/segmented/image.tif\")\nvertices, edges, cells = skeleton.create_lattice()\n```\nThen, the skeleton should be meshed to the desired amount of vertices per edge (in order to account for the curved edges)\nin this example, the number is set to 6, using the *ne* keyworded argument.\n```python\nvertices, edges, cells, _ = fsys.virtual_edges.generate_mesh(vertices, edges, cells, ne=6)\n```\n---\nNext, we create a *Frame* object with our vertices, edges and cells. Finally creating the *forsys* object\n```python\nframes[0] = fsys.frames.Frame(0, vertices, edges, cells, time=0)\nforsys = fsys.ForSys(frames)\n```\n\nNow, we can create the matrix representation of the system for the stress or the pressures and solve it to get the \ninferred values. This is done for the stress as\n```python\nfsys.build_force_matrix(when=0)\nfsys.solve_stress(when=0, allow_negatives=False)\n```\nand similarly for the pressure\n```python\nfsys.build_pressure_matrix(when=0)\nfsys.solve_pressure(when=0, method=\"lagrange_pressure\")\n```\n\n### Dynamical ForSys: Inferring on a time-series\nThe main difference in this context is the necessity to create more than one frame. We followed the same steps as before\nto create generate each frame's mesh, but now create a different frame for each image in the time-series. Now, each frame\nwill have a *frame_number* and a *time*. The first number works as an ID of the frame and tells the order of the frames,\nwhile the second one, time, is used to calculate the dynamical variables, such as velocity. \n```python\nimport forsys as fsys\n\nfor frame_id, frames in enumerate(images_path):\n    real_time = 5 * frame_id # Image every 5 seconds\n    skeleton = fsys.skeleton.Skeleton(frames)\n    vertices, edges, cells = skeleton.create_lattice()\n    vertices, edges, cells, _ = fsys.virtual_edges.generate_mesh(vertices, edges, cells, ne=6)\n    frames[frame_id] = fsys.frames.Frame(frame_id,\n                                         vertices,\n                                         edges, \n                                         cells,\n                                         time=real_time)\nforsys = fsys.ForSys(frames, cm=False)\n```\nThen, after all frames have been created we again use the *fsys.ForSys()* class to create the mesh. If there is more than\none element in the *frames* it will automatically try to track the vertices during the series. Creation of the matrices \nand its solution is done identically, but we have to specify at which time we want to do it\n```python\nfsys.build_force_matrix(when=frame_number_to_solve)\nfsys.solve_stress(when=frame_number_to_solve, \n                    allow_negatives=False,\n                    b_matrix=\"velocity\")\n\nfsys.build_pressure_matrix(when=frame_number_to_solve)\nfsys.solve_pressure(when=frame_number_to_solve, method=\"lagrange_pressure\")\n```\nImportantly, the *b_matrix* parameter indicates ForSys to use the vertex velocity in the right hand side of the equation\n(please refer to the Materials and Methods section of th paper for the details).\n\n#### Plotting the results\nFor plotting the results, the main function to use is *forsys.plot.plot_inference()* and then specify whether to include\nthe pressure or not. If the system was already solved,\n```python\nfsys.plot.plot_inference(forsys.frames[0],\n                       step=\"file_name_to_write\",\n                       folder=\"path/to/save/folder\",\n                       pressure=True,\n                       normalized=\"max\",\n                       mirror_y=True,\n                       colorbar=True)\n```\nBy default, the membrane tension is always plotted, the pressure=True parameter plots the inferred pressures as the color \nfilling the cells. \n\n\n### How to cite us\n...\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A tissue stress and cell pressure inference package with dynamical information",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/borgesaugusto/forsys/"
    },
    "split_keywords": [
        "systems biology",
        " stress",
        " pressure",
        " inference"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1db77576a0bc939fd18f5b11eaede4928b31c1c85c505385dbace9915154c169",
                "md5": "c8c5987246484ed447fc10848fcc63ba",
                "sha256": "cf13762e95e1776242d27d45bb6b5292f8998771737ac2917069801685952632"
            },
            "downloads": -1,
            "filename": "forsys-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c8c5987246484ed447fc10848fcc63ba",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 56608,
            "upload_time": "2024-05-24T13:53:21",
            "upload_time_iso_8601": "2024-05-24T13:53:21.083201Z",
            "url": "https://files.pythonhosted.org/packages/1d/b7/7576a0bc939fd18f5b11eaede4928b31c1c85c505385dbace9915154c169/forsys-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ece011f905655634bd40a1afa547d9f5e94caf666d0f9d0b0a5ad33d3a3fc1da",
                "md5": "96628ae45a1fd6cd395204fcb10940f9",
                "sha256": "64e2923ef6b5b280371adbe413a11158a833886c35e7dfcc8ce2235abb1fa993"
            },
            "downloads": -1,
            "filename": "forsys-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "96628ae45a1fd6cd395204fcb10940f9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 54205,
            "upload_time": "2024-05-24T13:53:23",
            "upload_time_iso_8601": "2024-05-24T13:53:23.639398Z",
            "url": "https://files.pythonhosted.org/packages/ec/e0/11f905655634bd40a1afa547d9f5e94caf666d0f9d0b0a5ad33d3a3fc1da/forsys-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-24 13:53:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "borgesaugusto",
    "github_project": "forsys",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "forsys"
}
        
Elapsed time: 0.23739s