https://github.com/satijalab/seurat
Raw File
Tip revision: 49a1be0427f2f26a531eb468ba93eeb18d8a2edb authored by satijalab on 13 December 2019, 20:42:25 UTC
Merge pull request #2416 from satijalab/develop
Tip revision: 49a1be0
CustomDistance.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utilities.R
\name{CustomDistance}
\alias{CustomDistance}
\title{Run a custom distance function on an input data matrix}
\usage{
CustomDistance(my.mat, my.function, ...)
}
\arguments{
\item{my.mat}{A matrix to calculate distance on}

\item{my.function}{A function to calculate distance}

\item{...}{Extra parameters to my.function}
}
\value{
A distance matrix
}
\description{
Run a custom distance function on an input data matrix
}
\examples{
# Define custom distance matrix
manhattan.distance <- function(x, y) return(sum(abs(x-y)))

input.data <- GetAssayData(pbmc_small, assay.type = "RNA", slot = "scale.data")
cell.manhattan.dist <- CustomDistance(input.data, manhattan.distance)

}
\author{
Jean Fan
}
back to top