sbml2hyperdraw {BiGGR} | R Documentation

## Returns a graph representation of an SBML model

### Description

Convert an SBML model to a `RagraphBPH` using `hypergraph`. Metabolites are displayed as nodes and reactions are displayed as directed edges connecting the nodes. If a vector of rates is given, edge widths are weighted according to the rates. For negative rates, edges are drawn in red and the arrow between the metabolites is reversed to represent the correct direction of the flux.

### Usage

    sbml2hyperdraw(sbml.model, rates ,relevant.species,
    relevant.reactions,layoutType, lwd.max, lwd.min, plt.margins)

### Arguments

`sbml.model` | an rsbml `Model` object
`rates` | a named `vector` with the rates of the reactions in the model. The names of the rates must agree with the reaction identifiers in the sbml.model
`relevant.species` | a `vector` of type `character` defining a subset of species in the sbml.model to be plotted. Defaults to all species identifiers in the sbml.model.
`relevant.reactions` | a `vector` of type `character` defining a subset of reactions in the sbml.model to be plotted. Defaults to all reactions identifiers in the sbml.model.
`layoutType` | is a character string representing the layout engine to be used for visualization. Current supported layouts are "dot", "twopi","neato","fdp","sfdp" and "circo". Defaults to "dot". See `?GraphvizLayouts` for further documentation.
`lwd.max` | a `numeric` given the maximum edge width. Defaults to 3.
`lwd.min` | a `numeric` given the minimum edge width. Defaults to 0.5.
`plt.margins` | A numerical vector of the form c(bottom, left, top, right) giving additional white space around the graph (in case long node or edge labels fall outside the plotting region). Defaults to c(150,150,150,150).

### Value

Object of class `RagraphBPH` with the hypergraph representation of the SBML object.

### Author(s)

Hannes Hettling <j.hettling@vu.nl>, Anand K. Gavai <anand.gavai@bioinformatics.nl>

### See Also

RagraphBPH hyperdraw

### Examples

    ##Generate an example model
    path <- system.file("extdata", "Glycolysis_TCA_recon2_reactionIDs.txt", package="BiGGR")
    reaction.ids <- scan(path, what=" ")

    data("Recon2")
    model <- buildSBMLFromReactionIDs(reaction.ids, Recon2)

    ##Plot ATP and ADP in cytosol and mitochondrion in model without rates
    rel.sp <- c("M_adp_c", "M_atp_c", "M_adp_m", "M_atp_m")
    hd <- sbml2hyperdraw(model, relevant.species=rel.sp)
    plot(hd)

    ##Plot model with random rates
    rates <- rnorm(length(model@reactions))
    names(rates) <- sapply(model@reactions, id)
    hd <- sbml2hyperdraw(model, rates=rates, relevant.species=rel.sp, lwd.max=4)
    plot(hd)

[Package BiGGR version 1.22.0 Index]