sismonr tutorial

Olivia Angelin-Bonnet


This document is a tutorial demonstrating how to use the sismonr package. Note that a more complete tutorial is available at [].

Getting started

Installing Julia

To install Julia, go to and follow the instructions. In brief:

Adding Julia to the PATH environment variable

For sismonr to be able to use Julia, the Julia executable must be in the PATH environment variable. You can add it as follow:

After this step it is necessary to restart your computer.

Installing sismonr

sismonr is available on the CRAN. You can install it with:

If Julia is not installed on your computer or the Julia executable is not in your PATH environment variable, you won’t be able to use sismonr.

sismonr resources

An online documentation is available at


In order to use sismonr we need to load the package. You will notice that every time you load the package, sismonr checks that the necessary Julia modules are installed. If not, it automatically installs them for you.


1. Creating an in silico system

The first step to simulate gene expression data is to generate an in silico system. The in silico system contains the list of genes whose expression we want to simulate along with the Gene Regulatory Network (GRN) representing the regulatory interactions among the genes. We can generate a random in silico system with:

The different parameters passed to the function allow the user to control different aspects of the generated system. For example, G defines the number of genes present in the system. PC.p gives the probability for each gene to be protein-coding (so setting PC.p = 1 ensures that there are only protein-coding genes in the system). ploidy defines the ploidy of the system, that is, the number of copies of each gene present in the system. A list of all parameters can be seen in the online documentation of sismonr or by typing:

We’ll see the effect of some of these parameters in the next sections.

The function returns an object of class insilicosystem, which is a list containing the different attributes of the system:

The next sections allow you to explore the in silico system we created.


The list of regulatory interactions in the system is stored in the edg element:

The regulatory complexes

The list of regulatory complexes in the system is stored in the complexes element. Their kinetic parameters are stored in the complexeskinetics element:

It is likely to be empty if the number of genes is small, as regulatory complexes are generated from regulators targeting a common gene in the GRN. You can try increasing the number of genes in the system so see some complexes.

The complexesTargetReaction object gives the biological function of each complex, with the same code than for genes (e.g. “TC” means regulator of transcription).

Plotting the GRN

You can visualise the GRN in your system with:

By default all the types of regulation are drawn. You can also plot only a specific type of regulation:

Kinetic properties of the regulatory interactions

The edg element contains all the regulations occuring in the system. However each type of regulation is characterised by a distinct set of kinetic properties (e.g. to model a transcription regulation we need to know the binding and unbinding rates of the regulator to the target binding site, and the fold-change induced in the target transcription rate when the regulator is bound). This information is stored in a set of data-frames, one for each type of regulation. These data-frames are found in the mosystem element of the system:

2. Creating an in silico population

The second step to simulate gene expression data is to generate an in silico population. In a population, different variants of each gene are segregating (by default with equal frequency). Each gene variant is characterised by a set of QTL effect coefficient values that describe how genetic mutations affect the kinetic properties of the gene. Each in silico individual carries one or more copies of each gene (depending on the ploidy of the system), and these copies are sampled from the list of variants segregating in the population.

Here we create a population of individuals, with 4 variants existing for each gene. We create 3 individuals:

The first parameter to be passed to createInSilicoPopulation is the number of individuals to be created, and the second is the in silico system we generated in the first step. Additional arguments can be given to the function, to control the properties of the individuals. A list of these arguments are available in the online documentation, or with:

The function returns an object of class insilicopopulation, which is a list containing the different attributes of the system:

The gene variants

The list of variants segregating in the population for each gene is stored in the GeneVariants element of the in silico population.

You can see the effect of changing the parameters passed to the createInSilicoPopulation function. You can even supply your own list of segregating variants and the frequency of these variants:

The in silico individuals

The list of in silico individuals created is stored in the individualsList element:

Each individual is characterised by the variants that it carries for each gene:

As the individuals are diploid, they have two copies of each genes. The alleles are termed GCN1 and GCN2. Each row represents a gene, and the values in the data-frame correspond to the variant numbers of the genes that the individual carries.

You can visualise the QTL effect coefficients of each variant carried by the individuals:

The function plotMutations takes as arguments the in silico population and the in silico system, and plot the value (colour) of each QTL effect coefficient (x-axis) for each allele (y-axis) of each gene (columns) for each individual in the population (rows). As some QTL effect coefficients do not apply to noncoding genes (i.e. mutations that would affect the translation or protein life), they are greyed in the plot.

You can zoom on specific genes, individuals, alleles or sets of QTL effect coefficients:

3. Simulating the in silico system

To get the expression of the different genes for each in silico individual, we will perform a stochastic simulation:

or with the parallelised version of the simulation function:

The argument simtime allows you to control the simulation end time in seconds (here we simulate the expression of the genes for 1000 s). ntrials correspond to the number of repetitions of the simulation that will be computed for each individual (here set to 5).

The returned object contains the running time (in seconds) of each individual’s simulation.

The results of the simulation are stored as a data-frame in the Simulation element of the simulation output:

in which each row corresponding to one time-point of one run of a simulation for one in silico individual.

You can visualise the results of your simulations in the form of a time-series of gene expression with:

The abundance of the different species (separated by RNAs -bottom-, proteins -middle- and regulatory complexes -top-) are plotted over time. As the simulation has been repeated 5 times for each individual, the mean abundance of the molecules over the different repetitions or trials is plotted as a solid line, and the minimum and maximum values are represented by the coloured areas. By default the abundances are plotted on a log10 scale, but you can change that with the option yLogScale = F in the plotSimulation function.

The legend is presented as a table that gives for each component (columns) the different forms in which it can be found. The component names that are numbers correspond to the gene IDs. We can find the different genes either as RNAs or proteins. Gene IDs with the prefix “PTM” correspond to modified forms of proteins. Components with a name starting with a “C” correspond to regulatory complexes.

You can focus the plot on certain individuals or time-period:

You can also visualise the output of the simulation as a heatmap, with the same arguments as the plotSimulation function:

Transforming the simulation results

In the results of the simulation, molecules originating from different alleles of a same gene are differentiated by the suffix GCNi. You can merge these molecules to obtain the abundance of the corresponding molecule regardless of its allele of origin with:

Similarly, you can merge non-modified and post-translationally modified versions of a same protein:

or the abundance of free and in-complex molecules: