MEM | R Documentation |
The MEM function takes pre-clustered, single-cell data as input and calculates relative enrichment scores for each marker on each population.
MEM(exp_data,
transform=FALSE,
cofactor=1,
choose.markers=FALSE,
markers="all",
choose.ref=FALSE,
zero.ref=FALSE,
rename.markers=FALSE,
new.marker.names="none",
file.is.clust=FALSE,
add.fileID=FALSE,
IQR.thresh=NULL,
output.prescaled.MEM=FALSE,
scale.matrix = "linear",
scale.factor = 0)
exp_data |
list of file names or a |
transform |
|
cofactor |
numeric; if |
choose.markers |
|
markers |
|
choose.ref |
|
zero.ref |
|
rename.markers |
|
new.marker.names |
|
file.is.clust |
|
add.fileID |
|
IQR.thresh |
Default |
output.prescaled.MEM |
Default |
scale.matrix |
Default |
scale.factor |
Default |
For each population and its reference, MEM first calculates median
marker levels and marker interquartile ranges (IQR
), and then calculates MEM scores according to the equation
MEM = |Median_Pop - Median_Ref| + IQR_Ref/IQR_Pop -1 ; if Median_Pop - Median_ref < 0, -MEM
A dataset is provided as an example to be used with MEM
and build_heatmaps
. Please see dataset PBMC
for more details.
Input data can be file type .txt, .fcs, or .csv. A matrix or data.frame object where the last column contains cluster identy per cell is also accepted. In all cases, the expected data structure is cells (datapoints) in rows and measured markers (i.e. features, parameters) in columns of the input data.
IQR threshold
: The MEM equation takes the ratio of population and reference IQRs and adds this value to the difference in medians. Low IQR values below 1, like those resulting from background noise level measurements, can therefore artificially inflate the overall MEM score. In order to correct this, a threshold of 0.5 is automatically applied.
However, the function can calculate an IQR threshold using the input data. If IQR_thresh is set to "auto", the threshold will be calculated as the IQR associated with the 2nd quartile median value across all populations and corresponding reference populations. This should be used if the user anticipates that 0.5 will not be an adequate threshold for the particular dataset.
MAGpop |
Matrix; Median expression level of markers on each population |
MAGref |
Matrix; Median expression on each population's corresponding reference population |
IQRpop |
Matrix; IQR of markers on each population |
IQRref |
Matrix; IQR on each population's corresponding reference population |
The object generated from MEM
is meant to be passed to build_heatmaps
which will generate MEM labels and heatmaps.
Kirsten Diggins, Sierra Lima, and Jonathan Irish
Diggins et al., Nature Methods, 2017
build_heatmaps
## For multiple file input, set working directory to folder containing files, then
## infiles <- dir()
## For single file or object input (e.g. PBMC), input data directly into MEM function
## User inputs
data(PBMC)
MEM_values = MEM(
PBMC,
transform=TRUE,
cofactor=15,
choose.markers=FALSE,
markers="all",
choose.ref=FALSE,
zero.ref = FALSE,
rename.markers=FALSE,
new.marker.names="none",
IQR.thresh=NULL,
output.prescaled.MEM=FALSE,
scale.matrix = "linear",
scale.factor = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.