diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 39ddcff..d6ca66e 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -67,11 +67,10 @@ jobs: if: runner.os == 'Linux' env: RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - Rscript -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" - sudo apt-get update && sudo apt-get -y install libcurl4-openssl-dev libglpk-dev libharfbuzz-dev libfribidi-dev + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + pak-version: devel - name: Install system dependencies (macOS) if: runner.os == 'macOS' diff --git a/DESCRIPTION b/DESCRIPTION index 7051a4d..2b85760 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: iSEEfier Title: Streamlining the creation of initial states for starting an iSEE instance -Version: 1.1.1 +Version: 1.1.2 Authors@R: c( person(given = "Najla", family = "Abassi", role = c("aut", "cre"), diff --git a/NAMESPACE b/NAMESPACE index f3bf340..36a6425 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -24,8 +24,6 @@ importFrom(ggplot2,scale_fill_manual) importFrom(ggplot2,scale_y_discrete) importFrom(ggplot2,theme) importFrom(ggplot2,theme_void) -importFrom(iSEE,RowDataTable) -importFrom(iSEEu,FeatureSetTable) importFrom(iSEEu,createGeneSetCommands) importFrom(iSEEu,registerFeatureSetCommands) importFrom(igraph,"V<-") diff --git a/NEWS.md b/NEWS.md index 7b07135..d8aba93 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ * Adding in a new function `iSEEmarker()`, more focused on finding marker genes * A new `iSEEinit()` version without the `DynamicMarkerTable` panel +* Expanding the input of `iSEEinit()` to accept features as `data.frame` in addition to `vector` +* Adding visualization plots to `iSEEnrich()` # iSEEfier 1.0.0 diff --git a/R/iSEEinit.R b/R/iSEEinit.R index 3c05e19..5398d9e 100644 --- a/R/iSEEinit.R +++ b/R/iSEEinit.R @@ -6,15 +6,19 @@ #' list in a single view. #' #' @param sce SingleCellExperiment object -#' @param features A character vector containing a list of genes +#' @param features A character vector or a data.frame containing a list of genes. +#' If `features` is a data.frame, the column containing the gene names must be named "id" #' @param reddim_type A string vector containing the dimensionality reduction #' type #' @param clusters A character string containing the name of the #' clusters/cell-type/state...(as listed in the colData of the sce) #' @param groups A character string of the groups/conditions...(as it appears in #' the colData of the sce) +#' @param gene_id A character string containing the name of the column name containing +#' gene names/ids, when 'features' is a data.frame #' @param add_markdown_panel A logical indicating whether or not to include the #' MarkdownBoard panel in the initial configuration + #' #' @return A list of "Panel" objects specifying the initial state of iSEE #' instance @@ -48,14 +52,13 @@ iSEEinit <- function(sce, reddim_type = "TSNE", clusters = colnames(colData(sce))[1], groups = colnames(colData(sce))[1], + gene_id="id", add_markdown_panel = FALSE) { ## Checks on arguments if (!is(sce, "SingleCellExperiment")) stop("Please provide a SingleCellExperiment as input!") - stopifnot(is.character(features), length(features) > 0) - stopifnot(isScalarCharacter(reddim_type)) stopifnot(isScalarCharacter(clusters)) @@ -63,6 +66,8 @@ iSEEinit <- function(sce, stopifnot(isScalarCharacter(groups)) stopifnot(isTRUEorFALSE(add_markdown_panel)) + + stopifnot(isScalarCharacter(gene_id)) if (!(reddim_type %in% reducedDimNames(sce))) { @@ -71,6 +76,23 @@ iSEEinit <- function(sce, "Please select one of these: ", paste(available_reddims, collapse = ", ")) } + + if (is.data.frame(features)) { + if ((gene_id %in% colnames(features))) { + + features <- as.character(features[[gene_id]]) + } else { + stop("The column name '", gene_id,"' does not exist in the 'features' data.frame!") + } + } + + else if (is.vector(features)) { + features <- as.character(features) + } else { + stop("Unsupported feature type. Must be a character vector, or data.frame!") + } + + stopifnot(is.character(features), NROW(features) > 0) if (!all(features %in% rownames(sce))) { not_available_features <- features[!features %in% rownames(sce)] @@ -79,7 +101,7 @@ iSEEinit <- function(sce, paste(not_available_features, collapse = ", ")) features <- features[features %in% rownames(sce)] - if (length(features) == 0) + if (NROW(features) == 0) stop("No features available!") } @@ -104,57 +126,60 @@ iSEEinit <- function(sce, message("colData column not found for the `groups` parameter, defaulting to ", fallback_groups) } - - + initial <- list() - for (j in features) { - initial[[paste0("ReducedDimensionPlot", which(features == j))]] <- new( + for (j in 1:NROW(features)) { + feature_name <- if (is.data.frame(features)) features[j, ] else features[[j]] + initial[[paste0("ReducedDimensionPlot", j)]] <- new( "ReducedDimensionPlot", Type = reddim_type, ColorBy = "Feature name", - ColorByFeatureName = j, - ColorByFeatureSource = paste0("RowDataTable", which(features == j)), + ColorByFeatureName = feature_name, + ColorByFeatureSource = paste0("RowDataTable", j), ColumnSelectionSource = "ColumnDataPlot1", SelectionAlpha = 0.05 ) - - initial[[paste0("FeatureAssayPlot", which(features == j))]] <- new( + + initial[[paste0("FeatureAssayPlot", j)]] <- new( "FeatureAssayPlot", XAxis = "Column data", XAxisColumnData = clusters, - YAxisFeatureName = j, - YAxisFeatureSource = paste0("RowDataTable", which(features == j)), + YAxisFeatureName = feature_name, + YAxisFeatureSource = paste0("RowDataTable", j), ColorBy = "Column data", ColorByColumnData = clusters ) - initial[[paste0("RowDataTable", which(features == j))]] <- new( + initial[[paste0("RowDataTable", j)]] <- new( "RowDataTable", - Selected = j, - Search = j + Selected = feature_name, + Search = feature_name ) } - if (length(features) > 1) { - initial[[paste0("FeatureAssayPlot", length(features) + 1)]] <- new( + if (NROW(features) > 1) { + feature1 <- if (is.data.frame(features)) features[1, ] else features[[1]] + feature2 <- if (is.data.frame(features)) features[2, ] else features[[2]] + + initial[[paste0("FeatureAssayPlot", NROW(features) + 1)]] <- new( "FeatureAssayPlot", XAxis = "Feature name", - XAxisFeatureName = features[[1]], - YAxisFeatureName = features[[2]] + XAxisFeatureName = feature1, + YAxisFeatureName = feature2 ) } if (add_markdown_panel == TRUE) { - initial[[paste0("ReducedDimensionPlot", length(features) + 1)]] <- new( + initial[[paste0("ReducedDimensionPlot", NROW(features) + 1)]] <- new( "ReducedDimensionPlot", Type = reddim_type, ColorByColumnData = clusters, ColorBy = "Column data", - ColumnSelectionSource = paste0("FeatureAssayPlot", length(features) + 1), + ColumnSelectionSource = paste0("FeatureAssayPlot", NROW(features) + 1), FacetColumnBy = "Column data", FacetColumnByColData = groups, SelectionAlpha = 0.05 @@ -165,12 +190,12 @@ iSEEinit <- function(sce, Content = "# Placeholder\n\nFill me with text!", PanelWidth = 4L) } else { - initial[[paste0("ReducedDimensionPlot", length(features) + 1)]] <- new( + initial[[paste0("ReducedDimensionPlot", NROW(features) + 1)]] <- new( "ReducedDimensionPlot", Type = reddim_type, ColorByColumnData = clusters, ColorBy = "Column data", - ColumnSelectionSource = paste0("FeatureAssayPlot", length(features) + 1), + ColumnSelectionSource = paste0("FeatureAssayPlot", NROW(features) + 1), FacetColumnBy = "Column data", FacetColumnByColData = groups, SelectionAlpha = 0.05, @@ -196,5 +221,6 @@ iSEEinit <- function(sce, return(initial) + } diff --git a/R/iSEEnrich.R b/R/iSEEnrich.R index 4559f97..a1a5d04 100644 --- a/R/iSEEnrich.R +++ b/R/iSEEnrich.R @@ -11,14 +11,22 @@ #' extract mappings of gene sets to gene IDs. #' @param gene_identifier A character string specifying the identifier to use to #' extract gene IDs for the organism package -#' +#' +#' @param clusters A character string containing the name of the +#' clusters/cell-type/state...(as listed in the colData of the sce) +#' +#' @param groups A character string of the groups/conditions...(as it appears in +#' the colData of the sce) +#' +#' @param reddim_type A string vector containing the dimensionality reduction +#' type +#' +#' #' @return A list of "Panel" objects specifying the initial state of iSEE #' instance #' @export iSEEnrich -#' @importFrom iSEE RowDataTable #' @importFrom iSEEu createGeneSetCommands #' @importFrom iSEEu registerFeatureSetCommands -#' @importFrom iSEEu FeatureSetTable #' @importFrom BiocBaseUtils isScalarCharacter #' #' @@ -29,15 +37,24 @@ #' GO_collection <- "GO" #' Mm_organism <- "org.Mm.eg.db" #' gene_id <- "SYMBOL" +#' clusters <- "stimulus" +#' groups <- "single cell quality" +#' reddim_type <- "PCA" #' results <- iSEEnrich(sce = sce, #' collection = GO_collection, #' organism = Mm_organism, -#' gene_identifier = gene_id) +#' gene_identifier = gene_id, +#' clusters = clusters, +#' groups = groups, +#' reddim_type = reddim_type) #' iSEEnrich <- function(sce, collection = c("GO", "KEGG"), organism = "org.Hs.eg.db", - gene_identifier = "ENTREZID") { + gene_identifier = "ENTREZID", + clusters = colnames(colData(sce))[1], + groups = colnames(colData(sce))[1], + reddim_type = "PCA") { ## Checks on arguments if (!is(sce, "SingleCellExperiment")) @@ -50,7 +67,40 @@ iSEEnrich <- function(sce, stopifnot(isScalarCharacter(organism)) stopifnot(isScalarCharacter(gene_identifier)) - + + stopifnot(isScalarCharacter(clusters)) + + stopifnot(isScalarCharacter(groups)) + + if (!(clusters %in% colnames(colData(sce)))) { + if (ncol(colData(sce)) > 0) { + fallback_clusters <- colnames(colData(sce))[1] + } else { + stop("No colData provided for the `clusters`!") + } + + message("colData column not found for the `clusters` parameter, defaulting to ", + fallback_clusters) + } + + if (!(groups %in% colnames(colData(sce)))) { + if (ncol(colData(sce)) > 0) { + fallback_groups <- colnames(colData(sce))[1] + } else { + stop("No colData provided for the `groups`!") + } + + message("colData column not found for the `groups` parameter, defaulting to ", + fallback_groups) + } + + if (!(reddim_type %in% reducedDimNames(sce))) { + available_reddims <- reducedDimNames(sce) + stop("The selected reduced dimensionality embedding is not available!\n", + "Please select one of these: ", + paste(available_reddims, collapse = ", ")) + } + if (!requireNamespace(organism, quietly = TRUE)) stop("Please check the value of the provided orgDb package ", "(the package needs to be installed)...", @@ -64,11 +114,46 @@ iSEEnrich <- function(sce, organism = organism, identifier = gene_identifier) sce1 <- registerFeatureSetCommands(sce, cmds) - - initial[["FeatureSetTable1"]] <- FeatureSetTable() - - initial[["RowDataTable1"]] <- RowDataTable( - RowSelectionSource = "FeatureSetTable1") + + initial[["FeatureSetTable1"]] <- new( + "FeatureSetTable", Collection = collection) + + initial[["RowDataTable1"]] <- new( + "RowDataTable", RowSelectionSource = "FeatureSetTable1") + + initial[["FeatureAssayPlot1"]] <- new( + "FeatureAssayPlot", + XAxis = "Column data", + XAxisColumnData = groups, + YAxisFeatureSource = "RowDataTable1", + ColorBy = "Column data", + ColorByColumnData = groups, + ColumnSelectionSource = "ColumnDataPlot1") + + initial[["ColumnDataPlot1"]] <- new( + "ColumnDataPlot", + XAxis = "Column data", + YAxis = clusters, + XAxisColumnData = groups, + ColorByColumnData = clusters, + ColorBy = "Column data" + + ) + + initial[["ReducedDimensionPlot1"]] <- new( + "ReducedDimensionPlot", + Type = reddim_type, + FacetColumnByColData = groups, + FacetColumnBy = "Column data", + ColorBy = "Feature name", + ColorByFeatureSource = "RowDataTable1", + ColumnSelectionSource = "ColumnDataPlot1" + ) + + initial[["MarkdownBoard1"]] <- new( + "MarkdownBoard", + Content = "# Placeholder\n\nFill me with genes, or anything!") + return( list( diff --git a/man/iSEEinit.Rd b/man/iSEEinit.Rd index e2bce4a..6b9cf53 100644 --- a/man/iSEEinit.Rd +++ b/man/iSEEinit.Rd @@ -11,13 +11,15 @@ iSEEinit( reddim_type = "TSNE", clusters = colnames(colData(sce))[1], groups = colnames(colData(sce))[1], + gene_id = "id", add_markdown_panel = FALSE ) } \arguments{ \item{sce}{SingleCellExperiment object} -\item{features}{A character vector containing a list of genes} +\item{features}{A character vector or a data.frame containing a list of genes. +If \code{features} is a data.frame, the column containing the gene names must be named "id"} \item{reddim_type}{A string vector containing the dimensionality reduction type} @@ -28,6 +30,9 @@ clusters/cell-type/state...(as listed in the colData of the sce)} \item{groups}{A character string of the groups/conditions...(as it appears in the colData of the sce)} +\item{gene_id}{A character string containing the name of the column name containing +gene names/ids, when 'features' is a data.frame} + \item{add_markdown_panel}{A logical indicating whether or not to include the MarkdownBoard panel in the initial configuration} } diff --git a/man/iSEEnrich.Rd b/man/iSEEnrich.Rd index af24797..7a49091 100644 --- a/man/iSEEnrich.Rd +++ b/man/iSEEnrich.Rd @@ -8,7 +8,10 @@ iSEEnrich( sce, collection = c("GO", "KEGG"), organism = "org.Hs.eg.db", - gene_identifier = "ENTREZID" + gene_identifier = "ENTREZID", + clusters = colnames(colData(sce))[1], + groups = colnames(colData(sce))[1], + reddim_type = "PCA" ) } \arguments{ @@ -22,6 +25,15 @@ extract mappings of gene sets to gene IDs.} \item{gene_identifier}{A character string specifying the identifier to use to extract gene IDs for the organism package} + +\item{clusters}{A character string containing the name of the +clusters/cell-type/state...(as listed in the colData of the sce)} + +\item{groups}{A character string of the groups/conditions...(as it appears in +the colData of the sce)} + +\item{reddim_type}{A string vector containing the dimensionality reduction +type} } \value{ A list of "Panel" objects specifying the initial state of iSEE @@ -39,9 +51,15 @@ sce <- scater::runPCA(sce) GO_collection <- "GO" Mm_organism <- "org.Mm.eg.db" gene_id <- "SYMBOL" +clusters <- "stimulus" +groups <- "single cell quality" +reddim_type <- "PCA" results <- iSEEnrich(sce = sce, collection = GO_collection, organism = Mm_organism, - gene_identifier = gene_id) + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = reddim_type) } diff --git a/tests/testthat/test-iSEEinit.R b/tests/testthat/test-iSEEinit.R index 6e46c5c..29e3bc4 100644 --- a/tests/testthat/test-iSEEinit.R +++ b/tests/testthat/test-iSEEinit.R @@ -13,6 +13,14 @@ test_that("test iSEEinit",{ groups = "Secondary.Type", add_markdown_panel = TRUE) expect_true(is.list(initial_with_board)) + + initial_with_df <- iSEEinit(sce = sce_allen, + features = as.data.frame(c("Il2rb", + "Klre1"),nm = "features"), + clusters = "Primary.Type", + groups = "Secondary.Type", + gene_id = "features") + expect_true(is.list(initial_with_df)) ## This is to trigger the argument checks expect_error({ @@ -23,12 +31,14 @@ test_that("test iSEEinit",{ groups = "Secondary.Type") }, "Please provide a SingleCellExperiment as input!") - expect_error({ - iSEEinit(sce = sce_allen, - reddim_type = "PCA", - features = TRUE, - clusters = "Primary.Type", - groups = "Secondary.Type") + expect_message({ + expect_error({ + iSEEinit(sce = sce_allen, + reddim_type = "PCA", + features = TRUE, + clusters = "Primary.Type", + groups = "Secondary.Type") + }) }) expect_error({ @@ -131,13 +141,16 @@ test_that("test iSEEinit",{ clusters = "Primary.Type", groups = "Secondary.Type") }) - expect_error({ - init_pippo_pluto <- iSEEinit(sce = sce_allen, - reddim_type = "PCA", - features = c("Pluto", - "Pippo"), - clusters = "Primary.Type", - groups = "Secondary.Type") + + expect_message({ + expect_error({ + init_pippo_pluto <- iSEEinit(sce = sce_allen, + reddim_type = "PCA", + features = c("Pluto", + "Pippo"), + clusters = "Primary.Type", + groups = "Secondary.Type") + }) }) sce_nocd <- sce_allen @@ -174,5 +187,24 @@ test_that("test iSEEinit",{ clusters = "Primary.Type", groups = "anything_else") }) + + expect_error({ + initial <- iSEEinit(sce = sce_allen, + features = c("Il2rb", + "Klre1"), + clusters = "Primary.Type", + groups = "Secondary_Type", + gene_id = TRUE) + }) + + expect_error({ + initial <- iSEEinit(sce = sce_allen, + features = as.data.frame(c("Il2rb", + "Klre1"),nm = "features"), + clusters = "Primary.Type", + groups = "Secondary_Type", + gene_id = "gene_name") + }) }) + diff --git a/tests/testthat/test-iSEEnrich.R b/tests/testthat/test-iSEEnrich.R index ebff11c..0cbeadb 100644 --- a/tests/testthat/test-iSEEnrich.R +++ b/tests/testthat/test-iSEEnrich.R @@ -3,11 +3,18 @@ test_that("test iSEEnrich", { GO_collection <- "GO" Mm_organism <- "org.Mm.eg.db" gene_id <- "SYMBOL" + clusters <- "Primary.Type" + groups <- "Secondary.Type" + reddim_type <- "PCA" results <- iSEEnrich(sce = sce_allen, collection = GO_collection, organism = Mm_organism, - gene_identifier = gene_id) + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = reddim_type) + expect_true(is.list(results)) expect_true(is.list(results$initial)) expect_true(is(results$sce, "SingleCellExperiment")) @@ -17,46 +24,130 @@ test_that("test iSEEnrich", { iSEEnrich(sce = "Pippo", collection = GO_collection, organism = Mm_organism, - gene_identifier = gene_id) + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = reddim_type) }) expect_error({ iSEEnrich(sce = sce_allen, collection = "MSIGDB", organism = Mm_organism, - gene_identifier = gene_id) + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = reddim_type) }) expect_error({ iSEEnrich(sce = sce_allen, collection = c("MSIGDB", "GO"), organism = Mm_organism, - gene_identifier = gene_id) + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = reddim_type) }) expect_error({ iSEEnrich(sce = sce_allen, collection = GO_collection, organism = TRUE, - gene_identifier = gene_id) + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = reddim_type) }) expect_error({ iSEEnrich(sce = sce_allen, collection = GO_collection, organism = c("org.Mm.eg.db", "mouse"), - gene_identifier = gene_id) + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = reddim_type) }) expect_error({ iSEEnrich(sce = sce_allen, collection = GO_collection, organism = c("mouse"), - gene_identifier = gene_id) + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = reddim_type) }) - - - - - + + expect_error({ + iSEEnrich(sce = sce_allen, + collection = GO_collection, + organism = Mm_organism, + gene_identifier = gene_id, + clusters = TRUE, + groups = groups, + reddim_type = reddim_type) + }) + + expect_error({ + iSEEnrich(sce = sce_allen, + collection = GO_collection, + organism = Mm_organism, + gene_identifier = gene_id, + clusters = c("zina","aziza"), + groups = groups, + reddim_type = reddim_type) + }) + + expect_error({ + iSEEnrich(sce = sce_allen, + collection = GO_collection, + organism = Mm_organism, + gene_identifier = gene_id, + clusters = TRUE, + groups = c("Primary.Type", "Secondary.Type"), + reddim_type = reddim_type) + }) + + expect_error({ + iSEEnrich(sce = sce_allen, + collection = GO_collection, + organism = Mm_organism, + gene_identifier = gene_id, + clusters = clusters, + groups = c("Primary.Type", "Secondary.Type"), + reddim_type = reddim_type) + }) + + expect_error({ + iSEEnrich(sce = sce_allen, + collection = GO_collection, + organism = Mm_organism, + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = TRUE) + }) + + expect_error({ + iSEEnrich(sce = sce_allen, + collection = GO_collection, + organism = Mm_organism, + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = "UMAP") + }) + + expect_error({ + iSEEnrich(sce = sce_allen, + collection = GO_collection, + organism = Mm_organism, + gene_identifier = gene_id, + clusters = clusters, + groups = groups, + reddim_type = "pca") + }) + }) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index e88cd9e..857bca2 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -28,13 +28,18 @@ test_that("iSEEfier utils work", { expect_true(is(g_tiles_2, "igraph")) init_chopped <- init_1[c(3,6)] - g_tiles_noedges <- view_initial_network(init_chopped, plot_format = "none") + expect_message({ + g_tiles_noedges <- view_initial_network(init_chopped, plot_format = "none") + }, "Returning the graph object") + expect_true(length(igraph::E(g_tiles_noedges)) == 0) - expect_message( - init_combined <- glue_initials(init_1, init_2, remove_duplicate_panels = TRUE), - "Dropping" - ) + expect_message({ + expect_message({ + init_combined <- glue_initials(init_1, init_2, remove_duplicate_panels = TRUE) + }, "Dropping" + )}, "Merging together") + expect_true(length(init_combined) == 20) p_tiles_combined <- view_initial_tiles(init_combined) @@ -49,14 +54,19 @@ test_that("iSEEfier utils work", { init_mod <- init_1 names(init_mod)[1] <- "ImaginaryPanel1" class(init_mod[[1]]) <- "ImaginaryPanel" - expect_error( - glue_initials(init_mod, init_2), - "Some elements included in the provided input are not recognized as iSEE panels!" - ) + expect_message({ + expect_error( + glue_initials(init_mod, init_2), + "Some elements included in the provided input are not recognized as iSEE panels!" + )}, "Combining sets of 10, 11 different panels") + ## This one works by enabling the specific panel - glued_custom <- glue_initials(init_mod, init_2, - custom_panels_allowed = "ImaginaryPanel", - remove_duplicate_panels = FALSE) + expect_message({ + glued_custom <- glue_initials(init_mod, init_2, + custom_panels_allowed = "ImaginaryPanel", + remove_duplicate_panels = FALSE)}, + "Returning an `initial` configuration including 21 different panels. Enjoy!") + expect_true(length(glued_custom) == 21) }) diff --git a/vignettes/iSEEfier_userguide.Rmd b/vignettes/iSEEfier_userguide.Rmd index dd8b5ea..844d561 100644 --- a/vignettes/iSEEfier_userguide.Rmd +++ b/vignettes/iSEEfier_userguide.Rmd @@ -111,7 +111,8 @@ sce <- runUMAP(sce) Now our `sce` is ready, we can move on to the next argument. -2. `features` : which is a list or a vector of genes/features of interest. +2. `features` : which is a vector or a dataframe containing the genes/features +of interest. Let's say we would like to visualize the expression of some genes that were identified as marker genes for different cell population. @@ -153,6 +154,8 @@ initial1 <- iSEEinit(sce = sce, add_markdown_panel = TRUE) ``` +In case our `features` parameter was a data.frame, we could assign the name of the column containing the features to the `gene_id` parameter. + Now we are one step away from visualizing our list of genes of interest. All that's left to do is to run `iSEE` with the initial state created with `iSEEinit()` @@ -181,11 +184,18 @@ will need 4 elements to explore feature sets of interest: - `collection`: A character vector specifying the gene set collections of interest (it is possible to use GO or KEGG terms) - `gene_identifier`: A character string specifying the identifier to use to extract gene IDs for the organism package. This can be **"ENS"** for ENSEMBL ids, **"SYMBOL"** for gene names... - `organism`: A character string of the `org.*.eg.db` package to use to extract mappings of gene sets to gene IDs. +- `reddim_type`: A string vector containing the dimensionality reduction type +- `clusters`: A character string containing the name of the clusters/cell-type/state...(as listed in the colData of the sce) +- `groups`: A character string of the groups/conditions...(as it appears in the colData of the sce) + ```{r set-param} GO_collection <- "GO" Mm_organism <- "org.Mm.eg.db" gene_id <- "SYMBOL" +cluster <- "label" +group <- "strain" +reddim_type <- "PCA" ``` Now let's create this initial setup for `iSEE` using `iSEEnrich()` @@ -194,7 +204,10 @@ Now let's create this initial setup for `iSEE` using `iSEEnrich()` results <- iSEEnrich(sce = sce, collection = GO_collection, organism = Mm_organism, - gene_identifier = gene_id) + gene_identifier = gene_id, + clusters = cluster, + groups = group, + reddim_type = reddim_type) ``` `iSEEnrich` will specifically return a list with the updated `sce` object and