MIMOSA is a package for fitting mixtures of beta-binomial or dirichlet-multinomial models to paired count data from single-cell assays, as typically appear in immunological studies (i.e. ICS, intracellular cytokine staining assay, or Fluidigm Biomark single-cell gene expression assays).
The method is, generally, more sensitive and specific to detect differences between conditions (i.e. stimulated vs. unstimulated samples) than alternative approaches such as Fisher's exact test, or empirical ad-hoc methods like ranking by log-fold change.
I've cleaned up the package significantly. Old code has been rewritten, hidden, and the relevant stuff has been documented. The user-facing interface has been unified to use the 'MIMOSA' function to fit data. Data is represented by 'ExpressionSet' objects from 'Biobase'. See the vignette for an example.
MIMOSA shares information across subjects by means of priors on the proportions of stimulated and unstimulated cells, respectively.
install.packages("devtools") #install devtools package
library(devtools) #load it
install_github("MIMOSA","RGLab",branch="master") #Need R 3.0.0, and a bunch of dependencies. The install will fail with various error messages until you install those dependencies.
library(MIMOSA) #load MIMOSA
library(MIMOSA)
data<-read.csv("mydata.csv")
E<-ConstructMIMOSAExpressionSet(data,
reference=STIMULATION%in%"Unstimulated",
measure.columns=c("NSUB","CYTNUM"),
.variables=.(SUBJECTID,VISIT,CYTOKINE,TCELL)) #There's a lot of options here. See the documentation and vignette.
MIMOSA(NSUB+CYTNUM~SUBJECTID|TCELL+VISIT,
E,
subset=RefTreat%in%"Treatment"&CYTOKINE%in%"IL2",
ref=RefTreat%in%"Reference"&CYTOKINE%in%"IL2")
A few things are worth explaining in the code above.
ConstructMIMOSAExpressionSet takes a data.frame as input.
The expected information in the data frame is described in the documentation and the vignette.
The call to MIMOSA takes the ExpressionSet as input. It supports the formula interface.
The formula should have the negative and positive cell counts on the left hand side (in this case NSUB is the negative cell count, and CYTNUM is the positive cell count). The right hand describes how to fit the model. In this case we fit a separate model for each visit and T cell subset across all subjects. We restrict ourselves to the IL2 cytokine. RefTreat is a pre-defined variable with levels “Reference” and “Treatment” defining the stimulated and unstimualted groups.
The definition of the reference and treatment groups will be handled internally and hidden from the end user in a future update.