Quantile mapping to combine two scRNA-Seq datasets based on mapping either the distribution of mean log2+1 gene expression in cell clusters to the distribution of the 2nd dataset, or mapping the quantiles of one matrix of gene expression (with genes in rows) to another.
quantile_map(
x,
y,
n = 10000,
remove_noncoding = TRUE,
remove_zeros = FALSE,
smooth = "loess",
span = 0.15,
knots = c(0.25, 0.75, 0.85, 0.95, 0.97, 0.99, 0.999),
respace = FALSE,
silent = FALSE
)A list object of class 'qqmap' containing:
Dataframe containing matching quantiles of x and y
A function of form FUN(x) where x can be supplied as a numeric
vector or matrix and the same type is returned. The function converts given
data points to the distribution of y.
scRNA-Seq data whose distribution is to be mapped onto y: either a
matrix of gene expression on log2+1 scale, or a 'cellMarkers' class object,
in which case the $genemeans list element is extracted.
Reference scRNA-Seq data: either a matrix of gene expression on
log2+1 scale, or a 'cellMarkers' class object, in which case the
$genemeans list element is extracted.
Number of quantiles to split x and y.
Logical, whether to remove noncoding. This is a basic filter which looks at the gene names (rownames) in both matrices and removes genes containing "-" which are usually antisense or mitochondrial genes, or "." which are either pseudogenes or ribosomal genes.
Logical, whether to remove zeros from both datasets. This shifts the quantile relationships.
Either "loess" or "lowess" which apply loess() or lowess()
to smooth the QQ fitted line, or "ns" which uses natural splines via
ns(). With any other value no smoothing is applied. With no smoothing or
"loess/lowess", interpolation is limited to the original range of x, i.e.
it will clip for values > max(x).
Vector of quantile points for knots for fitting natural splines.
Logical whether to respace quantile points so their x axis density is more even. Can help spline fitting.
Logical whether to suppress messages.
The conversion uses the function approxfun() which uses interpolation. It
is not designed to perform stepwise (exact) quantile transformation of every
individual datapoint.