Skip to main content

libsbgnpy are python utilities for working with SBGN.

Project description

libsbgnpy logo

libsbgnpy: Python library for SBGN

GitHub Actions CI/CD Status Version Python Versions MIT License DOI

Python library to work with the Systems Biology Graphical Notation (SBGN). This library is based on the SBGN XML schema and supports reading, writing and validation of SBGN files.

The initial library was generated using xsdata. Additional utility functions for reading, writing, and rendering SBGN documents are provided.

Documentation with examples is available at https://matthiaskoenig.github.io/libsbgnpy/.

    map = Map(
        id="ethanol_example",
        language=MapLanguage.PROCESS_DESCRIPTION,
        bbox=Bbox(x=0, y=0, w=363, h=253),
    )
    # add map to new sbgn
    sbgn = Sbgn(map=[map])

    # create glyphs and add to map
    map.glyph.extend(
        [
            Glyph(
                class_value=GlyphClass.SIMPLE_CHEMICAL,
                id="ethanol",
                label=Label(text="Ethanol"),
                bbox=Bbox(x=40, y=120, w=60, h=60),
            ),
            Glyph(
                class_value=GlyphClass.SIMPLE_CHEMICAL,
                id="ethanal",
                label=Label(text="Ethanal"),
                bbox=Bbox(x=220, y=110, w=60, h=60),
            ),
            Glyph(
                class_value=GlyphClass.MACROMOLECULE,
                id="adh1",
                label=Label(text="ADH1"),
                bbox=Bbox(x=106, y=20, w=108, h=60),
            ),

            ...

            # glyph with ports (process)
            Glyph(
                class_value=GlyphClass.PROCESS,
                id="pn1",
                orientation=GlyphOrientation.HORIZONTAL,
                bbox=Bbox(x=148, y=168, w=24, h=24),
                port=[
                    Port(x=136, y=180, id="pn1.1"),
                    Port(x=184, y=180, id="pn1.2"),
                ],
            ),
        ]
    )
    write_sbgn_to_file(sbgn, f"{prefix}_glyphs.sbgn")
    render_sbgn(sbgn, f"{prefix}_glyphs.png")

Example

How to cite

DOI

Installation

libsbgnpy is available from pypi

pip install libsbgnpy

License

Funding

Matthias König (MK) was supported by the Federal Ministry of Education and Research (BMBF, Germany) within the research network Systems Medicine of the Liver (LiSyM, grant number 031L0054). MK is supported by the Federal Ministry of Education and Research (BMBF, Germany) within ATLAS by grant number 031L0304B and by the German Research Foundation (DFG) within the Research Unit Program FOR 5151 QuaLiPerF (Quantifying Liver Perfusion-Function Relationship in Complex Resection - A Systems Medicine Approach) by grant number 436883643 and by grant number 465194077 (Priority Programme SPP 2311, Subproject SimLivA).

© 2016-2026 Matthias König

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

libsbgnpy-0.5.2.tar.gz (14.9 MB view details)

Uploaded Source

Built Distribution

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

libsbgnpy-0.5.2-py3-none-any.whl (104.3 kB view details)

Uploaded Python 3

File details

Details for the file libsbgnpy-0.5.2.tar.gz.

File metadata

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

File hashes

Hashes for libsbgnpy-0.5.2.tar.gz
Algorithm Hash digest
SHA256 1087cd2cad1580b2dc3e0727f27f199add7bf828482e4cafd9ac800624c7d820
MD5 69dc50ba1b9f38caaf225fd13ca4aa20
BLAKE2b-256 fa00c8edc8b94913bc970c2e6a0e41e5dd9d6c468e72609248c82e5ea31932bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for libsbgnpy-0.5.2.tar.gz:

Publisher: main.yml on matthiaskoenig/libsbgnpy

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

File details

Details for the file libsbgnpy-0.5.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for libsbgnpy-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8ed0b115a9d0a782413362bf21fcc2b58b73da1bac02d1bf0cdcd25992c8b864
MD5 ede7d4193407672d85a1b6578da68906
BLAKE2b-256 5fdec0faadb92a053d968afcb6ecb6e7475998b5a417120c9130fa3e1dadab29

See more details on using hashes here.

Provenance

The following attestation bundles were made for libsbgnpy-0.5.2-py3-none-any.whl:

Publisher: main.yml on matthiaskoenig/libsbgnpy

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