Skip to contents

Count fragments within a set of regions for different groups of cells.

Usage

RegionMatrix(object, ...)

# S3 method for class 'Seurat'
RegionMatrix(
  object,
  regions,
  assay = NULL,
  group.by = NULL,
  idents = NULL,
  upstream = 3000,
  downstream = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'ChromatinAssay5'
RegionMatrix(
  object,
  regions,
  assay = NULL,
  group.by = NULL,
  idents = NULL,
  upstream = 3000,
  downstream = 3000,
  verbose = TRUE,
  ...
)

# Default S3 method
RegionMatrix(
  object,
  regions,
  assay = NULL,
  group.by = NULL,
  idents = NULL,
  upstream = 3000,
  downstream = 3000,
  verbose = TRUE,
  ...
)

Arguments

object

A Seurat or ChromatinAssay5 object

...

Arguments passed to other methods

regions

A GenomicRanges::GRanges() object containing the set of genomic ranges to quantify

assay

Name of assay to use. If NULL, use the default assay

group.by

Grouping variable to use when aggregating data across cells. If NULL, use the active cell identities

idents

Cell identities to include. If NULL, include all identities

upstream

Number of bases to extend regions upstream

downstream

Number of bases to extend regions downstream

verbose

Display messages

Value

Returns a list containing two elements:

  • matrix: a named list of region by position matrices, one for each group of cells, with the name of each element corresponding to the group identity.

  • parameters: a list of function parameters "upstream", "downstream" and "cells". This is the input data format required by the RegionHeatmap() and RegionPlot() functions, or you can extract the data matrix for other plotting or downstream processing steps