FindNeighbors {Seurat}

您所在的位置:网站首页 overlap计算CCA值 FindNeighbors {Seurat}

FindNeighbors {Seurat}

2023-06-17 02:13| 来源: 网络整理| 查看: 265

参考:R document Seurat识别细胞类群的原理FindNeighbors和FindClusters Jaccard系数_百度百科 Annoy解析 https://blog.csdn.net/qq_37696858/article/details/88143156

(Shared) Nearest-neighbor graph construction

Description Computes the k.param nearest neighbors for a given dataset. Can also optionally (via compute.SNN), construct a shared nearest neighbor graph by calculating the neighborhood overlap (Jaccard index) between every cell and its k.param nearest neighbors. 首先计算每个细胞的KNN,也就是计算每个细胞之间的相互距离,依据细胞之间邻居的overlap来构建snn graph。 计算给定数据集的k.param最近邻。也可以选择(通过compute.SNN),通过计算每个细胞最近邻之间的邻域重叠(Jaccard索引)和其邻近的k.param来构造SNN。 Usage FindNeighbors(object, ...) Default S3 method:

FindNeighbors( object, query = NULL, distance.matrix = FALSE, k.param = 20, return.neighbor = FALSE, compute.SNN = !return.neighbor, prune.SNN = 1/15, nn.method = "annoy", n.trees = 50, annoy.metric = "euclidean", nn.eps = 0, verbose = TRUE, force.recalc = FALSE, l2.norm = FALSE, cache.index = FALSE, index = NULL, ... )

S3 method for class 'Assay'

FindNeighbors( object, features = NULL, k.param = 20, return.neighbor = FALSE, compute.SNN = !return.neighbor, prune.SNN = 1/15, nn.method = "annoy", n.trees = 50, annoy.metric = "euclidean", nn.eps = 0, verbose = TRUE, force.recalc = FALSE, l2.norm = FALSE, cache.index = FALSE, ... )

S3 method for class 'dist'

FindNeighbors( object, k.param = 20, return.neighbor = FALSE, compute.SNN = !return.neighbor, prune.SNN = 1/15, nn.method = "annoy", n.trees = 50, annoy.metric = "euclidean", nn.eps = 0, verbose = TRUE, force.recalc = FALSE, l2.norm = FALSE, cache.index = FALSE, ... )

S3 method for class 'Seurat'

FindNeighbors( object, reduction = "pca", dims = 1:10, assay = NULL, features = NULL, k.param = 20, return.neighbor = FALSE, compute.SNN = !return.neighbor, prune.SNN = 1/15, nn.method = "annoy", n.trees = 50, annoy.metric = "euclidean", nn.eps = 0, verbose = TRUE, force.recalc = FALSE, do.plot = FALSE, graph.name = NULL, l2.norm = FALSE, cache.index = FALSE, ... )

Arguments object An object

... Arguments passed to other methods

query Matrix of data to query against object. If missing, defaults to object. 询问 根据对象查询的数据矩阵。如果缺少,默认为对象。 distance.matrix Boolean value of whether the provided matrix is a distance matrix; note, for objects of class dist, this parameter will be set automatically 距离矩阵 提供的矩阵是否为距离矩阵的布尔值;注意,对于dist类的对象,此参数设置为 automatically k.param Defines k for the k-nearest neighbor algorithm 这个参数用于设置 KNN 算法中最近邻的个数,默认20 return.neighbor Return result as Neighbor object. Not used with distance matrix input. 返回的邻居 将结果作为邻居对象返回。不适用于距离矩阵输入。 compute.SNN also compute the shared nearest neighbor graph 计算共享邻居的数量,一般不设置。 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). 计算SNN构造的领域重叠时,设置可接受的Jaccard指数的截止值。任何小于或者等于此值的任何边将被设置为0并从SNN图中删除。本质上设置修剪的严格性(0-不修剪,1-修剪所有内容)。 nn.method Method for nearest neighbor finding. Options include: rann, annoy 这个参数提供了如何判断邻居的方法,提供的可选是rann, annoy n.trees More trees gives higher precision when using annoy approximate nearest neighbor search 树的数量 当使用annoy的近似最近邻搜索时,树越多,给出的精度越高。 annoy.metric Distance metric for annoy. Options include: euclidean, cosine, manhattan, and hamming annoy的距离,选项包括:欧几里德、余弦、曼哈顿和汉明

nn.eps Error bound when performing nearest neighbor seach using RANN; default of 0.0 implies exact nearest neighbor search 使用RANN执行最近邻搜索时的错误界限;默认值0.0表示精确最近邻搜索 verbose Whether or not to print output to the console 是否将输出打印到控制台 force.recalc Force recalculation of (S)NN. SNN强制重新计算,一般不设置 l2.norm Take L2Norm of the data L2正则化 cache.index Include cached index in returned Neighbor object (only relevant if return.neighbor = TRUE) 在返回的邻居对象中包含缓存的索引(仅当return.neighbor = TRUE时相关) index Precomputed index. Useful if querying new data against existing index to avoid recomputing. 索引 预计算索引。如果根据现有索引查询新数据以避免重新计算,则非常有用。 features Features to use as input for building the (S)NN; used only when dims is NULL 特征 用作构建SNN神经网络输入的特征;仅当dims为空时使用 reduction Reduction to use as input for building the (S)NN 输入的降维方法,用于构建SNN神经网络 dims Dimensions of reduction to use as input 输入的降维的维度 assay Assay to use in construction of (S)NN; used only when dims is NULL 用于构造SNN神经网络的分析;仅当dims为空时使用 do.plot Plot SNN graph on tSNE coordinates 在tSNE坐标上绘制SNN图 graph.name Optional naming parameter for stored (S)NN graph (or Neighbor object, if return.neighbor = TRUE). Default is assay.name_(s)nn. To store both the neighbor graph and the shared nearest neighbor (SNN) graph, you must supply a vector containing two names to the graph.name parameter. The first element in the vector will be used to store the nearest neighbor (NN) graph, and the second element used to store the SNN graph. If only one name is supplied, only the NN graph is stored. 可选命名存储的神经网络图的参数(或邻居对象,如果返回的邻居=真)。默认为assay.name_(s)nn。要存储邻居图和共享最近邻居(SNN)图,必须向graph.name参数提供一个包含两个名称的向量。向量中的第一个元素将用于存储最近邻图,第二个元素用于存储SNN图。如果只提供一个名称,则只存储神经网络图。

Value This function can either return a Neighbor object with the KNN information or a list of Graph objects with the KNN and SNN depending on the settings of return.neighbor and compute.SNN. When running on a Seurat object, this returns the Seurat object with the Graphs or Neighbor objects stored in their respective slots. Names of the Graph or Neighbor object can be found with Graphs or Neighbors. 值 根据return.neighbor和compute.SNN的设置,该函数可以返回带有KNN信息的neighbor对象,也可以返回带有KNN和SNN的Graph对象列表。当在Seurat 对象上运行时,这将返回带有存储在各自slots中的Graph或Neighbor对象的Seurat对象。图形或邻居对象的名称可以在图形或邻居中找到。 Examples data("pbmc_small") pbmc_small Compute an SNN on the gene expression level

pbmc_small



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3