GithubHelp home page GithubHelp logo

waschina / cobrar Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 2.6 MB

COnstraint-based Reconstruction and Analysis (COBRA) of metabolic networks in R

Home Page: https://waschina.github.io/cobrar/

License: GNU General Public License v3.0

R 60.88% C++ 37.29% M4 1.82% Shell 0.01%
cobra metabolic-models metabolic-networks

cobrar's People

Contributors

jotech avatar waschina avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cobrar's Issues

Exporting an empty model

Exporting an empty model (0 reactions, 0 metabolites, 0 genes) does not work. Example:

library(cobrar)
mod <- new("modelorg",mod_id = "test")
writeSBMLmod(mod, "test.xml")

Error message:

Error: Not compatible with STRSXP: [type=NULL].
3.
stop(structure(list(message = "Not compatible with STRSXP: [type=NULL].",
call = NULL, cppstack = NULL), class = c("Rcpp::not_compatible",
"C++Error", "error", "condition"))) at RcppExports.R#209
2.
writeSBML(file_path = file_path, mod_id = model@mod_id, mod_name = model@mod_name,
mod_desc = model@mod_desc, mod_cvterms = unlist(strsplit(model@mod_attr$CVTerms[1],
";")), mod_notes = model@mod_notes, mod_sbo = sboterm2int(model@mod_attr$SBOTerm[1]),
comp_id = model@mod_compart, comp_name = model@mod_compart_name, ... at sbml_io.R#222
1.
writeSBMLmod(mod, "test.xml")

Deletion of genes leads to geneProducts in SBML with id "NA"

Example to reproduce the issue:

library(cobrar)
fpath <- system.file("extdata", "e_coli_core.xml", package="cobrar")
mod <- readSBMLmod(fpath)
mod <- rmGene(mod, gene = mod@allGenes, rm_react = FALSE)
writeSBMLmod(mod, "test.xml")

Part of resulting SBML

<reaction metaid="R_MALS" sboTerm="SBO:0000176" id="R_MALS" name="Malate synthase" reversible="false" fbc:lowerFluxBound="default_0" fbc:upperFluxBound="default_ub">
        <annotation>
          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:vCard4="http://www.w3.org/2006/vcard/ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
            <rdf:Description rdf:about="#R_MALS">
              <bqbiol:is>
                <rdf:Bag>
                  <rdf:li rdf:resource="http://identifiers.org/bigg.reaction/MALS"/>
                  <rdf:li rdf:resource="http://identifiers.org/biocyc/META:MALSYN-RXN"/>
                  <rdf:li rdf:resource="http://identifiers.org/ec-code/2.3.3.9"/>
                  <rdf:li rdf:resource="http://identifiers.org/kegg.reaction/R00472"/>
                  <rdf:li rdf:resource="http://identifiers.org/metanetx.reaction/MNXR101347"/>
                  <rdf:li rdf:resource="http://identifiers.org/rhea/18181"/>
                  <rdf:li rdf:resource="http://identifiers.org/rhea/18182"/>
                  <rdf:li rdf:resource="http://identifiers.org/rhea/18184"/>
                  <rdf:li rdf:resource="http://identifiers.org/rhea/18183"/>
                  <rdf:li rdf:resource="http://identifiers.org/seed.reaction/rxn00330"/>
                </rdf:Bag>
              </bqbiol:is>
            </rdf:Description>
          </rdf:RDF>
        </annotation>
        <listOfReactants>
          <speciesReference species="M_glx_c" stoichiometry="1" constant="true"/>
          <speciesReference species="M_h2o_c" stoichiometry="1" constant="true"/>
          <speciesReference species="M_accoa_c" stoichiometry="1" constant="true"/>
        </listOfReactants>
        <listOfProducts>
          <speciesReference species="M_h_c" stoichiometry="1" constant="true"/>
          <speciesReference species="M_mal__L_c" stoichiometry="1" constant="true"/>
          <speciesReference species="M_coa_c" stoichiometry="1" constant="true"/>
        </listOfProducts>
        <fbc:geneProductAssociation>
          <fbc:geneProductRef fbc:geneProduct="NA"/>
        </fbc:geneProductAssociation>
      </reaction>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.