This function launches a Shiny app to inspect the gene signatures defined in a Sets for the purpose of (re-)naming those signatures interactively. The app returns the updated Sets when closed using the "Done" button.

shinyLabels(gs, se)

Arguments

gs

A set of gene signatures inheriting from Sets.

se

An object of class inheriting from SummarizedExperiment.

Value

The updated set of gene signatures as a Sets.

Examples

# Example data ---- bs <- Sets( relations=DataFrame( element = c("Gene001", "Gene002", "Gene003", "Gene004"), set = c(rep("Cell type 1", 2), rep("Cell type 2", 2)) ) ) library(SummarizedExperiment) nsamples <- 100 u <- matrix(rpois(20000, 2), ncol=nsamples) rownames(u) <- paste0("Gene", sprintf("%03d", seq_len(nrow(u)))) colnames(u) <- paste0("Cell", sprintf("%03d", seq_len(ncol(u)))) se <- SummarizedExperiment(assays=list(counts=u)) colData(se)[, "cluster"] <- factor(sample(head(LETTERS, 3), ncol(se), replace=TRUE)) se1 <- predict(bs, se, method="ProportionPositive", cluster.col="cluster") # Add reduced dimension results to enable app features library(SingleCellExperiment) library(Rtsne) sce1 <- as(se1, "SingleCellExperiment") reducedDim(sce1, "PCA") <- prcomp(t(assay(sce1)))$x reducedDim(sce1, "TSNE") <- Rtsne(X=reducedDim(sce1, "PCA"))$Y # Example usage ---- if (interactive()){ library(shiny) x <- runApp(shinyLabels(bs, sce1)) }