Skip to contents

The conditions column from the column annotation table is used by several functions to stratify the columns (samples or cells) 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.

Usage

Condition(data, value = NULL)

Condition(data) <- value

Arguments

data

A grandR object

value

Either a vector of column names from the column annotation table, or the condition names themselves

Value

Either the values of the condition column for Condition(data) or the grandR data object having the new condition column

Details

If the conditions column does not exist (or has been set to NULL), all analysis functions will work without stratifying samples or cells. The condition can also be set up directly when loading data, by using Condition as one of the design vector entries (see below).

The condition can be set either by data<-Condition(data,names) or by Condition(data)<-names.

See also

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!

Condition(sars)
#> NULL
Condition(sars) <- c("Cell","duration.4sU.original")
Condition(sars)
#>  [1] Mock.no4sU Mock.1h    Mock.2h    Mock.2h    Mock.3h    Mock.4h   
#>  [7] SARS.no4sU SARS.1h    SARS.2h    SARS.2h    SARS.3h    SARS.4h   
#> 10 Levels: Mock.no4sU SARS.no4sU Mock.1h SARS.1h Mock.2h SARS.2h ... SARS.4h

sars <- ReadGRAND(system.file("extdata", "sars.tsv.gz", package = "grandR"),
                  design=c("Condition",Design$dur.4sU,Design$Replicate))
#> Warning: Duplicate gene symbols (n=1, e.g. MATR3) present, making unique!
Condition(sars)
#>  [1] Mock Mock Mock Mock Mock Mock SARS SARS SARS SARS SARS SARS
#> Levels: Mock SARS