The function is intended to be used within the einprot workflows, and assumes that the analysis has been performed as in these.

makeiSEEScript(
  iSEEScript,
  sceFile,
  aName,
  tests,
  assayForPlots,
  assayForHeatmaps,
  featureForHeatmaps,
  includeFeatureSetTable
)

Arguments

iSEEScript

Character scalar providing the path where the generated R script will be saved.

sceFile

Character scalar providing the path to the SingleCellExperiment object that will be used by the script.

aName

Character scalar providing the base assay name.

tests

Named list with results from statistical tests.

assayForPlots

Character scalar, the assay that should be used for feature and sample assay plot panels.

assayForHeatmaps

Character scalar, the assay that should be used for heatmap panels.

featureForHeatmaps

Character scalar, the feature that will be displayed in the heatmap at startup. This should be a feature with at least one non-missing value.

includeFeatureSetTable

Logical scalar, whether to include a feature set table panel.

Value

The path to the generated script.

Author

Charlotte Soneson

Examples

sceFile <- system.file("extdata", "mq_example", "1356_sce.rds",
                       package = "einprot")
sce <- readRDS(sceFile)
isee <- makeiSEEScript(tempfile(fileext = "_isee.R"), sceFile = sceFile,
                       aName = "LFQ.intensity",
                       tests = S4Vectors::metadata(sce)$testres$tests,
                       assayForPlots = "log2_LFQ.intensity",
                       assayForHeatmaps = "iBAQ",
                       featureForHeatmaps = rownames(sce)[1],
                       includeFeatureSetTable = FALSE)
file.exists(isee)
#> [1] TRUE
head(readLines(isee), 10)
#>  [1] "library(iSEE)"                                                                                                  
#>  [2] "library(iSEEu)"                                                                                                 
#>  [3] "library(shiny)"                                                                                                 
#>  [4] "sce <- readRDS('/Users/runner/work/_temp/Library/einprot/extdata/mq_example/1356_sce.rds')"                     
#>  [5] "tour <- read.csv('/var/folders/6g/_ypptv3n2fs80_zc0xz8p1d40000gn/T//RtmpIvpkWy/file2e241f56acb7_isee_tour.csv')"
#>  [6] "panelDefaults(TooltipRowData = c('einprotLabel'))"                                                              
#>  [7] "imp_color_fun <- function(n) {"                                                                                 
#>  [8] "    structure(c('grey', 'firebrick1'), names = c('TRUE', 'FALSE'))"                                             
#>  [9] "}"                                                                                                              
#> [10] "ecm <- ExperimentColorMap("