• Overview
  • FASTQ+
  • PISA
  • Yano
  • My GitHub Page
  • Discussions
    • Workflows & Short cases
      • From FASTQ to counts
      • Annotate various features
      • Select cells from reduction maps
      • Alternative splicing analysis
      • Allele-specific gene expression analysis
      • Annotating genetic variants
      • Analysis multiple Visium samples
      • Cell trajectory analysis

    On this page

    • GetWeights
      • Description
      • Usage
      • Arguments
      • Value

    GetWeights

    Source code

    Description

    Calcualte cell-cell weight matrix by one of shared nearest neighbour matrix, spatial locations, cell embedding and linear trajectory.

    Usage

    GetWeights(
      snn = NULL,
      pos = NULL,
      order.cells = NULL,
      emb = NULL,
      k.nn = 20,
      prune.distance = -1,
      prune.SNN = 1/50,
      diag.value = 0,
      cells = NULL,
      weight.method = c("dist", "average")
    )
    

    Arguments

    snn Shared nearest neighbour graph, usually can found at object[[“RNA_snn”]]. This graph can be calculate by Seurat::FindNeighbors().
    pos Tissue coordinates matrix.
    order.cells Predefined cell ranks, used for cell lineage analysis.
    emb Cell dimesional space (PCA/ICA/harmony).
    k.nn K-nearest neighbors, for calculating weight matrix with emb.
    prune.distance Sets the cutoff for cell distance on lineage trajectory (ranked cells) or spatial cooridates (bin/spot distance) when computing the neighborhood overlap for the weight matrix construction. Any edges with values greater than this will be set to 0 and removed from the weight matrix graph. Default is 50 for lineage cells, means only calculate weight edges for nearby 50 cells for each cell, while 8 for spatial coordinates.
    prune.SNN Sets the cutoff for acceptable Jaccard index when computing the neighborhood overlap for the SNN construction. Any edges with values less than or equal to this will be set to 0 and removed from the SNN graph. Essentially sets the stringency of pruning (0 — no pruning, 1 — prune everything). Default is 1/50.
    diag.value Diagnoal value in the weight matrix.
    cells Cell list. Default use all cells.

    Value

    A sparse weight matrix.

    Back to top