User:Vincent Rouilly/Computational Biology With R
From OpenWetWare
< User:Vincent Rouilly(Difference between revisions)
m (→Running SBML models in R) |
Current revision (14:11, 17 December 2009) (view source) (→Tutorials) |
||
| (3 intermediate revisions not shown.) | |||
| Line 1: | Line 1: | ||
=Computational Biology with R= | =Computational Biology with R= | ||
| + | |||
| + | ==Books== | ||
| + | * [http://www.crcpress.com/product/isbn/9781420063677;jsessionid=1btcHWVjmXoP9qzHV9Mdzg** R Programming for Bioinformatics, Robert Gentleman, Fred Hutchinson, 2008] | ||
| + | * [http://www.crcpress.com/product/isbn/9781420068726 Introduction to Scientific Programming and Simulation Using R, Owen Jones et al, 2009] | ||
| + | * [http://www.r-project.org/doc/bib/R-publications.html More R Books (from R-Project.org)] | ||
| + | |||
| + | ==Software resources== | ||
| + | * [http://www.walware.de/goto/statet StatET with Eclipse], develop in R within a great IDE. | ||
| + | * [http://www.statistik.lmu.de/~leisch/Sweave/ Sweave (literate programming / reproducible science))] | ||
==Tutorials== | ==Tutorials== | ||
| + | |||
| + | === [http://www.bioconductor.org/packages/2.3/bioc/html/rsbml.html RSBML] lib === | ||
| + | * Install library | ||
| + | ** > source("http://bioconductor.org/biocLite.R") | ||
| + | ** > biocLite("rsbml") | ||
| + | * Load library | ||
| + | ** > library("rsbml") | ||
| + | |||
| + | * Load SBML model | ||
| + | * Simulate a SBML model | ||
| + | ** > dom <- rsbml_read("/my_sbml_file.xml") ## e.g. dom <- rsbml_read(system.file("sbml", "GlycolysisLayout.xml", package = "rsbml")) | ||
| + | ** > mod <- model(dom) | ||
| + | ** > sub <- new("SOSSubject", mod) | ||
| + | ** > exp <- new("SOSExperiment", subject=sub) | ||
| + | ** > simulate(exp) (Warning: it does seem to work for me at the moment) | ||
===Running SBML models in R=== | ===Running SBML models in R=== | ||
| Line 10: | Line 34: | ||
# Load library 'SBMLR' in R by typing: | # Load library 'SBMLR' in R by typing: | ||
## > library("SBMLR") | ## > library("SBMLR") | ||
| - | # | + | # Download sample SBML file describing a A-->B reaction: [[media:here]] |
| + | # Read SBML file into R | ||
| + | ## > myModel <- readSBML("AtoB.xml") | ||
| + | # Simulate model between [0,100] with 100 points | ||
| + | ## > results=simulate(myModel,seq(0,100,1)) | ||
| + | # Plot results | ||
| + | ## > attach(results) | ||
| + | ## > par(mfrow=c(2,1)) | ||
| + | ## > plot(time,s1,type="l") | ||
| + | ## > plot(time,s2,type="l") | ||
| + | ## > detach(results) | ||
| + | |||
| + | ===Perturbation analysis on compound concentration=== | ||
| + | |||
| + | # Simulate first section between [0,50], where s1=100 at t=0 (following SBML description) | ||
| + | ## > myModel=readSBML("AtoB.xml") | ||
| + | ## > result_1 = simulate(myModel,seq(0,50,1)) | ||
| + | # Simulate second section between [50,100], where s1=100 at t=50 | ||
| + | ## > myModel$species$s1$ic=50 | ||
| + | ## > results_2 = simulate(myModel,seq(50,100,1)) | ||
| + | ## > results=data.frame(rbind(results_1, results_2)) | ||
| + | ## > attach(results) | ||
| + | ## > par(mfrow=c(2,1)) | ||
| + | ## > plot(time,IMP,type="l") | ||
| + | ## > plot(time,HX,type="l") | ||
| + | ## > par(mfrow=c(1,1)) | ||
| + | ## > detach(results) | ||
| + | |||
| + | ===Perturbation analysis on kinetic rate=== | ||
Current revision
Contents |
Computational Biology with R
Books
- R Programming for Bioinformatics, Robert Gentleman, Fred Hutchinson, 2008
- Introduction to Scientific Programming and Simulation Using R, Owen Jones et al, 2009
- More R Books (from R-Project.org)
Software resources
- StatET with Eclipse, develop in R within a great IDE.
- Sweave (literate programming / reproducible science))
Tutorials
RSBML lib
- Install library
- > source("http://bioconductor.org/biocLite.R")
- > biocLite("rsbml")
- Load library
- > library("rsbml")
- Load SBML model
- Simulate a SBML model
- > dom <- rsbml_read("/my_sbml_file.xml") ## e.g. dom <- rsbml_read(system.file("sbml", "GlycolysisLayout.xml", package = "rsbml"))
- > mod <- model(dom)
- > sub <- new("SOSSubject", mod)
- > exp <- new("SOSExperiment", subject=sub)
- > simulate(exp) (Warning: it does seem to work for me at the moment)
Running SBML models in R
- Install SBMLR package
- Start R, and enter:
- > source("http://bioconductor.org/biocLite.R")
- > biocLite("SBMLR")
- Load library 'SBMLR' in R by typing:
- > library("SBMLR")
- Download sample SBML file describing a A-->B reaction: media:here
- Read SBML file into R
- > myModel <- readSBML("AtoB.xml")
- Simulate model between [0,100] with 100 points
- > results=simulate(myModel,seq(0,100,1))
- Plot results
- > attach(results)
- > par(mfrow=c(2,1))
- > plot(time,s1,type="l")
- > plot(time,s2,type="l")
- > detach(results)
Perturbation analysis on compound concentration
- Simulate first section between [0,50], where s1=100 at t=0 (following SBML description)
- > myModel=readSBML("AtoB.xml")
- > result_1 = simulate(myModel,seq(0,50,1))
- Simulate second section between [50,100], where s1=100 at t=50
- > myModel$species$s1$ic=50
- > results_2 = simulate(myModel,seq(50,100,1))
- > results=data.frame(rbind(results_1, results_2))
- > attach(results)
- > par(mfrow=c(2,1))
- > plot(time,IMP,type="l")
- > plot(time,HX,type="l")
- > par(mfrow=c(1,1))
- > detach(results)


