\documentclass[a4paper,headings=small]{scrartcl}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp,lmodern}
\typearea[current]{last}
\usepackage{fixltx2e,mparhack,mathdots}

\usepackage{natbib}
%\usepackage{hyperref}

\usepackage{microtype}

\newcommand{\Comp}[1]{\texttt{#1}}
% bash command prompt
\DeclareRobustCommand{\PROMPTL}{\Comp{\$}}

% just a bash command
\DeclareRobustCommand{\COML}[1]{%
    \small{\PROMPTL\Comp{ #1}}
}
% bash command with quote environment
\DeclareRobustCommand{\COMML}[1]{%
    \begin{quote}%
        \small{\PROMPTL\Comp{ #1}}
    \end{quote}
}

\addtolength{\skip\footins}{0.5\baselineskip}
\usepackage{fnpos}


% \hypersetup{
% 	pdftitle = {sybilSBML -- Quick Start},
% 	pdfauthor = {Gabriel Gelius-Dietrich},
% 	pdfsubject = {SBML support for SyBiL},
% 	pdfkeywords = {SBML},
%     pdfborder = {0 0 0},
%     pdfhighlight = {/N}
% }


\newcommand{\pkg}[1]{\emph{#1}}
\newcommand{\CRANpkg}[1]{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
%\newcommand{\pkgname}{\CRANpkg{sybilSBML}}
\newcommand{\pkgname}{\emph{sybilSBML}}
\newcommand{\prgname}[1]{\textsc{#1}}


\begin{document}
\title{sybilSBML -- Quick Start}
%\VignetteIndexEntry{Package sybilSBML -- Quick Start}
%\VignettePackage{sybilSBML}
\author{Gabriel Gelius-Dietrich}

\maketitle


\section{Introduction}

The package \pkgname{} is an addition to package
\pkg{sybil}\footnote{\texttt{http://CRAN.R-project.org/package=sybil}}
providing support for
metabolic networks written in SBML (Systems Biology Markup Language), in
particular those developed by Bernhard \O. Palsson's
lab\footnote{\texttt{http://gcrg.ucsd.edu/}} and those from the BiGG
database\footnote{\texttt{http://bigg.ucsd.edu/}} \citep{Schellenberger:2010fk}.
\nocite{Becker:2007uq,Schellenberger:2011fk}


\section{Installation}

The package \pkgname{} depends on a working installation of
LibSBML \citep{Bornstein:2008uq} available from the SBML
homepage\footnote{\texttt{http://www.sbml.org/}, libSBML version 5.6.0 or higher}
(in particular libraries and header files).
See \Comp{INSTALL} for installation instructions and platform specific details.


\section{Usage}

The package \pkgname{} provides the command \Comp{readSBMLmod()} which reads
SBML formated files and returns instances of class \Comp{modelorg}.

<<eval=FALSE>>=
library(sybilSBML)
model <- readSBMLmod("<model>.xml")
@


\section{Input files}

The function \Comp{readSBMLmod()} reads metabolic network models written in
SBML format (Systems Biology Markup Language).  Among the models available in
this de-facto standard format are in particular those developed by
Bernhard \O. Palsson's lab.

The file \Comp{ecoli\_core\_model.xml} (in \Comp{extdata/}) contains an
exemplarily metabolic network written in SBML for the core energy metabolism
of \emph{E.~coli} \citep{Palsson:2006fk,Orth:2010fk}.
The exact location of the file can be retrieved with the \Comp{system.file()}
command:
<<>>=
library(sybilSBML)
mp     <- system.file(package = "sybilSBML", "extdata")
ec_mod <- file.path(mp, "ecoli_core_model.xml")
@
The model can be read in by using the command \Comp{readSBMLmod()}:
<<print=true>>=
mod <- readSBMLmod(ec_mod, bndCond = FALSE)
@
The metabolite id's of the SBML files are written in the format
\Comp{M\_<metabolite abbreviation>\_<compartment abbreviation>}. The compartment
abbreviation is a one letter abbreviation, e.\,g. \Comp{c} for cytosol.  All
metabolites outside the system boundary belong to compartment \Comp{b}.  Those
metabolites are transported into or outside the system.  As long as they are
mentioned, the network is closed.  The function \Comp{readSBMLmod()} will remove
them in order to produce an open network.

\section{Validation of input files}

SBML files can be validated by using the command \Comp{validateSBMLdocument()}:
<<>>=
err <- validateSBMLdocument(ec_mod)
@
The variable \Comp{err} is of class \Comp{sbmlError}, storing error messages
generated by the validation procedure.

\bibliographystyle{abbrvnat}
\bibliography{sybilSBML}

\end{document}
