R/simFP.R

Defines functions simFP

Documented in simFP

#' Calculate the similarity between Drug pathway Fingerprints
#'
#'
#' @title simFP
#' @param FP A ScoreFP object
#' @return a matrix
#' @importFrom Matrix Matrix
#' @importFrom proxyC simil
#' @importFrom magrittr %>%
#' @export
#' @author Yuanlong Hu
#' @examples
#'
#'   data("drugResult")
#'   sim_mat <- simFP(drugResult$demoFP)


simFP <- function(FP){
 FP <- FP@Fingerprint[-1]
 f1 <- as.data.frame(FP) %>%
   t() %>%
   Matrix::Matrix() %>%
   proxyC::simil(method = "jaccard") %>%
   as.matrix()

 return(f1)
}

Try the immcp package in your browser

Any scripts or data that you put into this service are public.

immcp documentation built on Nov. 14, 2020, 5:09 p.m.