image¶
Rendering of SBGN documents as images.
The rendering is performed by the web service of Frank Bergmann at https://sbml.bioquant.uni-heidelberg.de/layout, i.e., it requires an internet connection. For the documentation of the service see http://sysbioapps.spdns.org/Layout.
from pathlib import Path
from libsbgnpy import read_sbgn_from_file, render_sbgn
sbgn = read_sbgn_from_file(Path("map.sbgn"))
render_sbgn(sbgn, Path("map.png"))
render_sbgn
¶
Render an SBGN document to an image.
The document is sent to the rendering web service, which lays the map out and returns the image. The request is equivalent to
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sbgn
|
Sbgn
|
SBGN document |
required |
image_file
|
Path
|
path of the image to create, ending in |
required |
file_format
|
str
|
image format, only |
'png'
|
Raises:
| Type | Description |
|---|---|
ValueError
|
if the format is not supported or the file has another suffix |
RequestException
|
if the web service cannot be reached or fails |