Getting started

knitr::opts_chunk$set(echo = TRUE,comment=NA,R.options=list(width = 95))

Here we will show a very basic example how to use grandR to perform kinetic modeling. For much more vignettes, see the grandR website.

We will use data from [1]. These are SLAM-seq data from multiple time points (1h,2h,3h,4h) after infecting Calu-3 cells with SARS-CoV-2 (or mock as control).

We first load the grandR package and the read the GRAND-SLAM that is part of the grandR package:

suppressPackageStartupMessages({
    library(grandR)
    library(ggplot2)
    library(patchwork)
})

sars <- ReadGRAND(system.file("extdata", "sars.tsv.gz", package = "grandR"),
                 design=c(Design$Condition,Design$dur.4sU,Design$Replicate))
sars <- Normalize(sars)
sars

The GRAND-SLAM output normally contains any gene with at least 1 read, i.e. >30k genes. The data set that is part of grandR has been prefiltered and only consists of 1045 genes. For a complete workflow including filter see the full vignette. Note that we also normalized the read counts (by using size factors), which added an additional data "slot".

We start by creating a plot showing the kinetics for a gene:

PlotGeneProgressiveTimecourse(sars,"SRSF6",steady.state=list(Mock=TRUE,SARS=FALSE))

Note that this automatically fit the kinetic model for this gene, separately for the two conditions. Modeling used the default data slot, which are the size-factor normalized values, as indicated above. By using the steady.state parameter, we defined the mock infected control samples to be in steady state, whereas the virus infected samples should not be assumed to be in steady state.

We now fit the kinetic model for all genes:

SetParallel(cores = 2)  # increase on your system, or omit the cores = 2 for automatic detection
sars<-FitKinetics(sars,"kinetics",steady.state=list(Mock=TRUE,SARS=FALSE))

Modeling results are stored in two "analysis tables":

Analyses(sars)

We can retrieve this table (for more information, see the data handling vignette:

head(GetAnalysisTable(sars))

We can also easily plot the RNA half-lives of mock infected cells against virus infected cells:

PlotScatter(sars,`kinetics.Mock.Half-life`,`kinetics.SARS.Half-life`,
            lim=c(0,24),correlation = FormatCorrelation())+
  geom_abline()


Try the grandR package in your browser

Any scripts or data that you put into this service are public.

grandR documentation built on April 4, 2025, 2:27 a.m.