Skip to content

Commit

Permalink
Style code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Eagles committed Feb 15, 2024
1 parent cd2a267 commit faada6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
11 changes: 5 additions & 6 deletions R/spot_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' @param is_discrete logical(1): if TRUE, use \code{spatialLIBD::vis_clus};
#' otherwise, use \code{spatialLIBD::vis_gene}
#' @param colors character() of colors passed to \code{colors} for \code{spatialLIBD::vis_clus}
#' if \code{is_discrete} or otherwise to \code{cont_colors} for \code{spatialLIBD::vis_gene}
#' if \code{is_discrete} or otherwise to \code{cont_colors} for \code{spatialLIBD::vis_gene}
#' @param assayname character(1) passed to \code{spatialLIBD::vis_gene} if
#' not \code{is_discrete}
#' @param minCount numeric(1) passed to passed to \code{spatialLIBD::vis_gene} if
Expand Down Expand Up @@ -64,11 +64,10 @@
#' assayname = "logcounts"
#' )
#' print(p)
spot_plot <- function(
spe, sample_id, image_id = "lowres",
title = sprintf("%s_%s", sample_id, var_name), var_name,
include_legend = TRUE, is_discrete, colors = NULL,
assayname = "logcounts", minCount = 0.5, spatial = FALSE) {
spot_plot <- function(spe, sample_id, image_id = "lowres",
title = sprintf("%s_%s", sample_id, var_name), var_name,
include_legend = TRUE, is_discrete, colors = NULL,
assayname = "logcounts", minCount = 0.5, spatial = FALSE) {
# This value was determined empirically, and results in good spot sizes.
# Note that it's sample-independent, and the final spot size to pass to
# 'vis_gene' or 'vis_clus' uses this value along with the image
Expand Down
3 changes: 2 additions & 1 deletion R/spot_plot_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ spot_plot_pca <- function(spe, genes, sample_id, assayname = "logcounts", minCou
)

pc_exp <- stats::prcomp(
Matrix::t(assays(spe)[[assayname]]), center = TRUE, scale = TRUE
Matrix::t(assays(spe)[[assayname]]),
center = TRUE, scale = TRUE
)
spe$pc_select_genes <- pc_exp$x[, "PC1"]

Expand Down

0 comments on commit faada6a

Please sign in to comment.