R/RefFreeCellMix_wrapper.R

Defines functions RefFreeCellMix_wrapper

RefFreeCellMix_wrapper <- function(Y, K) {

     if (is(Y, "SummarizedExperiment")) {
          se <- Y
          Y <- assays(se)$counts
     } else if (!is(Y, "matrix")) {
          stop("Y should be a matrix
               or a SummarizedExperiment object!")
     }

    if (K<0 | K>ncol(Y)) {
         stop("K should be between 0 and N (samples)!")
    }
    outY <- myRefFreeCellMix(Y,
           mu0=myRefFreeCellMixInitialize(Y, K = K))
    Prop0 <- outY$Omega
    return(Prop0)
}
ziyili20/TOAST documentation built on Aug. 28, 2022, 11:28 a.m.