Skip to content

Commit

Permalink
allow more levels
Browse files Browse the repository at this point in the history
  • Loading branch information
baj12 committed Apr 10, 2024
1 parent 3e16697 commit 414e0c1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: SCHNAPPs
Type: Package
Title: Single Cell Shiny Application for Analysing Single Cell Transcriptomics Data
Version: 1.15.15
Version: 1.15.16
Authors@R: c(person("Bernd", "Jagla", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-7696-0484")))
Maintainer: Bernd Jagla <[email protected]>
Description: Single Cell sHiny APPlication (SCHNAPPs) is a R/Shiny based application to interact, manipulate, explore, and analyze single cell RNA-seq experiments, including MARS-seq and others.
Expand Down
9 changes: 8 additions & 1 deletion inst/app/outputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,14 @@ output$ColorSelection <- renderUI({
# where and how to store the colors
tabs= lapply(names(projections), FUN = function(name){
if(is.factor(projections[,name])){
if(length(levels(projections[,name]))>30) return(NULL)
if(length(levels(projections[,name]))>100) {
showNotification(
paste(name," has more than 100 levels\n"),
type = "error",
duration = NULL
)
return(NULL)
}
return(tmpFun(name = name, value = paste0(name, "ColorPanel"), lev = levels(projections[,name]), idStr = paste0(name, ".col."),
sampCol = defaultValue(paste0(name, ".colVec"), allowedColors[seq(levels(projections[,name]))]),
allowedColors = allowedColors)
Expand Down
25 changes: 18 additions & 7 deletions inst/app/reactives.R
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ inputDataFunc <- function(inFile) {
if (.schnappsEnv$DEBUGSAVE) {
save(file = "~/SCHNAPPsDebug/readInp.RData", list = c(ls()))
}
# load(file='~/SCHNAPPsDebug/readInp.RData')
# cp =load(file='~/SCHNAPPsDebug/readInp.RData')


#' save orginial data
Expand Down Expand Up @@ -3658,13 +3658,18 @@ inputSample <- reactive({
if (.schnappsEnv$DEBUGSAVE) {
save(file = "~/SCHNAPPsDebug/inputSample.RData", list = c(ls()))
}
# load(file='~/SCHNAPPsDebug/inputSample.RData')

# cp=load(file='~/SCHNAPPsDebug/inputSample.RData')
if(!"sampleNames" %in% colnames(colData(scEx))){
if (!is.null(getDefaultReactiveDomain())) {
showNotification("no sampleNames in colData(scEx)", id = "inputSampleErr", duration = NULL)
return(NULL)
}
}
# TODO should come from sampleInfo
sampInf <- gsub(".*-(.*)", "\\1", scEx$barcode)
# sampInf <- gsub(".*-(.*)", "\\1", scEx$barcode)
cellIds <- data.frame(
cellName = colnames(scEx),
sample = sampInf,
sample = colData(scEx)$sampleNames,
# number of genes per cell
ngenes = Matrix::colSums(assays(scEx)[[1]]>0),
nUMI = Matrix::colSums(assays(scEx)[[1]])
Expand Down Expand Up @@ -3707,12 +3712,18 @@ inputSampleOrg <- reactive({
save(file = "~/SCHNAPPsDebug/inputSample.RData", list = c(ls()))
}
# load(file='~/SCHNAPPsDebug/inputSample.RData')
if(!"sampleNames" %in% colnames(colData(scEx))){
if (!is.null(getDefaultReactiveDomain())) {
showNotification("no sampleNames in colData(scEx)", id = "inputSampleErr", duration = NULL)
return(NULL)
}
}

# TODO should come from sampleInfo
sampInf <- gsub(".*-(.*)", "\\1", dataTables$scEx$barcode)
# sampInf <- gsub(".*-(.*)", "\\1", dataTables$scEx$barcode)
cellIds <- data.frame(
cellName = colnames(dataTables$scEx),
sample = sampInf,
sample = colData(dataTables$scEx)$sampleNames,
# number of genes per cell
ngenes = Matrix::colSums(assays(dataTables$scEx)[[1]]>0),
nUMI = Matrix::colSums(assays(dataTables$scEx)[[1]])
Expand Down

0 comments on commit 414e0c1

Please sign in to comment.