Skip to content

Commit

Permalink
Refactor spatial.R into other files
Browse files Browse the repository at this point in the history
  • Loading branch information
mojaveazure committed Jul 14, 2020
1 parent 2966209 commit 84a1f71
Show file tree
Hide file tree
Showing 42 changed files with 3,451 additions and 3,448 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ Collate:
'integration.R'
'objects.R'
'preprocessing.R'
'spatial.R'
'tree.R'
'utilities.R'
'zzz.R'
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ importFrom(methods,.hasSlot)
importFrom(methods,as)
importFrom(methods,is)
importFrom(methods,new)
importFrom(methods,setAs)
importFrom(methods,setClass)
importFrom(methods,setClassUnion)
importFrom(methods,setMethod)
Expand Down
86 changes: 86 additions & 0 deletions R/convenience.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,92 @@ PCAPlot <- function(object, ...) {
return(SpecificDimPlot(object = object, ...))
}

#' @rdname SpatialPlot
#' @export
#'
SpatialDimPlot <- function(
object,
group.by = NULL,
images = NULL,
cols = NULL,
crop = TRUE,
cells.highlight = NULL,
cols.highlight = c('#DE2D26', 'grey50'),
facet.highlight = FALSE,
label = FALSE,
label.size = 7,
label.color = 'white',
repel = FALSE,
ncol = NULL,
combine = TRUE,
pt.size.factor = 1.6,
alpha = c(1, 1),
stroke = 0.25,
label.box = TRUE,
interactive = FALSE,
information = NULL
) {
return(SpatialPlot(
object = object,
group.by = group.by,
images = images,
cols = cols,
crop = crop,
cells.highlight = cells.highlight,
cols.highlight = cols.highlight,
facet.highlight = facet.highlight,
label = label,
label.size = label.size,
label.color = label.color,
repel = repel,
ncol = ncol,
combine = combine,
pt.size.factor = pt.size.factor,
alpha = alpha,
stroke = stroke,
label.box = label.box,
interactive = interactive,
information = information
))
}

#' @rdname SpatialPlot
#' @export
#'
SpatialFeaturePlot <- function(
object,
features,
images = NULL,
crop = TRUE,
slot = 'data',
min.cutoff = NA,
max.cutoff = NA,
ncol = NULL,
combine = TRUE,
pt.size.factor = 1.6,
alpha = c(1, 1),
stroke = 0.25,
interactive = FALSE,
information = NULL
) {
return(SpatialPlot(
object = object,
features = features,
images = images,
crop = crop,
slot = slot,
min.cutoff = min.cutoff,
max.cutoff = max.cutoff,
ncol = ncol,
combine = combine,
pt.size.factor = pt.size.factor,
alpha = alpha,
stroke = stroke,
interactive = interactive,
information = information
))
}

#' @rdname DimPlot
#' @export
#'
Expand Down
Loading

0 comments on commit 84a1f71

Please sign in to comment.