Skip to contents

The columns of a grandR object are samples or cells. The column annotation table contains meta information for the columns of a grandR object. When loaded from the GRAND-SLAM output, this this constructed from the sample/cell names by MakeColdata

Usage

Coldata(data, column = NULL, value = NULL)

Coldata(data, column) <- value

Arguments

data

A grandR object

column

The name of the additional annotation column; can also be a data frame (then value is ignored and the data frame is added)

value

The additional annotation per sample or cell

Value

Either the column annotation table or a new grandR object having an updated column annotation table

Details

A new column can be added either by data<-Coldata(data,name,values) or by Coldata(data,name)<-values.

Several new columns can be added by data<-Coldata(data,df) where df is either a data frame or matrix.

The column named Condition has a special meaning in this table: It is used by several functions to stratify the columns during the analysis (e.g. to estimate separate kinetic parameters with FitKinetics or it is used as covariate for LFC or LikelihoodRatioTest). For that reason there are special functions to set and get this column.

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!

head(GeneInfo(sars))
#>              Gene  Symbol Length     Type
#> 1 ENSG00000152332   UHMK1   8478 Cellular
#> 2 ENSG00000162772    ATF3   2103 Cellular
#> 3 ENSG00000090621  PABPC4   3592 Cellular
#> 4 ENSG00000185483    ROR1   5832 Cellular
#> 5 ENSG00000058673 ZC3H11A  11825 Cellular
#> 6 ENSG00000257315   ZBED6  12481 Cellular
GeneInfo(sars,"LengthCategory")<-cut(GeneInfo(sars)$Length,c(0,1500,2500,Inf),
                                          labels=c("Short","Medium","Long"))
table(GeneInfo(sars)$LengthCategory)
#> 
#>  Short Medium   Long 
#>     73    160    812