Skip to content

Commit

Permalink
Update the FeatureStatPlot function
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghao-njmu committed Oct 18, 2023
1 parent b08f526 commit b445576
Show file tree
Hide file tree
Showing 16 changed files with 314 additions and 182 deletions.
6 changes: 1 addition & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ export(download)
export(drop_data)
export(exist_Python_pkgs)
export(fastMNN_integrate)
export(filter)
export(find_conda)
export(geom_alluvial)
export(geom_alluvial_label)
Expand All @@ -148,15 +147,14 @@ export(geom_sankey_bump)
export(geom_sankey_label)
export(geom_sankey_text)
export(get_vars)
export(group_by)
export(installed_Python_pkgs)
export(invoke)
export(isOutlier)
export(iterchunks)
export(make_long)
export(palette_scp)
export(panel_fix)
export(panel_fix_single)
export(panel_fix_overall)
export(scVI_integrate)
export(segementsDf)
export(show_palettes)
Expand All @@ -168,7 +166,6 @@ export(theme_sankey)
export(theme_sankey_bump)
export(theme_scp)
export(tochunks)
export(top_n)
export(try_get)
export(unnest)
importFrom(AnnotationDbi,columns)
Expand Down Expand Up @@ -330,7 +327,6 @@ importFrom(dplyr,reframe)
importFrom(dplyr,slice_head)
importFrom(dplyr,summarise)
importFrom(dplyr,summarise_at)
importFrom(dplyr,top_n)
importFrom(ggforce,geom_mark_ellipse)
importFrom(ggforce,geom_mark_hull)
importFrom(ggnewscale,new_scale)
Expand Down
3 changes: 2 additions & 1 deletion R/SCP-analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,7 @@ FindConservedMarkers2 <- function(object, grouping.var, ident.1, ident.2 = NULL,
#'
#' @seealso \code{\link{RunEnrichment}} \code{\link{RunGSEA}} \code{\link{GroupHeatmap}}
#' @examples
#' library(dplyr)
#' data("pancreas_sub")
#' pancreas_sub <- RunDEtest(pancreas_sub, group_by = "SubCellType")
#' AllMarkers <- filter(pancreas_sub@tools$DEtest_SubCellType$AllMarkers_wilcox, p_val_adj < 0.05 & avg_log2FC > 1)
Expand Down Expand Up @@ -4051,7 +4052,7 @@ RunMonocle2 <- function(srt, assay = NULL, slot = "counts", expressionFamily = "
root_state = NULL, seed = 11) {
set.seed(seed)
check_R(c("monocle", "DDRTree", "BiocGenerics", "Biobase", "VGAM"))
library(monocle)
attachNamespace("DDRTree")

assay <- assay %||% DefaultAssay(srt)
expr_matrix <- as.sparse(GetAssayData(srt, assay = assay, slot = slot))
Expand Down
36 changes: 27 additions & 9 deletions R/SCP-app.R
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,8 @@ CreateSeuratObject2 <- function(counts, project = "SeuratProject", assay = "RNA"
#' initial_dataset = "mouse_pancreas",
#' initial_group = "CellType",
#' initial_feature = "Neurog3",
#' workers = 2, overwrite = TRUE
#' session_workers = 2,
#' overwrite = TRUE
#' )
#' list.files("./SCExplorer") # This directory can be used as site directory for Shiny Server.
#'
Expand Down Expand Up @@ -1274,6 +1275,28 @@ ui <- fluidPage(
height = "100px",
placeholder = paste(sample(all_features, 4), collapse = "\\n")
),
fluidRow(
column(
width = 6, align = "center",
radioButtons(
inputId = "plotby4",
label = "Plot by",
choices = c("group", "feature"),
selected = "group",
inline = TRUE
)
),
column(
width = 6, align = "center",
radioButtons(
inputId = "fillby4",
label = "Fill by",
choices = c("group", "feature", "expression"),
selected = "group",
inline = TRUE
)
)
),
fluidRow(
column(
width = 4, align = "center",
Expand Down Expand Up @@ -1338,12 +1361,6 @@ ui <- fluidPage(
)
)
),
selectInput(
inputId = "fillby4",
label = "Fill by",
choices = c("group", "feature", "expression"),
selected = "group"
),
selectInput(
inputId = "palette4",
label = "Select a palette",
Expand Down Expand Up @@ -2038,13 +2055,14 @@ server <- function(input, output, session) {
plottype4 <- input$plottype4
features4 <- input$features4
feature_area4 <- input$feature_area4
plotby4 <- input$plotby4
fillby4 <- input$fillby4
coExp4 <- input$coExp4 == "Yes"
stack4 <- input$stack4 == "Yes"
flip4 <- input$flip4 == "Yes"
addbox4 <- input$addbox4 == "Yes"
addpoint4 <- input$addpoint4 == "Yes"
addtrend4 <- input$addtrend4 == "Yes"
fillby4 <- input$fillby4
palette4 <- input$palette4
theme4 <- input$theme4
sameylims4 <- input$sameylims4 == "Yes"
Expand Down Expand Up @@ -2104,7 +2122,7 @@ server <- function(input, output, session) {
srt = srt_tmp, stat.by = features4, group.by = group4, split.by = split4, cells = cells, slot = "data", plot_type = plottype4,
calculate_coexp = coExp4, stack = stack4, flip = flip4,
add_box = addbox4, add_point = addpoint4, add_trend = addtrend4,
fill.by = fillby4, palette = palette4, theme_use = theme4, same.y.lims = sameylims4,
plot.by = plotby4, fill.by = fillby4, palette = palette4, theme_use = theme4, same.y.lims = sameylims4,
aspect.ratio = as.numeric(aspect.ratio), # must be class of numeric instead of integer
ncol = ncol4, byrow = byrow4, force = TRUE
)
Expand Down
Loading

0 comments on commit b445576

Please sign in to comment.