Learn R Programming

⚠️There's a newer version (0.2.6) of this package.Take me there.

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

353

Version

0.2.5

License

Apache License (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Florian Erhard

Last Published

February 15th, 2024

Functions in grandR (0.2.5)

ComputePseudoNtr

Compute pseudo NTRs from two count matrices
EstimateRegulation

Estimate regulation from snapshot experiments
CreatePseudobulkTable

Create Pseudobulk Table from a Seurat object
DESeq2BIC

Compute the Bayesian information criterion (BIC)
FilterGenes

Filter genes
CreateConvolutionTable

Create Convolution Table from a Seurat object
GeneInfo

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

Convencience methods for creating QC pdfs
DesignSemantics

Build the design semantics list
FitKineticsGeneSnapshot

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

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

Obtain a table of analysis results values
Defer

Defer calling a function
GetContrasts

Create a contrast matrix
Design

A list of predefined names for design vectors
FindReferences

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

Steady state half-lives for each sample
Findno4sUPairs

Find equivalent no4sU samples for 4sU samples
FitKineticsPulseR

Fit kinetics using pulseR
FitKineticsSnapshot

Fits RNA kinetics from snapshot experiments
LFC

Estimation of log2 fold changes
FormatCorrelation

Formatting function for correlations
GetData

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

Compute a likelihood ratio test.
ComputeNonConstantParam

Compute and evaluate functions for non constant rates
PlotGeneGroupsBars

Plot gene values as bars
GetDiagnosticParameters

Describe parameters relevant to diagnostics
FitKineticsGeneLeastSquares

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

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

Fit kinetic models to all genes.
ComputeNtrPosteriorQuantile

Compute NTR quantiles
PlotConversionFreq

Diagnostic plot for conversion frequencies
FitKineticsGeneLogSpaceLinear

Fit a kinetic model using a linear model.
Normalize

Normalization
GetSignificantGenes

Significant genes
GetSummarizeMatrix

Create a summarize matrix
PlotModelCompareErr

Diagnostic plot for estimated models (global error rate)
MakeColdata

Extract an annotation table from a formatted names vector
PlotModelCompareConv

Diagnostic plot for estimated models (global conversion rate)
Genes

Gene and sample (or cell) names
FitKineticsGeneNtr

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

Diagnostic plot for estimated models (global conversion rate)
PlotModelCompareNtr

Diagnostic plot for estimated models (global NTR)
PlotMismatchPositionForType

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

Obtain a genes x values table as a large matrix
PlotGeneTotalVsNtr

Gene plot comparing total RNA vs the NTR
PlotAnalyses

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

Perform Wald tests for differential expression
NormalizeBaseline

Normalization to a baseline
PlotGeneGroupsPoints

Plot gene groups as points
Pairwise

Log2 fold changes and Wald tests for differential expression
PlotModelNtr

Diagnostic plot for estimated models (global NTR)
PlotGeneOldVsNew

Gene plot comparing old vs new RNA
GetPairContrasts

Create a contrast matrix for two given conditions
PlotPCA

Make a PCA plot
GetTable

Obtain a genes x values table
PlotProfileLikelihood

Diagnostic plot for estimated models (global error rate)
ReadNewTotal

Read sparse new/total matrices
PlotModelShape

Diagnostic plot for estimated models (global shape parameter)
ReadGRAND3

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

Checks for parallel execution
PlotModelCompareErrPrior

Diagnostic plot for estimated models (global error rate)
PlotScatter

Make a scatter plot
PlotHeatmap

Create heatmaps from grandR objects
PlotModelCompareLL

Diagnostic plot for estimated models (log likelihoods)
Scale

Scale data
ReadGRAND

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

Read featureCounts
MAPlot

Make an MA plot
ListGeneSets

List available gene sets
PlotGeneProgressiveTimecourse

Plot progressive labeling timecourses
TransformSnapshot

Estimate parameters for a one-shot experiment.
Semantics.concentration

Semantics for concentration columns
UpdateSymbols

Update symbols using biomaRt
Semantics.time

Semantics for time columns
RotatateAxisLabels

Rotate x axis labels
PoolColumns

Pool reads across columns
ToIndex

Obtain the indices of the given genes
SaveNtrSlot

Copy the NTR slot and save under new name
Transform.no

Transformations for PlotHeatmap
ReadCounts

Read a count table
PlotTypeDistribution

Plot the distribution of gene types
Plots

Stored plot functions
PlotGeneSnapshotTimecourse

Gene plot for snapshot timecourse data
correctdropout

Correct for 4sU dropout
SetParallel

Set up parallel execution
PlotModelErr

Diagnostic plot for estimated models (global error rate)
PlotModelLabelTimeCourse

Diagnostic plot for estimated models (4sU increase)
ServeGrandR

Serve a shiny web interface
dropoutpercent

Estimate 4sU dropout percentages
PlotSimulation

Plot simulated data
data.apply

Internal function to apply functions to all slots etc.
SimulateTimeCourseNonConstant

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

Estimate dispersion parameters for a count matrix using DESeq2
SimulateTimeCourse

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

Copy the NTR slot and save under new name
grandR

Create a grandR object and retrieve basic information
SimulateKinetics

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

Parallel (s/l)apply
as.Seurat.grandR

Create Seurat object from a grandR object
f.nonconst

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

Make a Vulcano plot
SimulateReadsForSample

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

Convert a structure into a vector
check.analysis

Internal functions to check for a valid analysis or slot names.
f.old.equi

Functions to compute the abundance of new or old RNA at time t.
f.nonconst.linear

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

Slot functions
get.mode.slot

Internal functions to parse mode.slot strings
density2d

Density estimation in 2d
dropout

Perform 4sU dropout tests
ApplyContrasts

Apply a function over contrasts
CalibrateEffectiveLabelingTimeMatchHalflives

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

Analysis table functions
Coldata

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

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

Expression percentage computation
CalibrateEffectiveLabelingTimeKineticFit

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

Gene set analysis
ClassifyGenes

Build the type column for the gene info table.
ComputeAbsolute

Compute absolute expression using ERCC spike ins
ComputeSummaryStatistics

Compute summary statistics
Condition

Get or set the conditions in the column annotation table.