a b/man/subset.Rd
1
% Generated by roxygen2: do not edit by hand
2
% Please edit documentation in R/objects.R
3
\name{subset,VoltRon-method}
4
\alias{subset,VoltRon-method}
5
\alias{subset}
6
\title{Subsetting VoltRon objects}
7
\usage{
8
\S4method{subset}{VoltRon}(
9
  x,
10
  subset,
11
  samples = NULL,
12
  assays = NULL,
13
  spatialpoints = NULL,
14
  features = NULL,
15
  image = NULL,
16
  interactive = FALSE,
17
  use.points.only = FALSE,
18
  shiny.options = list(launch.browser = getOption("shiny.launch.browser", interactive()))
19
)
20
}
21
\arguments{
22
\item{x}{a VoltRon object}
23
24
\item{subset}{Logical statement for subsetting}
25
26
\item{samples}{the set of samples to subset the object}
27
28
\item{assays}{the set of assays to subset the object}
29
30
\item{spatialpoints}{the set of spatial points to subset the object}
31
32
\item{features}{the set of features to subset the object}
33
34
\item{image}{the subseting string passed to \link{image_crop}}
35
36
\item{interactive}{TRUE if interactive subsetting on the image is demanded}
37
38
\item{use.points.only}{if \code{interactive} is \code{TRUE}, use spatial points instead of the reference image}
39
40
\item{shiny.options}{a list of shiny options (launch.browser, host, port etc.) passed \code{options} arguement of \link{shinyApp}. For more information, see \link{runApp}}
41
}
42
\description{
43
Given a VoltRon object, subset the object given one of the attributes
44
}
45
\examples{
46
# example data
47
data("visium_data")
48
49
# subset based on assay
50
subset(visium_data, assays = "Assay1")
51
subset(visium_data, assays = "Visium")
52
53
# subset based on samples
54
subset(visium_data, samples = "Anterior1")
55
56
# subset based on assay
57
subset(visium_data, spatialpoints = c("GTTATATTATCTCCCT-1_Assay1", "GTTTGGGTTTCGCCCG-1_Assay1"))
58
59
# subset based on features
60
subset(visium_data, features = c("Map3k19", "Rab3gap1"))
61
62
# interactive subsetting
63
\dontrun{
64
visium_subset_data <- subset(visium_data, interactive = TRUE)
65
visium_subset <- visium_subset_data$subsets[[1]]
66
}
67
}