## ----包括= false ---------------------------------------------------------------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ## ----setup, eval=FALSE------------------------------------------------------------------------------------------ #library(shiny)#library(seurat)#library(ggrepel)#library(shinydashboard)#library(schex)#library(isee)## -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #pbmc_small <-sake_hexbin(pbmc_small,nbins = 10,dimension_reduction =“ pca”)#df_label <-make_hexbin_label(pbmc_small(pbmc_small)-----------------------------------------------------------------------------------------#app <-shinyapp(#server = function(input,output){##输出$ all_genes <-Renderui({#selectInput(inputId =“ gene”,label =“ gene”,#选择= rownames = rownames = rownames(pbmc_small))#})###输出$ plot1 < - renderplot({#plot_hexbin_meta(pbmc_small,“ rna_snn_res.0.8”,action =“多数派”,#ggrepel :: geom_label_repel(data = df_label,#aes(x = x,y = y,label = label),color =“ black”,#label.size = na,fill = na)##})###upput $ plot2 <-Renderplot({#plot_hexbin_feature(pbmc_small,type = input $ type,feature = input $ gene,#action = input $ action,title = input $ gene)#})##},#ui = dashboardpage(skin =“ purple”,#dashboardheader(#dashboardheader)),#dashboardsidebar(#uioutput(“ all_genes”),#radiobuttons(“ type”,“”类型表达式:“,#c(“ raw” =“ counts”,#“ counts”,#“ normalized” =“ data”),#),#radiobuttons(“ action”,“总结使用:”,#c(“比例不是0” =“ prop_0”,#“ mean” =“ mean”,nece',#“中间” =“中间”)##),#dashboardbody(#fluidrow(#box(plotOutput(“ plot1”,width = 450,高度= 400),宽度= 6),#box(plotOutput(“ plot2”,width = 500,高度= 400),宽度= 6))))))) # ) # ) # ) ## ----convert, eval=FALSE------------------------------------------------------ # pbmc_small <- as.SingleCellExperiment(pbmc_small) # pbmc_small <- make_hexbin(pbmc_small, nbins=10, dimension_reduction = "PCA") ## ---- eval=FALSE-------------------------------------------------------------- # plot_hexbin_gene_new <- function(sce, rows=NULL, rownames=character(0), # columns=NULL, type="logcounts", action="prop_0"){ # # plot_hexbin_feature(sce, type=type, feature=rownames, action=action) # } ## ---- eval=FALSE-------------------------------------------------------------- # schex_plot_gene <- customDataPlotDefaults(pbmc_small, 1) # schex_plot_gene$Function <- "plot_hexbin_gene_new" # schex_plot_gene$Arguments <- "type counts\naction prop_0\nrownames ODC1" # schex_plot_gene$ColumnSource <- "NULL" # schex_plot_gene$RowSource <- "NULL" # schex_plot_gene$DataBoxOpen <- TRUE # # # app <- iSEE( # pbmc_small, # customDataArgs=schex_plot_gene, # initialPanels=DataFrame( # Name=c("Custom data plot 1"), # Width=c(12)), # customDataFun=list(plot_hexbin_gene_new=plot_hexbin_gene_new) # )