No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
converter
documentation
examples
tikz-sbgn
CHANGELOG.txt
LICENSE.txt
README.md
example.png

README.md

sbgntikz is a TikZ library that allows drawing SBGN maps directly into LaTeX using the powerfull TikZ package. All three SBGN languages (PD, AF and ER) are supported.

Installation

The directory tikz-sbgn should be copied to a directory where it can be found by the TeX engine:

  • in the directory of your TeX source file
  • in your local texmf directory. This directory is usually /home/<user>/texmf/ under Linux, /Users/Library/texmf/ under MacOS, and C:/Users/<user>/texmf under Windows, but it can depend on your OS version and TeX distribution. Yout texmf directory can be found using the kpsewhich -var-value=TEXMFHOME command.

Getting started

sbgntikz is a TikZ package. Usually, TikZ is installed within your TeX distribution, so it can be imported directly into your LaTeX source file. The two first steps are to import the TikZ package and the sbgntikz library:

\usepackage{tikz}
\usetikzlibrary{sbgn}

SBGN maps can then be straightforwardly drawn using a tikzpicture environment together with the sbgn key:

\begin{tikzpicture}[sbgn]
  % tikz code to draw an SBGN map
\end{tikzpicture}

Nodes and nodes attributes can be drawn using the TikZ \node command, while arcs can be drawn using the \draw command. The type of glyph to be drawn is specified using a keyword that is the name of the type (e.g macromolecule for the macromolecule glyph, necessary stimulation for the necessary stimulation glyph). Here is a small SBGN PD example:

\usetikzlibrary{positioning} %for relative positioning

\begin{tikzpicture}[sbgn]
    %ERK
    \node[macromolecule] (erk) {ERK};
    \node[sv] at (erk.120) {};
    %process
    \node[generic process, connectors = horizontal, right = of erk] (p) {};
    %p-ERK
    \node[macromolecule, right = of p] (perk) {ERK};
    \node[sv] at (perk.120) {P};
    %atp
    \node[simple chemical, below left = of p] (atp) {ATP};
    %adp
    \node[simple chemical, below right = of p] (adp) {ADP};
    %p-MEK
    \node[macromolecule, above = 2cm of p] (pmek) {MEK};
    \node[sv] at (pmek.120) {P};
    %arcs
    \draw[consumption] (erk) -- (p.west);
    \draw[consumption] (atp) to [bend left=40] (p.west);
    \draw[production] (p.east) -- (perk);
    \draw[production] (p.east) to [bend left=40] (adp);
    \draw[catalysis] (pmek) -- (p);
\end{tikzpicture}

Here is the rendering:

alt text

Going further

To go further, a complete documentation and some examples are available.

sbgntikz also includes an SBGN-ML to TikZ converter. Basic usage is as follows:

sbgnml2tikz.py [options] INPUT

All options can be listed using using the following:

sbgnml2tikz.py --help