R/ADAPTS.R

Defines functions Adapts

Documented in Adapts

#' Deconvolution Methods of ADAPTS
#'
#' ADAPTS helps users to Estimate of cellular fractions by three framework for cell type deconvolution.
#'
#' @param bulkdata A matrix with genes in rows and samples in columns.
#' @param signature A data-frame containing signatures of different cell types.
#' @param SubMethod  one of four methods, inclusd of "DCQ","nnls", "DeconRNASeq",
#' "proportionsInAdmixture", and "SVMDECON".
#'
#' @importFrom ADAPTS estCellPercent
#' @return Mixed cell composition estimation ratio data frame
#' @export
#'
#' @examples
#'
#'Bulk <- Bulk_GSE60424
#'res <- Adapts(bulkdata = Bulk,
#'              signature = LM22,
#'              SubMethod = "nnls")





Adapts <- function(bulkdata, signature,  SubMethod = "nnls") {


  bulkdata <- bulkdata[apply(bulkdata, 1, var) != 0, ]

  res <- ADAPTS::estCellPercent(refExpr = signature,
                                geneExpr = bulkdata,
                                method = SubMethod)
  res_Adapts <- t(res)



  return(res_Adapts)
}
libcell/deconvBench documentation built on Sept. 24, 2022, 12:36 p.m.