Description Usage Arguments Value Examples
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.
1 | shinyLabels(gs, se)
|
gs |
A set of gene signatures inheriting from |
se |
An object of class inheriting from |
The updated set of gene signatures as a Sets
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # 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))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.