Learn R Programming

SBpiper - Data analysis functions for SBpipe

Introduction

This R package provides an API for analysing repetitive parameter estimations and simulations of mathematical models. Examples of mathematical models are Ordinary Differential equations (ODEs) or Stochastic Differential Equations (SDEs) models. Among the analyses for parameter estimation, SBpiper calculates statistics and generates plots for parameter density, PCA of the best fits, parameter profile likelihood estimations (PLEs), and 2D parameter PLEs. These results can be generated using all or a subset of the best computed parameter sets. Among the analyses for model simulation, SBpiper calculates statistics and generates plots for deterministic and stochastic time courses via cartesian and heatmap plots. Plots for the scan of one or two model parameters can also be generated. This package is primarily used by the software SBpipe.

Citation: Dalle Pezze P, Le Novère N. SBpipe: a collection of pipelines for automating repetitive simulation and analysis tasks. BMC Systems Biology. 2017 Apr;11:46. DOI:10.1186/s12918-017-0423-3

Using this package within SBpipe

This dependency library is automatically installed by SBpipe via provided script or using conda, so no further step is needed. To install SBpipe, see here.

Installation

The stable version of SBpiper can be installed from:

  • CRAN. Start R (≥ 3.2.0) and run:
> install.packages("sbpiper")
conda install -c bioconda r-sbpiper

Once installed, the package is loaded as usual:

> library(sbpiper)

Package building (developers)

After cloning this repository, developers can check and build SBpiper using the following commands:

> devtools::check("sbpiper")
> devtools::build("sbpiper")

or outside R with the commands:

R CMD build .
R CMD check *tar.gz --as-cran

Finally, sbpiper is installed with the command:

R CMD INSTALL sbpiper_X.Y.Z.tar.gz

Here are the instructions for testing the conda package for SBpiper. This is stored in the pdp10 conda channel.

# install anaconda-client
conda install anaconda-client
anaconda login

# build the conda package (channel: pdp10):
conda-build conda_recipe/meta.yaml -c conda-forge -c defaults
 
# install the conda package (channel: pdp10):
conda install sbpiper -c pdp10 -c conda-forge -c defaults

Instructions for creating the recipe for SBpiper for the bioconda channel can be found here.

Copy Link

Version

Install

install.packages('sbpiper')

Monthly Downloads

17

Version

1.9.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Piero Dalle Pezze

Last Published

June 26th, 2018

Functions in sbpiper (1.9.0)

insulin_receptor_ps1_l4

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 4.
leftCI

Return the left value of the parameter confidence interval. The provided dataset has two columns: ObjVal | ParamValue
insulin_receptor_IR_beta_pY1146

A stochastic simulation data set for the insulin receptor beta phosphorylated at pY1146.
insulin_receptor_ps1_l9

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 9.
plot_heatmap_tc

Plot time courses organised as data frame columns with a heatmap.
insulin_receptor_ps1_l6

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 6.
plot_fits

Plot the number of iterations vs objective values in log10 scale.
histogramplot

Plot a generic histogram
kurtosis

Calculate the kurtosis of a numeric vector
insulin_receptor_ps1_l13

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 13.
insulin_receptor_ps1_l0

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 0.
insulin_receptor_exp_dataset

Experimental data set for the insulin receptor beta phosphorylated at pY1146 as published in Dalle Pezze et al. Science Signaling 2012.
parameter_pca_analysis

PCA for the parameters. These plots rely on factoextra fviz functions.
plot_sep_sims

Plot the simulations time course separately.
get_sorted_level_indexes

Return the indexes of the files as sorted by levels.
insulin_receptor_ps1_l8

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 8.
insulin_receptor_ps1_l14

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 14.
insulin_receptor_ps2_tp2

A deterministic simulation of the insulin receptor model upon scanning of 2 model parameters.
parameter_density_analysis

Parameter density analysis.
objval_vs_iters_analysis

Analysis of the Objective values vs Iterations.
normalise_vec

Normalise a vector within 0 and 1
plot_raw_dataset

Add experimental data points to a plot. The length of the experimental time course to plot is limited by the length of the simulated time course (=max_sim_tp).
pca_theme

A generic basic theme for pca. It extends ggplot2 theme_classic().
plot_single_param_scan_data

Plot model single parameter scan time courses
insulin_receptor_ps1_l16

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 16.
pe_ds_preproc

Parameter estimation pre-processing. It renames the data set columns, and applies a log10 transformation if logspace is TRUE. If all.fits is true, it also computes the confidence levels.
insulin_receptor_ps1_l3

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 3.
plot_repeated_tc

Plot repeated time courses in the same plot separately. First column is Time.
sbpiper_ps2

Main R function for SBpipe pipeline: parameter_scan2().
sampled_ple_analysis

Run the profile likelihood estimation analysis.
plot_parameter_density

Plot parameter density.
plot_comb_sims

Plot the simulation time courses using a heatmap representation.
sbpiper_sim

Main R function for SBpipe pipeline: simulate().
plot_objval_vs_iters

Plot the Objective values vs Iterations
rightCI

Return the right value of the parameter confidence interval. The provided dataset has two columns: ObjVal | ParamValue
objval.col

The name of the Objective Value column
sampled_2d_ple_analysis

2D profile likelihood estimation analysis.
sbpiper-package

sbpiper: Data Analysis Functions for 'SBpipe' Package
plot_sampled_2d_ple

Plot 2D profile likelihood estimations.
load_exp_dataset

Load the experimental data set.
plot_combined_tc

Plot repeated time courses in the same plot with mean, 1 standard deviation, and 95% confidence intervals.
tc_theme

A theme for time courses. It extends ggplot2 theme_classic().
replace_colnames

Rename data frame columns. `ObjectiveValue` is renamed as `ObjVal`. Substrings `Values.` and `..InitialValue` are removed.
scatterplot

Plot a generic scatter plot
plot_sampled_ple

Plot the sampled profile likelihood estimations (PLE). The table is made of two columns: ObjVal | Parameter
scatterplot_log10

Plot a generic scatter plot in log10 scale
plot_single_param_scan_data_homogen

Plot model single parameter scan time courses using homogeneous lines.
scatterplot_ple

Plot a profile likelihood estimation (PLE) scatter plot
sbpiper_ps1

Main R function for SBpipe pipeline: parameter_scan1().
plot_double_param_scan_data

Plot model double parameter scan time courses.
sbpiper_pe

Main R function for SBpipe pipeline: parameter_estimation().
scatterplot_w_colour

Plot a scatter plot using a coloured palette
skewness

Calculate the skewness of a numeric vector
summarise_data

Summarise the model simulation repeats in a single file.
combine_param_best_fits_stats

Combine the parameter best fits statistics.
compute_aic

Compute the Akaike Information Criterion. Assuming additive Gaussian measurement noise of width 1, the term -2ln(L(theta|y)) ~ SSR ~ Chi^2
compute_fratio_threshold

Compute the fratio threshold for the confidence level.
basic_theme

A generic basic theme for time courses. It extends ggplot2 theme_classic().
compute_bic

Compute the Bayesian Information Criterion. Assuming additive Gaussian measurement noise of width 1, the term -2ln(L(theta|y)) ~ SSR ~ Chi^2
combine_param_ple_stats

Combine the parameter PLE statistics.
get_param_names

Get parameter names
insulin_receptor_3

A stochastic model simulation
compute_cl_objval

Compute the confidence level based on the minimum objective value.
compute_sampled_ple_stats

Compute the table for the sampled PLE statistics.
compute_aicc

Compute the corrected Akaike Information Criterion. Assuming additive Gaussian measurement noise of width 1, the term -2ln(L(theta|y)) ~ SSR ~ Chi^2
check_exp_dataset

Check that the experimental data set exists.
gen_stats_table

Generate a table of statistics for each model readout.
insulin_receptor_1

A stochastic model simulation
insulin_receptor_all_fits

A parameter estimation data set including all the evaluated fits.
insulin_receptor_2

A stochastic model simulation
insulin_receptor_best_fits

A parameter estimation data set including only the best evaluated fits.
insulin_receptor_ps1_l1

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 1.
insulin_receptor_ps1_l11

A deterministic simulation of the insulin receptor model upon scanning of 1 model parameter. The initial amount of IR-beta is approx 11.