facilebio / FacileAnalysis

Modular & interactive analysis components for bioinformatics
https://facilebio.github.io/FacileAnalysis
Other
17 stars 4 forks source link

Allow "single-covariate" selections to support multi-covariate selection, which generates levels on the fly #13

Open lianos opened 5 years ago

lianos commented 5 years ago

Imagine an experiment with "cell_type" and "treatment" covariates. To analyze this in a simple way, we often just create a third variable that is the concatenation of the two, eg.

group <- paste(cell_type, treatment, sep = "_")

You can then do:

flm <- flm_def(samples, covariate = "group", 
               numer = "cellA_treated", 
               denom = "cellA_untreated")

But you could imagine rather doing this:

flm <- flm_def(samples, covariate = c("cell_type", "treatment"),
               numer = "cellA_treated", 
               denom = "cellA_untreated")

so we don't have to explicitly create group anywhere.