Code Monkey home page Code Monkey logo

corc's Introduction

CoRC logo — the COPASI R Connector

Overview

Development Stage: Beta

CoRC, the COPASI R Connector, links the Complex Pathway Simulator COPASI (copasi.org) and the (statistical) programming environment R (r-project.org). It provides easy access to the powerful biochemical model editing, simulation and analysis backend of COPASI from the convenient R command line interface. This allows the user to develop elaborate scripts and workflows for analyses that would require a great deal of tedious manual work otherwise. These scripts can then be run interactively from the R command line interface or be sent to cluster or cloud facilities for more demanding calculations.

CoRC features:

  • high-level API for COPASI in the R language.
  • Immediate access to R’s data analysis capabilities and publication-ready plotting.
  • Reproducible workflows from data generation to analysis and plotting (R scripts and notebooks).
  • Rule-based modification of model structure to test structural variations or create large models.
  • Scaling up assays, e.g. from 3 models to 3000.
  • Handling of multiple models at once.
  • Parallelization on multi-core machines or computing clusters.

It is currently based on COPASI version 4.39 Build (272) and aims to closely follow COPASI releases in the future.

CoRC comes with the Artistic License 2.0. By using CoRC you agree to this license.

Installation

Install the CoRC package directly from GitHub:

install.packages("remotes")
remotes::install_github("jpahle/CoRC")

The installation may take a few minutes.

CoRC runs it’s own version of the COPASI backend which it will download for your platform during installation.

Usage

library(CoRC)
loadExamples(1)
#> [[1]]
#> # A COPASI model reference:
#> Model name: "The Brusselator"
#> Number of compartments: 1
#> Number of species: 6
#> Number of reactions: 4

runTimeCourse()$result
#> # A tibble: 201 × 3
#>     Time     X     Y
#>    <dbl> <dbl> <dbl>
#>  1   0   3     3    
#>  2   0.5 3.41  0.817
#>  3   1   1.90  1.28 
#>  4   1.5 0.876 1.87 
#>  5   2   0.346 2.37 
#>  6   2.5 0.183 2.66 
#>  7   3   0.147 2.86 
#>  8   3.5 0.141 3.05 
#>  9   4   0.141 3.23 
#> 10   4.5 0.142 3.41 
#> # … with 191 more rows

corc's People

Contributors

jonasfoe avatar jpahle avatar bdklahn avatar

Stargazers

WEN avatar Yigit Koray Babal avatar Pierre Millard avatar bgsmall avatar Kozo Nishida avatar Wolfgang Müller avatar  avatar

Watchers

 avatar Kozo Nishida avatar James Cloos avatar Tomas Radivoyevitch avatar Pierre Millard avatar bgsmall avatar

Forkers

fbergmann bdklahn

corc's Issues

Can't terminate running tasks

R supports interactive termination of function execution.
I have not managed to allow termination of COPASI tasks from R.
In case of exceptionally long running tasks this can be frustrating.

Add to documentation

The documentation should be extended. This might include use cases or workflows for beginners, intermediate users, as well as experts.

CoRC crashes Rscript on some configurations

Sarah reported crashes when loading models via Rscript.
This doesn't happen via interactive sessions or R -f ./file.R which can be used as workaround.
Also happens on the linux cluster.
R versions confirmed crashing: <=3.3.3
R versions confirmed safe: >=3.4.2

Reproducible via:
test.R

library(CoRC)
sessionInfo()
loadExamples(1)

Run with:

Rscript ./test.R
R -f ./test.R

Crash:

*** caught segfault ***
address 0x11000080, cause 'memory not mapped'

Traceback:
1: .Call("R_swig_CDataModel_loadModel", self, fileName, as.logical(.copy), PACKAGE = "COPASI")
2: f(x, ...)
3: c_datamodel$loadModel(normalizePathC(path))
4: force(x)
5: grab_msg(c_datamodel$loadModel(normalizePathC(path)))
6: loadModel(system.file("extdata", .x, package = pkgname))
7: .f(.x[[i]], ...)
8: .Call(map_impl, environment(), ".x", ".f", "list")
9: map(models, ~loadModel(system.file("extdata", .x, package = pkgname)))
10: loadExamples(1)
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault (core dumped)

Running 2019 PloS Comp Biol iron metabolism model of Parmar and Mendes

Wondering if you could guide me to getting this code to give time course results.
The cps files are here cpsFiles.zip

library(CoRC)
unloadAllModels()
(L=loadExamples())
runTC(model=L[[1]]) #runs fine
path="~/ccf/jarek/grants/msb/iron/parmar19sup/cps/"
(m0=loadModel(paste0(path,"IronMousePV3.cps")))
runTC(model=m0) # no results
(m1=loadModel(paste0(path,"IronMousePV3_Hemochromatosis.cps")))
runTC(model=m1) # no results

CoRC system compatibility is scarcely tested

We are currently unsure whether CoRC is stable on all system configurations.
Currently no system is known to cause crashes.
32 bit systems are unsupported.
It would be very helpful to get some feedback on which systems can fully execute the test set / where it fails.

Testing CoRC can be done as follows:

install.packages(c("remotes", "sessioninfo", "testthat"))
remotes::install_github("jpahle/CoRC", force = TRUE, INSTALL_opts = "--install-tests")
CoRC::getCopasi()
sessioninfo::session_info("CoRC")
testthat::test_package("CoRC")

The output the last two commands is of interest.

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.