Returns a character vector of barcode names. See details for more.

getBarcodes(
  object,
  across = NULL,
  across_subset = NULL,
  of_sample = NA,
  simplify = TRUE
)

Arguments

object

A valid spata-object.

across

Character value or NULL. Specifies the grouping variable of interest.

Use getGroupingOptions() to obtain all variable names that group the barcode spots of your object in a certain manner.

across_subset

Character vector or NULL. Specifies the particular groups of interest the grouping variable specified in argument across contains.

If set to NULL all of them are chosen. You can prefix groups you are NOT interested in with a '-'. (Saves writing if there are more groups you are interested in than groups you are not interested in.)

Use getGroupNames() to obtain all valid input options.

of_sample

This argument is currently inactive. It might be reactivated when spata-objects can store more than one sample.

Value

Named character vector or list.

Details

If argument across is specified the output is named according to the group membership the variable specified assigns the barcode spots to. If simplify is set to FALSE a list is returned.

Not specifying across makes the function return an unnamed character vector containing all barcodes.

Examples

#Not run:

  # get barcodes of those barcode spots that are assigned
  # to groups 'cluster_1', 'cluster_3' and 'cluster_5' by
  # the variable 'my_cluster'

  getBarcodes(object = spata_obj,
              across = "my_cluster",
              across_subset = c("cluster_1", "cluster_3", "cluster_5"),
              simplify = TRUE)