plotSimulation: Plots the result of a simulation.

Description Usage Arguments Details Value Examples

View source: R/stochastic_simulation.R

Description

Automatically plots the result of a simulation (i.e. the abundance of RNAs, proteins and complexes over time) for the selected in silico individuals.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plotSimulation(
  simdf,
  molecules = NULL,
  inds = unique(simdf$Ind),
  trials = unique(simdf$trial),
  timeMin = min(simdf$time),
  timeMax = max(simdf$time),
  mergeAllele = T,
  mergePTM = T,
  mergeComplexes = F,
  yLogScale = T,
  nIndPerRow = 3,
  nCompPerRow = 10,
  ...
)

Arguments

simdf

The dataframe with the result of the simulation (see simulateInSilicoSystem).

molecules

A vector of gene IDs (numeric or character) and/or complex IDs (e.g. CTC1) to be plotted.

inds

A vector of in silico individual names for which to plot the expression profiles.

trials

A vector of trials ID (= number) to use for the plot (see details).

timeMin

Numeric. The minimum simulation time to plot. Default value set to the minimum time in the simulation.

timeMax

Numeric. The maximum simulation time to plot. Default value set to the maximum time in the simulation.

mergeAllele

Are the gene products originating from different alleles merged? Default TRUE. Also see mergeAlleleAbundance

mergePTM

Are the modified and non-modified versions of the proteins merged? Default TRUE. Also see mergePTMAbundance

mergeComplexes

Are the free and in complex gene products merged? Default FALSE. Also see mergeComplexesAbundance

yLogScale

Plot the y-axis in log10-scale? If so, the abundance of each species at each time-point is increased by 1 to avoid zero values. Default TRUE.

nIndPerRow

Positive integer, the number of individuals to plot per row. Default 3.

nCompPerRow

Positive integer, the number of components to plot per row in the legend. Default 10.

...

Any additional parameter to be passed to theme for the plot of each individual.

Details

If more than one trial is to be plotted, the mean abundance of each molecule over the different trials is plotted with a solid line, and the min and max abundances represented as coloured areas around the mean.

Value

A plot from ggarrange.

Examples

1
2
3
4
5
6
7
mysystem = createInSilicoSystem(G = 5, regcomplexes = "none", ploidy = 2)
mypop = createInSilicoPopulation(15, mysystem)
sim = simulateInSilicoSystem(mysystem, mypop, 100, ntrials = 5)
plotSimulation(sim$Simulation,
 c(1, 2, 3),
 c("Ind1", "Ind2", "Ind3", "Ind4"),
 axis.title = element_text(color = "red"))

sismonr documentation built on Feb. 11, 2020, 9:07 a.m.