pysbgn

create SGBN ML v0.3 files from python

https://github.com/vpodpecan/pysbgn

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.3%) to scientific vocabulary
Last synced: 8 months ago · JSON representation ·

Repository

create SGBN ML v0.3 files from python

Basic Info
  • Host: GitHub
  • Owner: vpodpecan
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 29.3 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created over 4 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License Citation

README.md

pysbgn: supporting SBGN-ML v0.3 in Python

This package provides support for writing and reading SBGN-ML v0.3 files. The code is auto-generated using generateDS with a few code fixes and modifications making it compatible with libsbgn-python (which supports only SBGN-ML v0.2).

Requirements

python 3.5+

Installation

pip install pysbgn

Examples

The read/write API is the same as in libsbgn-python so you can use the examples from libsbgn-python documentation. Just make sure that the import statements are compatible with libsbgn-python as shown below. Note, however, that additional modules of libsbgn-python such as utils and render are not provided.

python from pysbgn import sbgn_core as libsbgn from pysbgn.sbgn_core import notesType as Notes from pysbgn.sbgn_core import extensionType as Extension from pysbgn.sbgn_types import Language, Orientation, GlyphClass, ArcClass, Name, Version, ArcGroupClass

A simple example

Note: this example is taken from libsbgn-python and shortened to included only three glyphs and two arcs.

```python from pysbgn import sbgncore as libsbgn from pysbgn.sbgntypes import Language, GlyphClass, ArcClass, Orientation

sbgn = libsbgn.sbgn() map = libsbgn.map() map.setlanguage(Language.PD) sbgn.setmap(map)

create a bounding box for the map

box = libsbgn.bbox(x=0, y=0, w=363, h=253) map.set_bbox(box)

two glyphs with labels

g = libsbgn.glyph(class=GlyphClass.SIMPLECHEMICAL, id='glyph1') g.setlabel(libsbgn.label(text='Ethanol')) g.setbbox(libsbgn.bbox(x=40, y=120, w=60, h=60)) map.add_glyph(g)

g = libsbgn.glyph(class=GlyphClass.SIMPLECHEMICAL, id='glyphethanal') g.setlabel(libsbgn.label(text='Ethanal')) g.setbbox(libsbgn.bbox(x=220, y=110, w=60, h=60)) map.addglyph(g)

glyph with ports (process)

g = libsbgn.glyph(class=GlyphClass.PROCESS, id='pn1', orientation=Orientation.HORIZONTAL) g.setbbox(libsbgn.bbox(x=148, y=168, w=24, h=24)) g.addport(libsbgn.port(x=136, y=180, id="pn1.1")) map.addglyph(g)

arcs

a = libsbgn.arc(class=ArcClass.CONSUMPTION, source="glyph1", target="pn1.1", id="a01") a.setstart(libsbgn.startType(x=98, y=160)) a.setend(libsbgn.endType(x=136, y=180)) map.addarc(a)

a = libsbgn.arc(class=ArcClass.PRODUCTION, source="pn1.1", target="glyphethanal", id="a05") a.setstart(libsbgn.startType(x=184, y=180)) a.setend(libsbgn.endType(x=224, y=154)) map.add_arc(a)

sbgn.export('result.xml') ```

Author

Vid Podpečan (vid.podpecan@ijs.si)

License

MIT

Owner

  • Name: Vid Podpečan
  • Login: vpodpecan
  • Kind: user
  • Company: Jožef Stefan Institute

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: pysbgn
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Vid
    family-names: Podpečan
    email: vid.podpecan@ijs.si
    affiliation: Jožef Stefan Institute
    orcid: 'https://orcid.org/0000-0002-7314-4529'
identifiers:
  - type: doi
    value: 10.5281/zenodo.7966410
    description: Zenodo DOI
repository-code: 'https://github.com/vpodpecan/pysbgn'
url: 'https://github.com/vpodpecan/pysbgn#readme'
abstract: >-
  This package provides support for writing and reading
  SBGN-ML v0.3 files. The code is auto-generated using
  generateDS with a few code fixes and modifications making
  it compatible with libsbgn-python (which supports only
  SBGN-ML v0.2).
keywords:
  - SBGN-ML
license: MIT
commit: 4e09c7b
version: 0.2.1

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: about 11 hours
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 2.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • bdklahn (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 12 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 2
  • Total maintainers: 1
pypi.org: pysbgn

Support for SBGN ML v0.3 via generateDS

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 12 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 21.5%
Forks count: 29.8%
Average: 30.4%
Stargazers count: 38.8%
Downloads: 51.6%
Maintainers (1)
Last synced: 8 months ago