Skip to content

Commit

Permalink
Work on docs, trying to debug pkgdown error
Browse files Browse the repository at this point in the history
  • Loading branch information
lcolladotor committed Jul 16, 2024
1 parent e9a7f37 commit 59b0af4
Show file tree
Hide file tree
Showing 26 changed files with 128 additions and 104 deletions.
9 changes: 8 additions & 1 deletion R/add_key.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@
#' head(spe$key)
#'
#' ## We can clean it
#' spe$key_original <- spe$key
#' spe$key <- NULL
#'
#' ## and then add it back
#' head(add_key(spe)$key)
#' spe <- add_key(spe)
#' head(spe$key)
#'
#' ## Note that the original 'key' order was 'sample_id'_'barcode' and we'
#' ## have since changed it to 'barcode'_'sample_id'.
#'
#' ## Below we restore the original 'key'
#' spe$key <- spe$key_original
#' spe$key_original <- NULL
#' head(spe$key)
#' }
add_key <- function(spe, overwrite = TRUE) {
if ("key" %in% colnames(colData(spe))) {
Expand Down
2 changes: 1 addition & 1 deletion R/add_qc_metrics.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
#' vis_clus(spe_qc, sample_id = "Br6432_ant", clustervar = "our_low_lib_edge")
#'
#' ## Clean up
#' rm(spe_qc, spec_pre_qc)
#' rm(spe_qc, spe_pre_qc, vars)
#'
add_qc_metrics <- function(spe, overwrite = FALSE) {
stopifnot("in_tissue" %in% colnames(colData(spe)))
Expand Down
5 changes: 3 additions & 2 deletions R/check_sce_layer.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
#'
#' @examples
#'
#' ## Obtain the necessary data
#' ## Obtain example data from the HumanPilot project
#' ## (Maynard, Collado-Torres, et al, 2021)
#' if (!exists("sce_layer")) sce_layer <- fetch_data("sce_layer")
#'
#' ## Check the object
#' ## Check the pseudo-bulked data
#' check_sce_layer(sce_layer)
check_sce_layer <- function(sce_layer, variables = "spatialLIBD") {
## Should be a SingleCellExperiment object
Expand Down
6 changes: 5 additions & 1 deletion R/vis_clus.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
#' using (by default) the histology information on the background. To visualize
#' gene-level (or any continuous variable) use [vis_gene()].
#'
#' @inheritParams run_app
#' @param spe A
#' [SpatialExperiment-class][SpatialExperiment::SpatialExperiment-class]
#' object. See [fetch_data()] for how to download some example objects or
#' [read10xVisiumWrapper()] to read in `spaceranger --count` output files and
#' build your own `spe` object.
#' @param sampleid A `character(1)` specifying which sample to plot from
#' `colData(spe)$sample_id` (formerly `colData(spe)$sample_name`).
#' @param clustervar A `character(1)` with the name of the `colData(spe)`
Expand Down
4 changes: 2 additions & 2 deletions R/vis_clus_p.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#' gene-level (or any continuous variable) use [vis_gene_p()].
#'
#' @inheritParams vis_clus
#' @param d A data.frame with the sample-level information. This is typically
#' obtained using `cbind(colData(spe), spatialCoords(spe))`.
#' @param d A `data.frame()` with the sample-level information. This is
#' typically obtained using `cbind(colData(spe), spatialCoords(spe))`.
#' @param title The title for the plot.
#'
#' @return A [ggplot2][ggplot2::ggplot] object.
Expand Down
16 changes: 8 additions & 8 deletions R/vis_gene.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#'
#' @inheritParams vis_clus
#' @param geneid A `character()` specifying the gene ID(s) stored in
#' `rowData(spe)$gene_search` or a continuous variable(s) stored in `colData(spe)`
#' to visualize. For each ID, if `rowData(spe)$gene_search` is missing, then
#' `rownames(spe)` is used to search for the gene ID. When a vector of length > 1
#' is supplied, the continuous variables are combined according to \code{multi_gene_method},
#' producing a single value for each spot.
#' `rowData(spe)$gene_search` or a continuous variable(s) stored in
#' `colData(spe)` to visualize. For each ID, if `rowData(spe)$gene_search` is
#' missing, then `rownames(spe)` is used to search for the gene ID. When a
#' vector of length > 1 is supplied, the continuous variables are combined
#' according to `multi_gene_method`, producing a single value for each spot.
#' @param assayname The name of the `assays(spe)` to use for extracting the
#' gene expression data. Defaults to `logcounts`.
#' @param minCount A `numeric(1)` specifying the minimum gene expression (or
Expand All @@ -25,9 +25,9 @@
#' dependent on cell density.
#' @param cont_colors A `character()` vector of colors that supersedes the
#' `viridis` argument.
#' @param multi_gene_method A \code{character(1)}: either "pca", "sparsity", or
#' "z_score". This parameter controls how multiple continuous variables are
#' combined for visualization, and only applies when \code{geneid} has length
#' @param multi_gene_method A `character(1)`: either `"pca"`, `"sparsity"`, or
#' `"z_score"`. This parameter controls how multiple continuous variables are
#' combined for visualization, and only applies when `geneid` has length
#' great than 1. `z_score`: to summarize multiple continuous variables, each is
#' normalized to represent a Z-score. The multiple scores are then averaged.
#' `pca`: PCA dimension reduction is conducted on the matrix formed by the
Expand Down
8 changes: 4 additions & 4 deletions R/vis_gene_p.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#' This function visualizes the gene expression stored in `assays(spe)` or any
#' continuous variable stored in `colData(spe)` for one given sample at the
#' spot-level using (by default) the histology information on the background.
#' This is the function that does all the plotting behind [vis_gene()].
#' This is the function that does all the plotting behind [vis_gene()]
#' To visualize clusters (or any discrete variable) use [vis_clus_p()].
#'
#' @param d A data.frame with the sample-level information. This is typically
#' obtained using `cbind(colData(spe), spatialCoords(spe))`.
#' The data.frame has to contain
#' @param d A `data.frame()` with the sample-level information. This is
#' typically obtained using `cbind(colData(spe), spatialCoords(spe))`.
#' The `data.frame` has to contain
#' a column with the continuous variable data to plot stored under `d$COUNT`.
#' @param legend_title A `character(1)` specifying the legend title.
#' @inheritParams vis_clus_p
Expand Down
8 changes: 4 additions & 4 deletions man/add_images.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion man/add_key.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/add_qc_metrics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/check_sce_layer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/check_spe.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/cluster_export.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/cluster_import.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/frame_limits.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/img_edit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/img_update.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/img_update_all.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/locate_images.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/tstats_Human_DLPFC_snRNAseq_Nguyen_topLayer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/vis_clus.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions man/vis_clus_p.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions man/vis_gene.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 59b0af4

Please sign in to comment.