Learn R Programming

grandR

Nucleotide conversion sequencing experiments have been developed to add a temporal dimension to RNA-seq and single-cell RNA seq. Such experiments require specialized tools for primary processing such as GRAND-SLAM, and specialized tools for downstream analyses. grandR provides a comprehensive toolbox for quality control, kinetic modeling, differential gene expression analysis and visualization of such data.

Installation

grandR is available from CRAN. Install grandR using the following commands on the R console:

install.packages("grandR")
library(grandR)

You can also install the development version from github:

require("devtools")
devtools::install_github("erhard-lab/grandR")
library(grandR)

System Requirements

grandR should be compatible with Windows, Mac, and Linux operating systems, but we recommend using grandR on a Linux machine, where it has been extensively tested (Ubuntu 22.04). Due to restrictions of the parallel package, parallelization (SetParallel()) does not work under Windows. grandR runs on standard laptops (multi-core CPUs are recommended and memory requirements depend on the size of your data sets).

Installing it via install.packages or devtools::install_github will make sure that the following (standard) packages are available:

stats,Matrix,rlang,ggplot2,grDevices,patchwork,RCurl,plyr,parallel,reshape2,MASS,scales,cowplot,minpack.lm,lfc,labeling,methods,utils,numDeriv

Additional packages are optional and important for particular functions:

knitr, rmarkdown, circlize, Seurat, ComplexHeatmap, ggrepel, DESeq2, S4Vectors, data.table, clusterProfiler, biomaRt, msigdbr, fgsea, rclipboard, cubature, DT, RColorBrewer, gsl, htmltools, matrixStats, monocle, VGAM, quantreg, graphics, shiny, ggrastr, viridisLite

With all dependencies available, installation of grandR typically takes less than a minute.

Cheatsheet

How to get started

First have a look at the Getting started vignette.

Then, go through the Differential expression or the Kinetic modeling vignette, which provide a comprehensive walk-through of the two main settings of nucleotide conversion experiments.

There are also additional vignettes:

Copy Link

Version

Install

install.packages('grandR')

Monthly Downloads

247

Version

0.2.7

License

Apache License (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Florian Erhard

Last Published

January 14th, 2026

Functions in grandR (0.2.7)

Condition

Get or set the conditions in the column annotation table.
ComputeTotalExpression

Total expression computation
EstimateRegulation

Estimate regulation from snapshot experiments
CreatePdfs

Convencience methods for creating QC pdfs
CreateConvolutionTable

Create Convolution Table from a Seurat object
Design

A list of predefined names for design vectors
FilterGenes

Filter genes
Findno4sUPairs

Find equivalent no4sU samples for 4sU samples
FindReferences

Obtain reference columns (samples or cells) for all columns (samples or cells) in the data set
FitKineticsPulseR

Fit kinetics using pulseR
FitKineticsGeneLogSpaceLinear

Fit a kinetic model using a linear model.
CreatePseudobulkTable

Create Pseudobulk Table from a Seurat object
Defer

Defer calling a function
DefaultSlot

Get or set the default slot for a grandR object.
DESeq2BIC

Compute the Bayesian information criterion (BIC)
FitKineticsGeneNtr

Fit a kinetic model using the degradation rate transformed NTR posterior distribution.
FitKineticsGeneSnapshot

Compute the posterior distributions of RNA synthesis and degradation for a particular gene
GetAnalysisTable

Obtain a table of analysis results values
GetContrasts

Create a contrast matrix
GetDiagnosticParameters

Describe parameters relevant to diagnostics
GetData

Obtain a tidy table of values for a gene or a small set of genes
GetTable

Obtain a genes x values table
LFC

Estimation of log2 fold changes
DesignSemantics

Build the design semantics list
IsParallel

Checks for parallel execution
FitKineticsSnapshot

Fits RNA kinetics from snapshot experiments
GetMatrix

Obtain a genes x values table as a large matrix
FormatCorrelation

Formatting function for correlations
GeneInfo

Get the gene annotation table or add additional columns to it
PairwiseDESeq2

Perform Wald tests for differential expression
FitKineticsGeneLeastSquares

Fit a kinetic model according to non-linear least squares.
FitKinetics

Fit kinetic models to all genes.
Genes

Gene and sample (or cell) names
PlotGeneProgressiveTimecourse

Plot progressive labeling timecourses
PlotGeneSnapshotTimecourse

Gene plot for snapshot timecourse data
PlotAnalyses

Convenience function to make the same type of plot for multple analyses.
PlotMismatchPositionForSample

Diagnostic plot for mismatch position for columns (by sample)
PlotMismatchPositionForType

Diagnostic plot for mismatch position for columns (by mismatch type)
PlotConversionFreq

Diagnostic plot for conversion frequencies
PlotGeneTotalVsNtr

Gene plot comparing total RNA vs the NTR
PlotHeatmap

Create heatmaps from grandR objects
LikelihoodRatioTest

Compute a likelihood ratio test.
PlotGeneGroupsBars

Plot gene values as bars
Normalize

Normalization
MakeColdata

Extract an annotation table from a formatted names vector
PlotModelLabelTimeCourse

Diagnostic plot for estimated models (4sU increase)
PlotModelErr

Diagnostic plot for estimated models (global error rate)
PlotModelCompareNtr

Diagnostic plot for estimated models (global NTR)
ReadFeatureCounts

Read featureCounts
GetPairContrasts

Create a contrast matrix for two given conditions
PlotModelCompareErr

Diagnostic plot for estimated models (global error rate)
GetSummarizeMatrix

Create a summarize matrix
Pairwise

Log2 fold changes and Wald tests for differential expression
NormalizeBaseline

Normalization to a baseline
PlotPCA

Make a PCA plot
GetSignificantGenes

Significant genes
ListGeneSets

List available gene sets
PlotModelCompareConv

Diagnostic plot for estimated models (global conversion rate)
MAPlot

Make an MA plot
ServeGrandR

Serve a shiny web interface
SetParallel

Set up parallel execution
SimulateKinetics

Simulate the kinetics of old and new RNA for given parameters.
PlotProfileLikelihood

Diagnostic plot for estimated models (global error rate)
Plots

Stored plot functions
PlotModelShape

Diagnostic plot for estimated models (global shape parameter)
PlotTypeDistribution

Plot the distribution of gene types
PlotModelNtr

Diagnostic plot for estimated models (global NTR)
SimulateReadsForSample

Simulate metabolic labeling - nucleotide conversion RNA-seq data.
Slots

Slot functions
PlotGeneGroupsPoints

Plot gene groups as points
PlotGeneOldVsNew

Gene plot comparing old vs new RNA
PlotModelConv

Diagnostic plot for estimated models (global conversion rate)
estimate.dispersion

Estimate dispersion parameters for a count matrix using DESeq2
ReadGRAND3

Read the output of GRAND-SLAM 3.0 into a grandR object.
TransformSnapshot

Estimate parameters for a one-shot experiment.
f.nonconst

Function to compute the abundance of new or old RNA at time t for non-constant rates.
UpdateSymbols

Update symbols using biomaRt
SimulateTimeCourseNonConstant

Simulate a complete time course of metabolic labeling - nucleotide conversion RNA-seq data.
ReadNewTotal

Read sparse new/total matrices
SimulateTimeCourse

Simulate a complete time course of metabolic labeling - nucleotide conversion RNA-seq data.
Semantics.time

Semantics for time columns
f.nonconst.linear

Function to compute the abundance of new or old RNA at time t for non-constant rates.
Semantics.concentration

Semantics for concentration columns
ReadGRAND

Read the output of GRAND-SLAM 2.0 into a grandR object.
Wilcoxon

Perform Wilcoxon tests for differential expression
as.Seurat.grandR

Create Seurat object from a grandR object
SaveNtrSlot

Copy the NTR slot and save under new name
VulcanoPlot

Make a Vulcano plot
UseNtrSlot

Use the given slot as NTR (is overwritten!)
ReadCounts

Read a count table
Scale

Scale data
PoolColumns

Pool reads across columns
Summarize

Summarize a data matrix
dropout

Perform 4sU dropout tests
PlotModelCompareLL

Diagnostic plot for estimated models (log likelihoods)
PlotModelCompareErrPrior

Diagnostic plot for estimated models (global error rate)
f.old.equi

Functions to compute the abundance of new or old RNA at time t.
check.analysis

Internal functions to check for a valid analysis or slot names.
correctdropout

Correct for 4sU dropout
structure2vector

Convert a structure into a vector
psapply

Parallel (s/l)apply
density2d

Density estimation in 2d
grandR

Create a grandR object and retrieve basic information
data.apply

Internal function to apply functions to all slots etc.
dropoutpercent

Estimate 4sU dropout percentages
get.mode.slot

Internal functions to parse mode.slot strings
Renamer

Create a renamer function
PlotScatter

Make a scatter plot
RotatateAxisLabels

Rotate x axis labels
ToIndex

Obtain the indices of the given genes
PlotSimulation

Plot simulated data
Transform.no

Transformations for PlotHeatmap
ComputeColumnStatistics

Compute statistics for all columns (i.e. samples or cells)
AnalyzeGeneSets

Gene set analysis
ClassifyGenes

Build the type column for the gene info table.
ComputeNonConstantParam

Compute and evaluate functions for non constant rates
Coldata

Get the column annotation table or add additional columns to it
Analyses

Analysis table functions
ComputeExpressionPercentage

Expression percentage computation
ApplyContrasts

Apply a function over contrasts
CalibrateEffectiveLabelingTimeKineticFit

Uses the kinetic model to calibrate the effective labeling time.
CalibrateEffectiveLabelingTimeMatchHalflives

Calibrate the effective labeling time by matching half-lives to a .reference
ComputePseudoNtr

Compute pseudo NTRs from two count matrices
ComputeSteadyStateHalfLives

Steady state half-lives for each sample
ComputeNtrPosteriorQuantile

Compute NTR quantiles
ComputeSummaryStatistics

Compute summary statistics