#' singscore
#'
#' @param bulkdata A matrix with genes in rows and samples in columns.
#' @param tissue One of "BLOOD","LIVER","LUNG","MUSCLE","OVARY","HEART","BONE",
#' "ESOPHAGUS","STOMACH","GASTRIC","PANCREAS","CEREBELLUM",
#' "NEUROTYPES","RETINA","EYE","THYMUS","INTESTINE","ADRENAL",
#' "ESOPHAGEAL","DUODENAL","OLFACTORY","CEREBRUM".
#' @importFrom singscore rankGenes simpleScore
#' @importFrom GSEABase getGmt
#' @return A data frame of Mixed cellular fractions.
#' @export
#' @examples
#'
#' Bulk <- Bulk_GSE60424
#' res <- Singscore(bulkdata = Bulk,
#' tissue = "BLOOD")
#'
#'
Singscore <- function(bulkdata,tissue) {
rankData <- singscore::rankGenes(bulkdata)
probpath <- system.file("extdata", "c8.all.v7.4.symbols.gmt", package = "deconvBench")
geneset <- GSEABase::getGmt(probpath)
Tissue <- c("BLOOD","LIVER","LUNG","MUSCLE","OVARY","HEART","BONE",
"ESOPHAGUS","STOMACH","GASTRIC","PANCREAS","CEREBELLUM",
"NEUROTYPES","RETINA","EYE","THYMUS","INTESTINE","ADRENAL",
"ESOPHAGEAL","DUODENAL","OLFACTORY","CEREBRUM")
if(any(Tissue==tissue)){
tissue_geneset <- geneset[names(geneset)[grep(tissue,names(geneset))]]
singscore_res <- NULL
for ( aaa in tissue_geneset) {
scoredf <- suppressWarnings(singscore::simpleScore(rankData,upSet=aaa))
singscore_res <- cbind(singscore_res,scoredf$TotalScore)
}
rownames(singscore_res) <- colnames(rankData)
colnames(singscore_res) <- names(tissue_geneset)
}else{stop("Please enter one of the sample tissue
types:BLOOD,LIVER,LUNG, MUSCLE,OVARY,HEART,BONE,
ESOPHAGUS,STOMACH,GASTRIC,PANCREAS,CEREBELLUM,
NEUROTYPES,RETINA,EYE,THYMUS,INTESTINE,ADRENAL,
ESOPHAGEAL,DUODENAL,OLFACTORY,CEREBRUM")
}
res_Singscore <- singscore_res
return(res_Singscore)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.