This metric was designed to help identify query cells that aren't well represented in the reference dataset. The intuition for the score is that we are going to project the query cells into a reference-defined space and then project them back onto the query. By comparing the neighborhoods before and after projection, we identify cells who's local neighborhoods are the most affected by this transformation. This could be because there is a population of query cells that aren't present in the reference or the state of the cells in the query is significantly different from the equivalent cell type in the reference.

MappingScore(anchors, ...)

# S3 method for default
MappingScore(
  anchors,
  combined.object,
  query.neighbors,
  ref.embeddings,
  query.embeddings,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)

# S3 method for AnchorSet
MappingScore(
  anchors,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)

Arguments

anchors

AnchorSet object or just anchor matrix from the Anchorset object returned from FindTransferAnchors

...

Reserved for internal use

combined.object

Combined object (ref + query) from the Anchorset object returned

query.neighbors

Neighbors object computed on query cells

ref.embeddings

Reference embeddings matrix

query.embeddings

Query embeddings matrix

kanchors

Number of anchors to use in projection steps when computing weights

ndim

Number of dimensions to use when working with low dimensional projections of the data

ksmooth

Number of cells to average over when computing transition probabilities

ksnn

Number of cells to average over when determining the kernel bandwidth from the SNN graph

snn.prune

Amount of pruning to apply to edges in SNN graph

subtract.first.nn

Option to the scoring function when computing distances to subtract the distance to the first nearest neighbor

nn.method

Nearest neighbor method to use (annoy or RANN)

n.trees

More trees gives higher precision when using annoy approximate nearest neighbor search

query.weights

Query weights matrix for reuse

verbose

Display messages/progress

Value

Returns a vector of cell scores