maxDists(clstutils)
maxDists()所属R语言包:clstutils
Select a maximally diverse set of items given a distance matrix.
选择一个给定的距离矩阵的项目最大不同的组。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Given a square matrix of pairwise distances, return
鉴于方阵的成对距离,返回
用法----------Usage----------
maxDists(mat, idx = NA, N = 1,
exclude = rep(FALSE, nrow(mat)),
include.center = TRUE)
参数----------Arguments----------
参数:mat
square distance matrix
距离平方矩阵
参数:idx
starting indices; if missing, starts with the object with the maximum median distance to all other objects.
开始指数;如果缺少,开始与所有其他对象的最大平均距离的对象。
参数:N
total number of selections; length of idx is subtracted.
总数的选择; IDX长度减去。
参数:exclude
boolean vector indicating elements to exclude from the calculation.
布尔向量表示的元素,从计算中排除。
参数:include.center
includes the "most central" element (ie, the one with the smallest median of pairwise distances to all other elements) if TRUE
包括“最核心的”元素(即,与所有其他元素成对距离最小的中位数),如果为TRUE
值----------Value----------
A vector of indices corresponding to the margin of mat.
指数相应的保证金mat向量。
注意----------Note----------
Note that it is important to evaluate if the candidate sequences contain outliers (for example, mislabeled sequences), because these will assuredly be included in a maximally diverse set of elements!
请注意,重要的是评估如果候选序列中含有离群值(例如,错误标签的序列),因为这些无疑将最大限度多样化的元素!
作者(S)----------Author(s)----------
Noah Hoffman
参见----------See Also----------
findOutliers
findOutliers
举例----------Examples----------
library(ape)
library(clstutils)
data(seqs)
data(seqdat)
efaecium <- seqdat$tax_name == 'Enterococcus faecium'
seqdat <- subset(seqdat, efaecium)
seqs <- seqs[efaecium,]
dmat <- ape::dist.dna(seqs, pairwise.deletion=TRUE, as.matrix=TRUE, model='raw')
## find a maximally diverse set without first identifying outliers[#无需先确定离群最大的多样化]
picked <- maxDists(dmat, N=10)
picked
prettyTree(nj(dmat), groups=ifelse(1:nrow(dmat) %in% picked,'picked','not picked'))
## restrict selected elements to non-outliers[#限制选择的元素,非离群]
outliers <- findOutliers(dmat, cutoff=0.015)
picked <- maxDists(dmat, N=10, exclude=outliers)
picked
prettyTree(nj(dmat), groups=ifelse(1:nrow(dmat) %in% picked,'picked','not picked'),
X = outliers)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|