This function allows inspection of the local background model and the pruning of nearest neighbours for a given cell. A dimensional reduction representation is plotted where k nearest neighours and outliers are highlighted. Alternatively, the dependence of the transcript count variance or, alternatively, the coefficient of variation (CV) on the mean in log2 space is plotted. The mean-variance dependence is plotted along with a loess-regression, a second order polynomial fit, and the background model of the local variability. The CV plot also highlights the local variability associated with cell-to-cell variability of total transcript counts, as calculated directly from the mean and variance of total transcript counts (turquoise) or from a local fit of a gamma distribution (orange).
inspectKNN(
i,
expData,
res,
cl,
object = NULL,
nb = res$pars$nb,
pvalue = 0.01,
backModel = NULL,
alpha = res$alpha[i],
plotSymbol = FALSE,
id = NULL,
degree = 2,
span = 0.75,
cv = FALSE,
...
)
List object with six components:
Vector of outlier p-values (Bonferroni-corrected) for each of the k-nearest neighbours.
Vector of cluster numbers for central cell and each of the k-nearest neighbours.
alpha
parameter used for pruning.
Matrix of normalized transcript counts for the central cell and each of the k-nearest neighbours (normalized to the minimum number of total trascript counts across all neighours). Additional columns indicate inferred local mean, standard deviation, and strongest outlier p-value. Rows are sorted by p-values of the strongest outlier cell in increasing order.
Matrix of outlier p-values of all genes for the central cells and each of the k-nearest neighbours. Rows are sorted by p-values of the strongest outlier cell in increasing order.
Column name of strongest outlier.
Either integer column index or column name of expData
. Pruning is inspected for the neighbourhood of this cell.
Matrix of gene expression values with genes as rows and cells as columns. These values have to correspond to unique molecular identifier counts.
List object with k nearest neighbour information returned by pruneKnn
function.
List object with clustering information, returned by the graphCluster
function.
SCseq
class object. Required if plotSymbol
is TRUE
. Default is NULL
.
Input parameter of pruneKnn
. See help(pruneKnn)
. Default is res$pars$nb.
Positive real number between 0 and 1. All nearest neighbours with link probability < pvalue
are pruned. Default is 0.01.
Optional background model. Second order polynomial fitting the mean-variance dpendence on log2 scales as returned by lm
. Default is NULL
and the local background model is computed as in pruneKnn
.
Input parameter of pruneKnn
. See help(pruneKnn)
. Default is res$pars$alpha.
Logical. If TRUE
then a dimensional reduction representation is plotted highlighting cell i
, all k nearest neighbours, all outliers, and the stringest outlier in different colours. Function plotsymbolsmap
is used. Additional parameter for this function, such as um=TRUE
can be given. Default is FALSE
, and the local mean-variance dependence is plotted along with a second order polynomial fit and a local regression. See plotMV
.
Valid column name of expData. If plotSymbol=TRUE
this corresponding cell is highlighted in the dimensional reduction representation.
Input parameter for mean-variance fit. See plotMV
.
Input parameter for mean-variance fit. See plotMV
.
Input parameter for mean-variance fit. See plotMV
.
Additional parameters for plotsymbolsmap
.