Skip to main content

A library to work with molecular maps

Project description

momapy

momapy is a library for working with molecular maps. It currently supports SBGN and CellDesigner maps. Its key feature is its definition of a map, that is formed of two entities: a model, that describes what concepts are represented, and a layout, that describes how these concepts are represented. This definition is borrowed from SBML and its extensions layout+render, that allow users to add a layout to an SBML model. momapy aims at extending this definition to SBGN and CellDesigner maps.

Features of momapy include the following:

  • support for SBGN PD and AF maps (read/write SBGN-ML with annotations, rendering information, and notes) and CellDesigner (read only, with annotations)
  • decomposition of a map object into:
    • a model object;
    • a layout object;
    • a mapping from layout element objects to model element objects.
  • map, model, layout and mapping objects comparison; fast object in set checking
  • rendering of maps to images (SVG, PDF, JPEG, PNG, WebP) and other surfaces (e.g. GLFW window)
  • support for styling and CSS like stylesheets (including effects such as shadows)
  • automatic geometry and anchors (for arcs, shape borders)
  • local positioning (e.g. right of shape, fit set of shapes)
  • easy extension with new model and layout element types

Installation

momapy is available as a Python package and can be installed with pip as follows (Python >=3.10,<=3.12):

pip install momapy

Some python packages depend on system packages that might require installation:

Usage

Typical usage of momapy includes reading a map and exploring its model:

import momapy.sbgn.io.sbgnml
from momapy.io import read

map_ = read("my_map.sbgn").obj
for process in map_.model.processes:
    print(process)

Or rendering its layout:

import momapy.rendering.skia
from momapy.rendering.core import render_map

render_map(map_, "my_file.pdf", format_="pdf", renderer="skia")

Documentation

The documentation for momapy can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

momapy-0.2.0.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

momapy-0.2.0-py3-none-any.whl (153.8 kB view details)

Uploaded Python 3

File details

Details for the file momapy-0.2.0.tar.gz.

File metadata

  • Download URL: momapy-0.2.0.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for momapy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7b5b9793ece5577587a6ec406933d007d230913edc711a2dc3e9f7dca8df399d
MD5 5d0eff15d2155e4a3e699af9e492a00a
BLAKE2b-256 5f61bacb11ad987ab24b9476bf56fca43e109e2e38bda2e06df15d5e33c4c7cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for momapy-0.2.0.tar.gz:

Publisher: release.yml on adrienrougny/momapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file momapy-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: momapy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 153.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for momapy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5203e2263bd745194cbcaff5094367b0922c8bf6d005781260b2a5c2339f5d4b
MD5 5b94b933a09815aacb1817222421664b
BLAKE2b-256 0f60161e358cd68e2a17e19a5f59483f1ea83a21ecabaf4e25f4c88f73b7357b

See more details on using hashes here.

Provenance

The following attestation bundles were made for momapy-0.2.0-py3-none-any.whl:

Publisher: release.yml on adrienrougny/momapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page