--- a +++ b/man/subset.Rd @@ -0,0 +1,67 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/objects.R +\name{subset,VoltRon-method} +\alias{subset,VoltRon-method} +\alias{subset} +\title{Subsetting VoltRon objects} +\usage{ +\S4method{subset}{VoltRon}( + x, + subset, + samples = NULL, + assays = NULL, + spatialpoints = NULL, + features = NULL, + image = NULL, + interactive = FALSE, + use.points.only = FALSE, + shiny.options = list(launch.browser = getOption("shiny.launch.browser", interactive())) +) +} +\arguments{ +\item{x}{a VoltRon object} + +\item{subset}{Logical statement for subsetting} + +\item{samples}{the set of samples to subset the object} + +\item{assays}{the set of assays to subset the object} + +\item{spatialpoints}{the set of spatial points to subset the object} + +\item{features}{the set of features to subset the object} + +\item{image}{the subseting string passed to \link{image_crop}} + +\item{interactive}{TRUE if interactive subsetting on the image is demanded} + +\item{use.points.only}{if \code{interactive} is \code{TRUE}, use spatial points instead of the reference image} + +\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}} +} +\description{ +Given a VoltRon object, subset the object given one of the attributes +} +\examples{ +# example data +data("visium_data") + +# subset based on assay +subset(visium_data, assays = "Assay1") +subset(visium_data, assays = "Visium") + +# subset based on samples +subset(visium_data, samples = "Anterior1") + +# subset based on assay +subset(visium_data, spatialpoints = c("GTTATATTATCTCCCT-1_Assay1", "GTTTGGGTTTCGCCCG-1_Assay1")) + +# subset based on features +subset(visium_data, features = c("Map3k19", "Rab3gap1")) + +# interactive subsetting +\dontrun{ +visium_subset_data <- subset(visium_data, interactive = TRUE) +visium_subset <- visium_subset_data$subsets[[1]] +} +}