## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----installation, eval=FALSE-------------------------------------------------
# if(!requireNamespace('BiocManager', quietly = TRUE))
#   install.packages('BiocManager')
# 
# BiocManager::install("iSEEid")

## ----load_package, message=FALSE----------------------------------------------
library("iSEEid")

## ----setup-data---------------------------------------------------------------
library("iSEE")
library("iSEEid")
library("scRNAseq")
library("scater")
library("scrapper")

sce <- ReprocessedAllenData(assays = "tophat_counts")
sce <- normalizeRnaCounts.se(sce, assay.type = "tophat_counts", size.factors = NULL)
sce <- runPCA(sce, ncomponents = 4)
sce <- runTSNE(sce)

colData(sce)["cell_type"] <- "unassigned"

## ----launch-app, eval=FALSE---------------------------------------------------
# iSEE(sce, initial = list(
#   ReducedDimensionPlot(
#     PanelWidth = 6L
#   ),
#   SampleIdentificationCenter(
#     ColumnSelectionSource = "ReducedDimensionPlot1",
#     PanelWidth = 6L
#   )
# ))

## ----figbasic, fig.cap="A basic configuration for using iSEEid.", echo=FALSE----
knitr::include_graphics("appshot_basic_iSEEid.png")

## ----custom-init, eval=FALSE--------------------------------------------------
# iSEE(sce, initial = list(
#   ReducedDimensionPlot(
#     PanelWidth = 3L,
#     Type = "TSNE",
#     ColorBy = "Feature name",
#     ColorByFeatureSource = "RowDataTable1"
#   ),
#   SampleIdentificationCenter(
#     ColumnSelectionSource = "ReducedDimensionPlot1",
#     PanelWidth = 3L,
#     ColDataColumn = "labels_from_automated_tool",
#     CellTypeLabel = "new_cell_type",
#     AnnotationRationale = "refined round: looking explicitly for markers"
#   ),
#   FeatureAssayPlot(
#     PanelWidth = 3L,
#     XAxis = "Column data",
#     XAxisColumnData = "Primary.Type",
#     YAxisFeatureSource = "RowDataTable1"
#   ),
#   RowDataTable(
#     PanelWidth = 3L,
#     Selected = "Foxp2",
#     Search = "Fox"
#   )
# ))

## ----figadvanced, fig.cap="A somewhat more complex example of iSEEid in action, with some extra panels.", echo=FALSE----
knitr::include_graphics("appshot_advanced_iSEEid.png")

## ----sessioninfo--------------------------------------------------------------
sessionInfo()

