-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsim.calc.Rd
38 lines (32 loc) · 1.17 KB
/
sim.calc.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sim.calc.R
\name{sim.calc}
\alias{sim.calc}
\title{Similarity calculation via Weigheted Cosine similarity}
\usage{
sim.calc(input, dmat, dprob = 0.5)
}
\arguments{
\item{input}{log2 transformation of raw count matrix, row is gene and col is sample}
\item{dmat}{dropout probability matrix, each entry is the probability of
observation for gene i in cell j is a dropout event}
\item{dprob}{threshold to determine whether an observation is a dropout
event. If its dropout probability > dprob, it's a statistical
dropout event and will be given weight. The default is 0.5.}
}
\value{
a matrix containing cell-to-cell weighted consine similarity
}
\description{
Calculate weighted cosine similarity between cells
based on both input data and dropout probability
}
\examples{
data(zebrafish)
offsets <- as.numeric(log(colSums(zebrafish)))
count <- zebrafish[rowSums(zebrafish > 5) > 4, ]
# matrix of dropout probability
dp.mat <- prob.dropout(input = count, is.count = T, offsets = offsets, mcore = 3)
# similarity matrix
sim.mat <- sim.calc(log2(count+1), dp.mat)
}