Skip to content

Commit

Permalink
MINVAL 0.6
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
dosorio authored Apr 1, 2017
2 parents 7a68179 + 9d79911 commit bd5f876
Show file tree
Hide file tree
Showing 14 changed files with 12,683 additions and 57 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: minval
Type: Package
Title: MINimal VALidation for Stoichiometric Reactions
Version: 1.0
Version: 0.6
Author: c(person("Daniel","Osorio",email="dcosorioh@unal.edu.co",role=c("aut","cre")), person("Janneth","Gonzalez",role=c("aut","ths")), person("Andres","Pinzon",role=c("aut","ths")))
Maintainer: Daniel Osorio <dcosorioh@unal.edu.co>
Suggests:
Expand All @@ -13,8 +13,8 @@ Suggests:
Description: For a given set of stoichiometric reactions, this package
evaluates the mass and charge balance, extracts all reactants, products, orphan
metabolites, metabolite names and compartments. Also are included some options
to write models in TSV and SBML formats.
License: GPL-2
to characterize and write models in TSV and SBML formats.
License: GPL (>= 2)
LazyData: TRUE
NeedsCompilation: no
Depends:
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(characterizeRXNs)
export(characterizeReactions)
export(checkBalance)
export(compartments)
export(downloadChEBI)
Expand Down
29 changes: 18 additions & 11 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
NEWS
====
**minval v.1.0**
*
*
*
*
*
**minval v.0.5**
#### **minval v.0.6**

* downloadChEBI function was added. This function can download any user-defined release of the ChEBI database.
* checkBalance function now includes support for decimal coefficients in stoichiometric reactions.
* characterizeReactions function was added.
* The RECON 2.04 and an unbalanced Glycolysis model in a human-readable format were included.
* The writeTSV and writeSBML functions were rewritten, the XML package dependency was removed and the support to convert modelOrg objects was added.
* Two vignettes were included
* The orphanMetabolites function was included and the orphanReactants and orphanProducts functions were added as wrappers.

#### **minval v.0.5**

* All functions were vectorized
* Functions to write TSV and SBML models were added
* A function to download the different releases of the ChEBI database was added

**minval v.0.4**
#### **minval v.0.4**

* A bug in reactants function was solved. It also affected the orphan.reactants function.

**minval v.0.3**
#### **minval v.0.3**
* A bug in products function was solved
* A bug related with spaces between metabolites was solved in several functions

**minval v.0.2**
#### **minval v.0.2**
* Some functions were rewrited
* A bug in the compartments function was solved.

**minval v.0.1**
#### **minval v.0.1**

* ChEBI database release 136 was added.
* The stoichiometric reactions from the reconstructon of the glutamate/glutamine cycle were added.
40 changes: 27 additions & 13 deletions R/characterizeRXNs.R → R/characterizeReactions.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#' @export characterizeRXNs
#' @export characterizeReactions
#' @author Daniel Camilo Osorio <dcosorioh@unal.edu.co>
# Bioinformatics and Systems Biology Lab | Universidad Nacional de Colombia
# Experimental and Computational Biochemistry | Pontificia Universidad Javeriana
#' @title Characterize stoichiometric reactions by compartments and reaction type
#' @description For a given set of stoichiometric reactions, this function: \itemize{\item Counts the number of reactions, \item Compute the relative frequency of each reaction type (transport, exchange and compartmentalized), \item Compute the relative frequency of reactions by compartment, \item Count the number of unique metabolites, \item Compute the relative frequency of metabolites by compartment.}
#' @description For a given set of stoichiometric reactions, this function: \itemize{
#' \item Counts the number of reactions,
#' \item Computes the relative frequency of each reaction type (transport, exchange and compartmentalized),
#' \item Computes the relative frequency of reactions by compartment,
#' \item Counts the number of unique metabolites,
#' \item Computes the relative frequency of metabolites by compartment.
#' }
#' @param reactionList A set of stoichiometric reaction with the following characteristics: \itemize{
#' \item Arrows symbols must be given in the form \code{'=>'} or \code{'<=>'}
#' \item Inverse arrow symbols \code{'<='} or other types as: \code{'-->'}, \code{'<==>'}, \code{'->'} will not be parsed and will lead to errors.
Expand All @@ -18,32 +24,40 @@
#' \item \code{ADP[c] + Phosphoenolpyruvate[c] => ATP[c] + Pyruvate[c]}
#' \item \code{CO2[c] <=> }
#' }
#' @param rawOutput A boolean value \code{'TRUE'} or \code{'FALSE'} if computed values should be returned instead of raw data
#' @examples
#' @param rawOutput A boolean value \code{'TRUE'} or \code{'FALSE'} if raw data should be returned instead of computed values.
#' @examples
#' # Loading a set of stoichiometric reactions
#' glycolysis <- read.csv(system.file("extdata/glycolysisModel.csv",package = "minval"), sep='\t')
#'
#' # Characterizing the reactions
#' characterizeRXNs(reactionList = glycolysis$REACTION)
characterizeRXNs <- function (reactionList, rawOutput = FALSE){
reactionList <- as.vector(reactionList)[validateSyntax(reactionList = reactionList)]
#' characterizeReactions(reactionList = glycolysis$REACTION)
characterizeReactions <- function (reactionList, rawOutput = FALSE) {
reactionList <-
as.vector(reactionList)[validateSyntax(reactionList = reactionList)]
model <- list ()
model$nReactions <- length(unique(reactionList))
model$rType <- reactionType(reactionList = reactionList)
model$cReaction <- unlist(sapply(reactionList[model$rType == "Compartmentalized reaction"], function(reaction){compartments(reactionList = reaction, uniques = TRUE)},USE.NAMES = FALSE))
model$cReaction <-
unlist(sapply(reactionList[model$rType == "Compartmentalized reaction"], function(reaction) {
compartments(reactionList = reaction, uniques = TRUE)
}, USE.NAMES = FALSE))
model$rCompartments <- compartments(reactionList = reactionList)
model$nMetabolites <- metabolites(reactionList = reactionList, uniques = TRUE)
model$cMetabolites <- compartments(reactionList = model$nMetabolites, uniques = FALSE)
model$nMetabolites <-
metabolites(reactionList = reactionList, uniques = TRUE)
model$cMetabolites <-
compartments(reactionList = model$nMetabolites, uniques = FALSE)
model$nMetabolites <- length(model$nMetabolites)
if (rawOutput == TRUE){
if (rawOutput == TRUE) {
return(model)
} else {
summary <- list ()
summary$nReactions <- model$nReactions
summary$rType <- (table(model$rType) / model$nReactions) * 100
summary$cReaction <- (table(model$cReaction)/ model$nReactions) * 100
summary$cReaction <-
(table(model$cReaction) / model$nReactions) * 100
summary$nMetabolites <- model$nMetabolites
summary$cMetabolites <- (table(model$cMetabolites)/ model$nMetabolites) * 100
summary$cMetabolites <-
(table(model$cMetabolites) / model$nMetabolites) * 100
return(summary)
}
}
2 changes: 1 addition & 1 deletion R/checkBalance.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Bioinformatics and Systems Biology Lab | Universidad Nacional de Colombia
# Experimental and Computational Biochemistry | Pontificia Universidad Javeriana
#' @title Evaluate the mass or charge balance for a set of stoichiometric reactions
#' @description For a given set of stoichiometric reactions, this function evaluate the mass or charge balance based in a reference data. Return a boolean value \code{'TRUE'} if reaction is balanced. One of \code{'mFormula'}, \code{'mWeight'} or \code{'mCharge'} arguments must be given.
#' @description For a given set of stoichiometric reactions, this function evaluates the mass or charge balance using a reference data. The \code{checkBalance} function returns a boolean value \code{'TRUE'} if the reaction is balanced. One of \code{'mFormula'}, \code{'mWeight'} or \code{'mCharge'} arguments must be given.
#' @param reactionList A set of stoichiometric reaction with the following characteristics: \itemize{
#' \item Arrows symbols must be given in the form \code{'=>'} or \code{'<=>'}
#' \item Inverse arrow symbols \code{'<='} or other types as: \code{'-->'}, \code{'<==>'}, \code{'->'} will not be parsed and will lead to errors.
Expand Down
2 changes: 1 addition & 1 deletion R/downloadChEBI.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @title Download the ChEBI database
#' @description This function downloads the compounds, formulas, masses and charges from the selected release of the ChEBI database.
#' The ChEBI database (Chemical Entities of Biological Interest), is a database and ontology of molecular entities focused on 'small' chemical compounds.
#' @param release A character string with the release number of the ChEBI database version to be downloaded, by default \code{'latest'} release is downloaded.
#' @param release A character string with the release number of the ChEBI database version to be downloaded, by default the \code{'latest'} release is downloaded.
#' @param woAssociations A logical value \code{'TRUE'} or \code{'FALSE'} if a light version of the ChEBI database without associations should be returned.
#' @return A data.frame with the following data associated to the ChEBI compounds: \itemize{
#' \item \code{'ID'}: The unique identifer
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
minval : an R package for MINimal VALidation of stoichiometric reactions
======
The **MINVAL** package was designed as a tool to identify orphan metabolites and evaluate the mass and charge balance of stoichometric reactions. **MINVAL** also includes functions to write models in TSV and SBML formats, extract all reactants, products, metabolite names and compartments from a metabolic reconstruction.
The **MINVAL** package was designed as a tool to identify orphan metabolites and evaluate the mass and charge balance of stoichiometric reactions. **MINVAL** package also includes functions to characterize and write models in TSV and SBML formats, extract all reactants, products, metabolite names and compartments from a metabolic reconstruction.

Install:
--------
This package required R version 2.10 or higher. If you are using an older version of R you will be prompted to upgrade when you try to install the package.

The official release of minval is available on CRAN. To install from CRAN, use the following command:
The official release of **MINVAL** is available on CRAN. To install from CRAN, use the following command:
```{r}
install.packages("minval", dependencies = TRUE)
```
Expand All @@ -22,7 +22,7 @@ Available functions:
-------------------
|Function | Description |
|:--------|:------------|
|characterizeRXNs|Characterize stoichiometric reactions by compartments and reaction type|
|characterizeReactions|Characterize stoichiometric reactions by compartments and reaction type|
|checkBalance|Evaluate the mass or charge balance for a set of stoichiometric reactions|
|compartments|Extract the compartments associated to metabolites of a set of stoichiometric reactions|
|downloadChEBI|Download the ChEBI database|
Expand All @@ -37,4 +37,4 @@ Available functions:

Citation
--------
Daniel Osorio, Janneth Gonzalez and Andres Pinzon (2016). **minval: MINimal VALidation for Stoichiometric Reactions**. R package version 1.0. https://CRAN.R-project.org/package=minval
Daniel Osorio, Janneth Gonzalez and Andres Pinzon (2016). **minval: MINimal VALidation for Stoichiometric Reactions**. R package version 0.6. https://CRAN.R-project.org/package=minval
Loading

0 comments on commit bd5f876

Please sign in to comment.