Title: | Different distance measures |
---|---|
Description: | A collection of software tools for calculating distance measures. |
Authors: | B. Ding, R. Gentleman and Vincent Carey |
Maintainer: | Bioconductor Package Maintainer <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.79.0 |
Built: | 2024-11-27 04:24:22 UTC |
Source: | https://github.com/bioc/bioDist |
Find the closest genes to the supplied target gene based on the supplied distances.
closest.top(x, dist.mat, top)
closest.top(x, dist.mat, top)
x |
the name of the gene (feature) to use. |
dist.mat |
either a dist object or a matrix of distances. |
top |
the number of closest genes desired. |
The feature named x
must be in the supplied distances. If so, then
the top
closest other features are returned.
A vector of names of the top
closest features.
Beiying Ding
cor.dist
, spearman.dist
, tau.dist
,euc
,
man
,KLdist.matrix
,KLD.matrix
,mutualInfo
data(sample.ExpressionSet) sE <- sample.ExpressionSet[1:100,] d1 <- KLdist.matrix(sE, sample = FALSE) closest.top(featureNames(sE)[1], d1, 5)
data(sample.ExpressionSet) sE <- sample.ExpressionSet[1:100,] d1 <- KLdist.matrix(sE, sample = FALSE) closest.top(featureNames(sE)[1], d1, 5)
Calculate pairwise Pearson correlational distances, i.e. 1-COR or 1-|COR|, and saves as a 'dist' object
cor.dist(x, ...)
cor.dist(x, ...)
x |
n by p matrix or ExpressionSet; if x is an ExpressionSet, then the function uses its 'exprs' slot. |
... |
arguments passed to
|
The cor
function is used to compute the pairwise distances between rows
of an input matrix, except if the input is an object of a class that extends
eSet and sample
is TRUE
.
Pairwise Pearson correlational distance object
Beiying Ding
spearman.dist
, tau.dist
,euc
,
man
, KLdist.matrix
, KLD.matrix
,
mutualInfo
x <- matrix(rnorm(200), nrow = 5) cor.dist(x)
x <- matrix(rnorm(200), nrow = 5) cor.dist(x)
Calculate pairwise Euclidean distances and saves the result as a 'dist' object
euc(x, ...)
euc(x, ...)
x |
n by p matrix or an object of a class that extends eSet; if x is a
matrix, pairwise distances are calculated between the rows of a matrix.
If x is an object of a class that extends eSet, the method makes use of the
'exprs' method and pairwise distances are calculated
between samples(columns) if |
... |
arguments passed to
|
The method calculates pairwise euclidean distances, assuming that all samples have the same number of observations
An object of class dist
with the pairwise Euclidean distance between rows
except in case of objects of class that extend eSet when sample
is
TRUE
Beiying Ding
spearman.dist
, tau.dist
,
man
,KLdist.matrix
,KLD.matrix
,
mutualInfo
x <- matrix(rnorm(200), nrow = 5) euc(x)
x <- matrix(rnorm(200), nrow = 5) euc(x)
Calculate KLD by estimating by smoothing
and then integrating.
KLD.matrix(x, ...)
KLD.matrix(x, ...)
x |
n by p matrix or list or an object of a class that extends eSet; if x is an an object of a class that extends eSet (eg ExpressionSet), then the function works against its 'exprs' slot. |
... |
arguments passed to
|
The distance is computed between rows of the input matrix
(except if the input is an object of a class that extends eSet
and sample
is TRUE
.
The presumption is that all samples have the same number of observations. The list method is meant for use when samples sizes are unequal.
An object of class dist
with the pairwise, between rows,
Kullback-Leibler distances.
Beiying Ding, Vincent Carey
cor.dist
, spearman.dist
,
tau.dist
, dist
,
KLdist.matrix
, mutualInfo
x <- matrix(rnorm(100), nrow = 5) KLD.matrix(x, method = "locfit", supp = range(x))
x <- matrix(rnorm(100), nrow = 5) KLD.matrix(x, method = "locfit", supp = range(x))
Calculate the KLD by binning continuous data.
KL distance is calculated using the formula
KLdist.matrix(x, ...)
KLdist.matrix(x, ...)
x |
n by p matrix or a list or an object of a class that extends eSet.
If x is an object of a class derived from eSet (ExpressionSet,SnpSet etc),
then the values returned by the |
... |
arguments passed to
|
The data are binned, and then the KL distance between the two discrete
distributions is computed and used. The distance is computed between
rows of the input matrix (except if the input is an object of a class
that extends eSet and sample
is TRUE
.
The presumption is that all samples have the same number of observations. The list method is meant for use when samples sizes are unequal.
An object of class dist
is returned.
Beiying Ding
cor.dist
, spearman.dist
,
tau.dist
,euc
,
man
,KLD.matrix
,mutualInfo
x <- matrix(rnorm(100), nrow = 5) KLdist.matrix(x, symmetrize = TRUE)
x <- matrix(rnorm(100), nrow = 5) KLdist.matrix(x, symmetrize = TRUE)
Calculate pairwise Manhattan distances and saves as a dist
object.
man(x, ...)
man(x, ...)
x |
n by p matrix or an object of class that extends eSet. If x is an object of class that extends eSet, (eg ExpressionSet) then the function uses its 'exprs' slot. |
... |
arguments passed to
|
This is just an interface to dist
with the right parameters set.
An instance of the dist
class with the pairwise Manhattan distances
between the rows of x
in case of a matrix or between the features
(rows) in case of a class that extends eSet.
Beiying Ding
cor.dist
, spearman.dist
,
tau.dist
,euc
, KLdist.matrix
,
KLD.matrix
,mutualInfo
x <- matrix(rnorm(200), nrow = 5) man(x)
x <- matrix(rnorm(200), nrow = 5) man(x)
Calculate mutual information via binning
mutualInfo(x, ...) MIdist(x, ...)
mutualInfo(x, ...) MIdist(x, ...)
x |
an n by p matrix or ExpressionSet; if x is an ExpressionSet, then the function uses its 'exprs' slot. |
... |
arguments passed to
|
For mutualInfo
each row of x
is divided into
nbin
groups and then the mutual information is computed, treating
the data as if they were discrete.
For MIdist
we use the transformation proposed by Joe (1989),
where
is the mutual information. The
MIdist
is
then . Joe argues that this measure is then
similar to Kendall's tau,
tau.dist
.
An object of class dist
which contains the pairwise distances.
Robert Gentleman
H. Joe, Relative Entropy Measures of Multivariate Dependence, JASA, 1989, 157-164.
dist
, KLdist.matrix
,
cor.dist
, KLD.matrix
x <- matrix(rnorm(100), nrow = 5) mutualInfo(x, nbin = 3)
x <- matrix(rnorm(100), nrow = 5) mutualInfo(x, nbin = 3)
Calculate pairwise Spearman correlational distances, i.e. 1-SPEAR or
1-|SPEAR|, for all rows of a matrix and return a dist
object.
spearman.dist(x, ...)
spearman.dist(x, ...)
x |
n by p matrix or ExpressionSet; if x is an ExpressionSet, then the function uses its 'exprs' slot. |
... |
arguments passed to
|
We call cor
with the appropriate arguments to compute the row-wise correlations.
One minus the Spearman correlation, between rows of x
, are returned, as
an instance of the dist
class.
Beiying Ding
cor.dist
, tau.dist
, euc
,
man
, KLdist.matrix
, KLD.matrix
,
mutualInfo
, dist
x <- matrix(rnorm(200), nrow = 5) spearman.dist(x)
x <- matrix(rnorm(200), nrow = 5) spearman.dist(x)
Calculate pairwise Kendall's tau correlational distances,
i.e. 1-TAU or 1-|TAU|,
for all rows of the input matrix and return an instance of the
dist
class.
tau.dist(x, ...)
tau.dist(x, ...)
x |
n by p matrix or ExpressionSet; if x is an ExpressionSet, then the function uses its 'exprs' slot. |
... |
arguments passed to
|
Row-wise correlations are computed by calling the cor
function
with the appropriate arguments.
One minus the row-wise Kendall's tau correlations are returned as an
instance of the dist
class. Note that this can be extremely
slow for large data sets.
Beiying Ding
cor.dist
, spearman.dist
,
euc
, man
, KLdist.matrix
,
KLD.matrix
, mutualInfo
x <- matrix(rnorm(200), nrow = 5) tau.dist(x)
x <- matrix(rnorm(200), nrow = 5) tau.dist(x)