simulateInSilicoSystem: Simulates an in silico system.

View source: R/stochastic_simulation.R

simulateInSilicoSystemR Documentation

Simulates an in silico system.

Description

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

Usage

simulateInSilicoSystem(
  insilicosystem,
  insilicopopulation,
  simtime,
  nepochs = -1,
  ntrials = 1,
  simalgorithm = "Direct",
  writefile = F,
  filepath = NULL,
  filename = "simulation",
  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.

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: A vector of running time of all runs of the simulation for each in silico individuals.

  • 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(1, mysystem)
sim = simulateInSilicoSystem(mysystem, mypop, simtime = 1000, ntrials = 10)
head(sim$Simulation)
## Visualising the result
plotSimulation(sim$Simulation)

## End(Not run)

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