R/deconvolute_using_NNLS.R

Defines functions deconvolute_using_NNLS

title: "deconvolute_using_NNLS"
author: "Zach Dubrine,Thomas Goralski"
date: '2022-04-01'
output: html_document

#' @title Deconvolution using non-negative least squares
#'
#' @description used the generate the average expression profile of each cell type
#'
#' @param cluster_markers generated by Average Expression function
#' @param spots generated by generate spots function
#'
#' @export




deconvolute_using_NNLS<-function(cluster_markers, spots, L1 = 0.01){
  stopifnot(nrow(cluster_markers) == nrow(spots))
  stopifnot(rownames(cluster_markers) == rownames(spots))
  RcppML::predict.nmf(cluster_markers, spots, L1, mask = new("ngCMatrix"))
}
Goralsth/FloodLight documentation built on April 20, 2022, 12:42 a.m.