plotSimulation: Plots the result of a simulation.

View source: R/stochastic_simulation.R

plotSimulationR Documentation

Plots the result of a simulation.

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

plotSimulation(
  simdf,
  molecules = NULL,
  inds = unique(simdf$Ind),
  trials = unique(simdf$trial),
  timeMin = min(simdf$time),
  timeMax = max(simdf$time),
  labels = NULL,
  colours = NULL,
  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.

labels

Named character vector. Gives the label of each component, to be used in the legend. The names of the vector must match the component IDs. If no label provided for a component, its ID will be used instead.

colours

Named character vector. Gives the colour to be used for each component. Size must match the number of components in the system (ignoring alleles if ploidy > 1), and names of the vector must match the components ID.

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

## Not run: 
mysystem = createInSilicoSystem(G = 5, regcomplexes = "none", ploidy = 2)
mypop = createInSilicoPopulation(15, mysystem)
sim = simulateInSilicoSystem(mysystem, mypop, 100, ntrials = 5)
plotSimulation(sim$Simulation,
 molecules = c(1, 2, 3),
 inds = c("Ind1", "Ind2", "Ind3", "Ind4"),
 labels = c("1" = "Gene A", "2" = "Gene B", "3" = "Gene C"),
 colours = c("1" = "blue", "2" = "green", "3" = "purple"),
 axis.title = element_text(color = "red"))

## End(Not run)

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