% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/runJaccard.R
\name{runJaccard}
\alias{runJaccard}
\title{Calcualte Jaccard Index Matrix}
\usage{
runJaccard(obj, bin.downsample, tmp.folder, mat, max.var, seed.use)
}
\arguments{
\item{obj}{A Snap obj}

\item{bin.downsample}{Percentage of bins to be downsampled to [1].}

\item{tmp.folder}{A non-empty character vector giving the directory name that saves the temp files}

\item{mat}{A character class that indicates what matrix slot is used to calculate jaccard index c("bmat", "pmat", "gmat")}

\item{max.var}{A numeric variable indicates the how many dimentions for jaccard index to be calcualted}

\item{seed.use}{A numeric variable indicates the random seed to use [10].}
}
\value{
Returns a Snap obj with the jaccard index matrix stored in obj@jmat
}
\description{
This function takes a snap object as input and calculates the jaccard index matrix 
in which each entry Jij equals the intersection over the union between cell i and cell j.
}
\details{
Calculating jaccard index becomes exponentially time-consuming and also memory 
intense with the increase of cell number.

The most memory and time consuming step of our procedure is the calculation of jaccard index matrix. 
This step increases exponentially with the increase of cell number. Here, we calculate a partial jaccard 
index matrix against a random subset of reference cells in lieu of the full spectrum of features. 
Here we tested if we can perform the calculation of partial jaccard index matrix using a random 
subset of max.var reference cells.
}
\examples{
data(demo.sp);
demo.sp = makeBinary(demo.sp, mat="bmat");
demo.sp = runJaccard(obj=demo.sp, mat="bmat", bin.downsample=1, tmp.folder=tempdir())

}
