runJaccard | R Documentation |
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.
runJaccard(obj, bin.downsample, tmp.folder, mat, max.var, seed.use)
obj |
A Snap obj |
bin.downsample |
Percentage of bins to be downsampled to [1]. |
tmp.folder |
A non-empty character vector giving the directory name that saves the temp files |
mat |
A character class that indicates what matrix slot is used to calculate jaccard index c("bmat", "pmat", "gmat") |
max.var |
A numeric variable indicates the how many dimentions for jaccard index to be calcualted |
seed.use |
A numeric variable indicates the random seed to use [10]. |
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.
Returns a Snap obj with the jaccard index matrix stored in obj@jmat
data(demo.sp); demo.sp = makeBinary(demo.sp, mat="bmat"); demo.sp = runJaccard(obj=demo.sp, mat="bmat", bin.downsample=1, tmp.folder=tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.