Commit 76d49fc0 authored by Mayo Roettger's avatar Mayo Roettger
Browse files

Corrections for CRAN issues

parent 3e988bb4
Package: sybilSBML
Type: Package
Title: SBML Integration in Package 'Sybil'
Version: 3.0.7
Date: 2019-08-02
Version: 3.0.8
Date: 2020-03-10
Authors@R: c(person("Mayo", "Roettger", role = "cre", email = "mayo.roettger@hhu.de"),
person("Gabriel", "Gelius-Dietrich", role = c("aut", "ctb")),
person(c("C.", "Jonathan"), "Fritzemeier", role = "ctb", email = "clausjonathan.fritzemeier@uni-duesseldorf.de"),
......@@ -17,7 +17,7 @@ License: GPL-3 | file LICENSE
LazyLoad: yes
Collate: generics.R sbmlPtrClass.R sbmlErrorClass.R sybilSBML.R
uglyHack.R readSBMLmod.R zzz.R
Packaged: 2019-08-02 15:05:20 UTC; mayo
Packaged: 2020-03-10 09:00:00 UTC; mayo
Author: Mayo Roettger [cre],
Gabriel Gelius-Dietrich [aut, ctb],
C. Jonathan Fritzemeier [ctb],
......
......@@ -973,16 +973,15 @@ else {
# if there were fbcgprRules or notes with gpr rules,
# create reaction x nGene matrix, with TRUE for respective genes for each reaction
if (isTRUE(hasNotes) || !is.null(fbcgprRules) ) {
if (isTRUE(hasNotes) || !is.null(fbcgprRules) ) {
message("GPR mapping ... ", appendLF = FALSE)
# Vector with all gene names != "":
#allGenes <- unique(allGenes)
#allGenesTMP <- unique(allGenes)
allGenesTMP <- unique(unlist(genes))
temp <- nchar(allGenesTMP)
allGenes <- allGenesTMP[which(temp != 0)]
# reaction x nGene matrix initialization with FALSE:
rxnGeneMat <- Matrix::Matrix(FALSE,
nrow = numreact,
ncol = length(allGenes),
......@@ -990,7 +989,7 @@ else {
for (i in 1 : numreact) {
# if genes list element i has only 1 element and that element is not equal ""
if ( (length(genes[[i]] == 1)) && (genes[[i]] != "") ) {
if ( (length(genes[[i]] == 1)) && all(genes[[i]] != "") ) {
geneInd <- match(genes[[i]], allGenes)# find gene in allGenes
# Mark which genes are used in reaction with TRUE
rxnGeneMat[i, geneInd] <- TRUE
......
......@@ -362,15 +362,15 @@ writeSBML<- function(morg=NULL,level=2,version=4,fbcLevel=0,filename="export.xml
# test if Matrix has no double values
if( !all( S(morg) == floor(S(morg))) ) warning("Level 1 does not support double values")
fbcLevel=0
if(version != 2)
{
warning("just Level 1 Version 2 will be supported")
version=2
}
}else if (level==2)
if(version != 2)
{
warning("just Level 1 Version 2 will be supported")
version=2
}
} else if (level==2)
{
fbcLevel=0
if(version >5)
if(version > 5)
{
warning("Level 2 Version 5 will be supported")
version=5
......@@ -380,16 +380,19 @@ writeSBML<- function(morg=NULL,level=2,version=4,fbcLevel=0,filename="export.xml
warning("Level 2 Version 1 will be supported")
version=1
}
}
else if (level==3)
{ if(fbcLevel >2)fbcLevel=2
if(version != 1)
{
print("Level 3 Version 1 will be supported")
version=1
}
}else {
} else if (level==3)
{
if(fbcLevel > 2)
{
print("FBC level 2 will be supported")
fbcLevel=2
}
if(version != 1)
{
print("Level 3 Version 1 will be supported")
version=1
}
} else {
stop(" Support just for Level 1,2 and 3 \n")
}
......@@ -630,6 +633,7 @@ writeSBML<- function(morg=NULL,level=2,version=4,fbcLevel=0,filename="export.xml
as.integer(obj_coef(morg)),
as.character(newsubS),
subSysGroups,
as.character(names(subSysGroups)),
as.character(deformatGene(gpr(morg))),
as.numeric(shrinkMatrix(morg,j=1:react_num(morg))),
mod_notes,
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for sybilSBML 3.0.7.
# Generated by GNU Autoconf 2.69 for sybilSBML 3.0.8.
#
# Report bugs to <mayo.roettger@hhu.de>.
#
......@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sybilSBML'
PACKAGE_TARNAME='sybilsbml'
PACKAGE_VERSION='3.0.7'
PACKAGE_STRING='sybilSBML 3.0.7'
PACKAGE_VERSION='3.0.8'
PACKAGE_STRING='sybilSBML 3.0.8'
PACKAGE_BUGREPORT='mayo.roettger@hhu.de'
PACKAGE_URL=''
......@@ -1241,7 +1241,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sybilSBML 3.0.7 to adapt to many kinds of systems.
\`configure' configures sybilSBML 3.0.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1303,7 +1303,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sybilSBML 3.0.7:";;
short | recursive ) echo "Configuration of sybilSBML 3.0.8:";;
esac
cat <<\_ACEOF
......@@ -1390,7 +1390,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sybilSBML configure 3.0.7
sybilSBML configure 3.0.8
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1759,7 +1759,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by sybilSBML $as_me 3.0.7, which was
It was created by sybilSBML $as_me 3.0.8, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2118,7 +2118,7 @@ if test -z "${R_HOME}"; then
fi
CC=`"${R_HOME}/bin/R" CMD config CC`
CPP=`"${R_HOME}/bin/R" CMD config CPP`
#CPP=`"${R_HOME}/bin/R" CMD config CPP`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
ac_ext=c
......@@ -4249,7 +4249,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sybilSBML $as_me 3.0.7, which was
This file was extended by sybilSBML $as_me 3.0.8, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -4311,7 +4311,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
sybilSBML config.status 3.0.7
sybilSBML config.status 3.0.8
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_INIT([sybilSBML], [3.0.7], [mayo.roettger@hhu.de])
AC_INIT([sybilSBML], [3.0.8], [mayo.roettger@hhu.de])
dnl # --------------------------------------------------------------------
dnl # global (environment) variables
......@@ -21,7 +21,7 @@ fi
dnl # GNU R default settings
CC=`"${R_HOME}/bin/R" CMD config CC`
CPP=`"${R_HOME}/bin/R" CMD config CPP`
#CPP=`"${R_HOME}/bin/R" CMD config CPP`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
AC_PROG_CC
......
......@@ -6,15 +6,19 @@
\newcommand{\CRANpkg}{\href{https://cran.r-project.org/package=#1}{\pkg{#1}}}
% ---------------------------------------------------------------------------- %
\section{Changes in version 3.0.4 - 3.0.7 2019-08-02}{
\section{Changes in version 3.0.4 - 3.0.8 2020-03-10}{
\itemize{
\item Maintainer change.
\item Changes to be able to build package without libSBML FBC and Groups
plugins. In that case, FBC-constraints and groups in the SBML model will
be ignored. Added functions \code{isAvailableFBCPlugin} and
\code{isAvailableGroupsPlugin}.
\item Corrections for CRAN, where && or || encountered arguments of length > 1.
\item Fix for CRAN issue: 'config' variable 'CPP' is deprecated.
\item Fix for CRAN issue: too many states (abstraction error?).
}
}
% ---------------------------------------------------------------------------- %
\section{Changes in version 3.0.3 2018-01-02}{
\itemize{
......@@ -23,6 +27,7 @@
for some newer models.
}
}
% ---------------------------------------------------------------------------- %
\section{Changes in version 3.0.2 2017-10-24}{
\itemize{
......
PKG_CFLAGS=
PKG_CPPFLAGS=-I/usr/include -I/usr/local/include -I/usr/include/sbml -I/usr/local/include/sbml
PKG_LIBS= -L/usr/local/lib -L/usr/lib -L/usr/lib64 -lsbml
/* src/config.h. Generated from config.h.in by configure. */
/* src/config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the `FbcReactionPlugin_getLowerFluxBound' function.
*/
#define HAVE_FBCREACTIONPLUGIN_GETLOWERFLUXBOUND 1
/* define if FBC plugin is available */
#define HAVE_FBC_PLUGIN 1
/* Define to 1 if you have the `GeneProductAssociation_setAssociation'
function. */
#define HAVE_GENEPRODUCTASSOCIATION_SETASSOCIATION 1
/* define if Groups plugin is available */
#define HAVE_GROUPS_PLUGIN 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `sbml' library (-lsbml). */
#define HAVE_LIBSBML 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `SBase_getPlugin' function. */
#define HAVE_SBASE_GETPLUGIN 1
/* Define to 1 if you have the `SBMLExtensionRegistry_getRegisteredPackages'
function. */
#define HAVE_SBMLEXTENSIONREGISTRY_GETREGISTEREDPACKAGES 1
/* Define to 1 if you have the <sbml/packages/fbc/common/FbcExtensionTypes.h>
header file. */
#define HAVE_SBML_PACKAGES_FBC_COMMON_FBCEXTENSIONTYPES_H 1
/* Define to 1 if you have the
<sbml/packages/groups/common/GroupsExtensionTypes.h> header file. */
#define HAVE_SBML_PACKAGES_GROUPS_COMMON_GROUPSEXTENSIONTYPES_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "mayo.roettger@hhu.de"
/* Define to the full name of this package. */
#define PACKAGE_NAME "sybilSBML"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "sybilSBML 3.0.6"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "sybilsbml"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "3.0.6"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
......@@ -55,7 +55,7 @@ static const R_CallMethodDef callMethods[] = {
{"getSBMLCompartList", (DL_FUNC) &getSBMLCompartList, 1},
{"getSBMLSpeciesList", (DL_FUNC) &getSBMLSpeciesList, 1},
{"getSBMLReactionsList", (DL_FUNC) &getSBMLReactionsList, 1},
{"exportSBML", (DL_FUNC) &exportSBML, 34},
{"exportSBML", (DL_FUNC) &exportSBML, 35},
{"getSBMLFbcversion", (DL_FUNC) &getSBMLFbcversion, 1},
{"isAvailableFbcPlugin", (DL_FUNC) &isAvailableFbcPlugin, 0},
{"isAvailableGroupsPlugin", (DL_FUNC) &isAvailableGroupsPlugin, 0},
......
......@@ -1682,12 +1682,12 @@ void ParseModtoAnno (SBase_t* comp , char* Mannocopy)
SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sybil_max, SEXP mod_desc, SEXP mod_name, SEXP mod_compart, SEXP met_id, SEXP met_name, SEXP met_comp, SEXP met_form, SEXP met_charge, SEXP react_id, SEXP react_name, SEXP react_rev, SEXP lowbnd, SEXP uppbnd, SEXP obj_coef, SEXP subSys, SEXP subSysGroups, SEXP gpr, SEXP SMatrix, SEXP mod_notes, SEXP mod_anno, SEXP com_notes , SEXP com_anno, SEXP met_notes, SEXP met_anno, SEXP met_bnd , SEXP react_notes, SEXP react_anno, SEXP ex_react, SEXP allgenes)
SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sybil_max, SEXP mod_desc, SEXP mod_name, SEXP mod_compart, SEXP met_id, SEXP met_name, SEXP met_comp, SEXP met_form, SEXP met_charge, SEXP react_id, SEXP react_name, SEXP react_rev, SEXP lowbnd, SEXP uppbnd, SEXP obj_coef, SEXP subSys, SEXP subSysGroups, SEXP subSysGroupsNames, SEXP gpr, SEXP SMatrix, SEXP mod_notes, SEXP mod_anno, SEXP com_notes , SEXP com_anno, SEXP met_notes, SEXP met_anno, SEXP met_bnd , SEXP react_notes, SEXP react_anno, SEXP ex_react, SEXP allgenes)
{
#if defined(HAVE_FBC_PLUGIN) && defined(HAVE_GROUPS_PLUGIN)
//Varaibles from R
//Variables from R
const char* fname = CHAR(STRING_ELT(filename, 0));
const char* model_desc = CHAR(STRING_ELT(mod_desc, 0));
//unused: const char* model_desc = CHAR(STRING_ELT(mod_desc, 0));
const char* model_name = CHAR(STRING_ELT(mod_name, 0));
int SBMLlevel = INTEGER(level)[0];
......@@ -1698,7 +1698,7 @@ SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sy
double sybilmin = sybilmax*(-1);
// variable FBC
XMLNamespaces_t * fbc;
//currently unused: XMLNamespaces_t * fbc;
SBMLNamespaces_t * sbmlns;
FluxBound_t * fluxBound;
Objective_t * objective;
......@@ -1712,13 +1712,13 @@ SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sy
// Variable inital
SBMLDocument_t* sbmlDoc;
SBMLDocument_t* sbmlDoc = NULL;
Model_t* model;
XMLNamespaces_t* xmlns;
UnitDefinition_t* unitdef;
Unit_t* unit;
//currently unused: UnitDefinition_t* unitdef;
//currently unused: Unit_t* unit;
Species_t *sp;
Reaction_t* reaction;
......@@ -1727,7 +1727,7 @@ SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sy
KineticLaw_t* kl;
Parameter_t* para;
// ASTNode_t* flux;
// ASTNode_t* flux;
ASTNode_t* astMath;
//ASTNode_t* ast;
//char* mathXMLString;
......@@ -2300,6 +2300,7 @@ SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sy
}// ENDE REACTION
if(SBMLfbcversion == 1)
{
......@@ -2358,30 +2359,31 @@ SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sy
}
}
/* add subsystem as groups if fbc is >= 2 */
if(SBMLfbcversion >= 2){
if(!Rf_isNull(subSysGroups)){
GroupsModelPlugin_t* groupsPlug = NULL;
GroupsModelPlugin_t* groupsPlug = NULL;
groupsPlug = (GroupsModelPlugin_t*) SBase_getPlugin((SBase_t *)(model), "groups");
for(int i=0; i < Rf_length(subSysGroups); i++){
Group_t* newGroup = GroupsModelPlugin_createGroup(groupsPlug);
Group_setKindAsString(newGroup, "partonomy");
Group_setName(newGroup, CHAR(STRING_ELT(Rf_getAttrib(subSysGroups, R_NamesSymbol), i)));
Group_setName(newGroup, CHAR(STRING_ELT(subSysGroupsNames, i)));
SBase_setSBOTerm((SBase_t *) newGroup, 0000633);
for(int j=0; j < Rf_length(VECTOR_ELT(subSysGroups, i)); j++){
Member_t* newMember = Member_create(SBMLlevel, SBMLversion, SBMLgroupsversion);
Member_setIdRef(newMember, CHAR(STRING_ELT(VECTOR_ELT(subSysGroups, i), j)));
Group_addMember(newGroup, newMember);
}
//GroupsModelPlugin_addGroup(groupsPlug, newGroup);
}
}
}
// write SBML file
int result = writeSBML(sbmlDoc, fname);
SEXP out = R_NilValue;
......@@ -2390,7 +2392,7 @@ SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sy
#else
SEXP out = Rf_ScalarLogical(0);/* no success */
#endif
//UNPROTECT(1);
return out;
}
......
......@@ -112,7 +112,7 @@ SEXP getSBMLGroupsList(SEXP sbmlmod);
SEXP getSBMLReactionsList(SEXP sbmlmod);
/* export Modelorg to SBML*/
SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sybil_max, SEXP mod_desc, SEXP mod_name, SEXP mod_compart, SEXP met_id, SEXP met_name, SEXP met_comp, SEXP met_form, SEXP met_charge, SEXP react_id, SEXP react_name, SEXP react_rev, SEXP lowbnd, SEXP uppbnd, SEXP obj_coef, SEXP subSys, SEXP subSysGroups, SEXP gpr, SEXP SMatrix, SEXP mod_notes, SEXP mod_anno, SEXP com_notes , SEXP com_anno, SEXP met_notes, SEXP met_anno, SEXP met_bnd , SEXP react_notes, SEXP react_anno, SEXP ex_react, SEXP allgenes);
SEXP exportSBML (SEXP version, SEXP level, SEXP FbcLevel, SEXP filename, SEXP sybil_max, SEXP mod_desc, SEXP mod_name, SEXP mod_compart, SEXP met_id, SEXP met_name, SEXP met_comp, SEXP met_form, SEXP met_charge, SEXP react_id, SEXP react_name, SEXP react_rev, SEXP lowbnd, SEXP uppbnd, SEXP obj_coef, SEXP subSys, SEXP subSysGroups, SEXP subSysGroupsNames, SEXP gpr, SEXP SMatrix, SEXP mod_notes, SEXP mod_anno, SEXP com_notes , SEXP com_anno, SEXP met_notes, SEXP met_anno, SEXP met_bnd , SEXP react_notes, SEXP react_anno, SEXP ex_react, SEXP allgenes);
/* check, if FBC-Plugin is available */
SEXP isAvailableFbcPlugin();
......
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment