adjusted_cosine_similarity: compute the similarity of queryProfiles and subjectProfiles

Description Usage Arguments Value Author(s) Examples

View source: R/compute_similarity.R

Description

compute the similarity of queryProfiles and subjectProfiles by adjusted cosine distance and return a vector of numeric match the queryProfiles and subjectProfiles.

Usage

1
2
3
4
5
6
adjusted_cosine_similarity(
  queryProfiles,
  subjectProfiles,
  is_parallel = TRUE,
  no_cores = NULL
)

Arguments

queryProfiles

a result of infer_profiles_vb

subjectProfiles

a result of infer_profiles_vb

is_parallel

Logical, indicating if code should be run in parallel.

no_cores

Number of cores given as input

Value

a vector of Normalized adjusted cosine similarity [0-1], Note: the more close to 1 indicates the profiles of region more similar, the more close to 0 indicates the profiles more different.

Author(s)

Hongen Kang geneprophet@163.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
similarity <- adjusted_cosine_similarity(queryProfiles=human_fit_profiles, 
                                         subjectProfiles=mouse_fit_profiles)
                                         
#check the number of non-NA
length(which(!is.na(similarity)))

#check the number of >0.9
length(which(similarity>0.9))

#check the number of <0.1
length(which(similarity<0.1))

## End(Not run)

geneprophet/BSDMR documentation built on March 3, 2021, 5:50 a.m.