Select Git revision
promptSysBiolAlg.R
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
readSBMLmod.R 42.41 KiB
#------------------------------------------------------------------------------#
# Link to libSBML for sybil #
#------------------------------------------------------------------------------#
# readSBMLmod.R
# Link to libSBML for sybil.
#
# Copyright (C) 2010-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics,
# Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany.
# All right reserved.
# Email: geliudie@uni-duesseldorf.de
#
# This file is part of sybilSBML.
#
# SybilSBML is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SybilSBML is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with sybilSBML. If not, see <http://www.gnu.org/licenses/>.
################################################
# Function: readSBMLmod
#
#
# The function readSBMLmod() is inspired by the function
# readCbModel() contained in the COBRA Toolbox.
# The algorithm is basically the same.
readSBMLmod <- function(filename, description,
def_bnd = SYBIL_SETTINGS("MAXIMUM"),
validateSBML = FALSE,
extMetFlag = "b",
bndCond = TRUE,
ignoreNoAn = FALSE,
mergeMet = TRUE,
balanceReact = TRUE,
remUnusedMetReact = TRUE,
singletonMet = FALSE,
deadEndMet = FALSE,
remMet = FALSE,
constrMet = FALSE,
tol = SYBIL_SETTINGS("TOLERANCE")) {
on.exit(expr = {
if ( (exists("sbmldoc")) && (!isNULLpointerSBML(sbmldoc)) ) {
closeSBMLfile(sbmldoc)
}
} )
#------------------------------------------------------------------------------#
# open the model file
if ( file.exists(filename) == FALSE ) {
stop("failed to open file ", sQuote(filename))
}
if (missing(description)) {
mdesc <- filename
}
else {
mdesc <- description