Skip to contents

The grandR object contains

  • metadata about the origin (file/url) of the GRAND-SLAM output

  • the current state (e.g., what is the current default slot) of the grandR object

  • a gene info table (i.e. metadata for the rows of the data matrices)

  • a column annotation table (i.e. metadata for the columns of the data matrices)

  • several data matrices for read counts, normalized expression values, NTRs, etc. (genes x samples or genes x cells; stored in so-called slots)

  • potentially several analysis output tables (for kinetic modeling, differential gene expression testing)

Usually, this constructor is not invoked directly (but by ReadGRAND or SimulateTimeCourse).

Usage

grandR(
  prefix = parent$prefix,
  gene.info = parent$gene.info,
  slots = parent$data,
  coldata = parent$coldata,
  metadata = parent$metadata,
  analyses = NULL,
  plots = NULL,
  parent = NULL
)

Title(data)

IsSparse(data)

# S3 method for grandR
dim(x)

is.grandR(x)

# S3 method for grandR
dimnames(x)

# S3 method for grandR
print(x, ...)

Metadata(x, ...)

# S3 method for grandR
subset(x, columns, reorder = TRUE, ...)

# S3 method for grandR
split(x, f = Design$Condition, drop = FALSE, ...)

RenameColumns(data, map = NULL, fun = NULL)

SwapColumns(data, s1, s2)

# S3 method for grandR
merge(..., list = NULL, column.name = Design$Origin)

Arguments

prefix

Can either be the prefix used to call GRAND-SLAM with, or the main output file ($prefix.tsv.gz); if the RCurl package is installed, this can also be a URL

gene.info

a data frame with metadata for all genes

slots

A list of matrices representing the slots

coldata

a data frame with metadata for all samples (or cells)

metadata

a metadata list

analyses

the analyses list

plots

the plots list

parent

A parent object containing default values for all other parameters (i.e. all parameters not specified are obtained from this object)

data, x

a grandR object

...

further arguments to be passed to or from other methods.

columns

which columns (i.e. samples or cells) to return (see details)

reorder

reorder all factors in coldata (if columns for subset define a different order)

f

The name of the annotation table according to which the object is split or the new annotation table column name denoting the origin after merging

drop

unused

map

named list or vector representing a lookup table (names are current column names)

fun

a function that maps a vector of names to a new vector of names

s1, s2

column names

list

a list of grandR objects

column.name

a new name for the Coldata table to annotate the merged objects

Value

A grandR object containing the read counts, NTRs, information on the NTR posterior distribution (alpha,beta) and potentially additional information of all genes detected by GRAND-SLAM

Details

The dimensions (nrow, ncol) of the grandR object are considered to be the dimensions of the data tables, i.e. nrow(data) provides the number of genes and ncol(data) the number of samples (or cells).

Currently, the object is implemented as a list of the above mentioned items. This implementation is subject to change. Make sure to use accessor functions to obtain the information you want.

Columns can be given as a logical, integer or character vector representing a selection of the columns (samples or cells). The expression is evaluated in an environment havin the Coldata, i.e. you can use names of Coldata as variables to conveniently build a logical vector (e.g., columns=Condition=="x").

Functions

Title

Obtain a useful title for the project (from the prefix parameter)

dim

Obtain the dimensions (genes x samples or genes x cells)

is

Check whether it is a grandR object

dimnames

Obtain the row and column names of this object (genes x samples or genes x cells)

print

Print information on this grandR object

subset

Create a new grandR object with a subset of the columns (use FilterGenes to subset on genes)

split

Split the grandR object into a list of multiple grandR objects (according to the levels of an annotation table column)

RenameColumns

Rename the column names according to a lookup table (map) or a function (invoked on the current names)

SwapColumns

Swap two columns (samples or cells); this is what you do if samples were mislabeled!

Metadata

Obtain global metadata

merge

Merge several grandR objects into one

Examples

sars <- ReadGRAND(system.file("extdata", "sars.tsv.gz", package = "grandR"),
                  design=c("Cell",Design$dur.4sU,Design$Replicate))
#> Warning: Duplicate gene symbols (n=1, e.g. MATR3) present, making unique!
# this is part of the corona data from Finkel et al.
dim(sars)
#> [1] 1045   12
head(rownames(sars))
#> [1] "ENSG00000152332" "ENSG00000162772" "ENSG00000090621" "ENSG00000185483"
#> [5] "ENSG00000058673" "ENSG00000257315"