simulateParallelInSilicoSystem: Simulates an in silico system in parallel.

View source: R/stochastic_simulation.R

simulateParallelInSilicoSystemR Documentation

Simulates an in silico system in parallel.

Description

Simulates (stochastically) the behaviour of an in silico system over time using parallelisation, i.e. the expression of the different genes.

Usage

simulateParallelInSilicoSystem(
  insilicosystem,
  insilicopopulation,
  simtime,
  nepochs = -1,
  ntrials = 1,
  simalgorithm = "Direct",
  writefile = F,
  filepath = NULL,
  filename = "simulation",
  no_cores = parallel::detectCores() - 1,
  ev = getJuliaEvaluator()
)

Arguments

insilicosystem

The in silico system to be simulated (see createInSilicoSystem).

insilicopopulation

The in silico population to be simulated (see createInSilicoPopulation).

simtime

The final time of the simulation (in seconds).

nepochs

The number of times to record the state of the system during the simulation.

ntrials

The number of times the simulation must be replicated (for each individual).

simalgorithm

The name of the simulation algorithm to use in the Julia function simulate from the module BioSimulator. Possible values are: "Direct", "EnhancedDirect", "SortingDirect", "FirstReaction", "NextReaction", "TauLeapingDG2001", "TauLeapingDGLP2003", "StepAnticipation", "HybridSAL". See https://alanderos91.github.io/BioSimulator.jl/dev/man/algorithms/ for details about the algorithms.

writefile

Does the julia function write the species and reactions lists in a text file?

filepath

If writefile = TRUE, path to the folder in which the files will be created (default: current working directory).

filename

If writefile = TRUE, prefix of the files created to store the lists of species and reactions.

no_cores

The number of cores to use for the simulation. By default use the function detectCores from the parallel package to detect the number of available cores, and use this number - 1 for the simulation.

ev

A Julia evaluator. If none provided select the current evaluator or create one if no evaluator exists.

Value

A list composed of:

  • Simulation: A data-frame with the simulated expression profiles of the genes for the different individuals in the in silico population. For gene i, "Ri" corresponds to the RNA form of the gene, "Pi" to the protein form of the gene. The suffix "GCNj" indicates that the molecule comes from the j-th allele of the gene.

  • runningtime: The running time (elapsed seconds) of the parallel simulation (only 1 value).

  • stochmodel: A Julia proxy object to retrieve the stochastic system in the Julia evaluator.

Examples

## Not run: 
mysystem = createInSilicoSystem(G = 5, regcomplexes = "none", ploidy = 2)
mypop = createInSilicoPopulation(15, mysystem)
sim = simulateParallelInSilicoSystem(mysystem, mypop, 1000)
head(sim$Simulation)
## Visualising the result
plotSimulation(sim$Simulation)

## End(Not run)

oliviaAB/sismonr documentation built on June 25, 2022, 11:59 p.m.