This will find intersecting regions in both objects and rename the overlapping features with the region coordinates of the first object (by default; this can be changed with the regions.use parameter).

MergeWithRegions(
  object.1,
  object.2,
  assay.1 = NULL,
  assay.2 = NULL,
  sep.1 = c("-", "-"),
  sep.2 = c("-", "-"),
  regions.use = 1,
  distance = 0,
  new.assay.name = "peaks",
  project = "SeuratProject",
  verbose = TRUE,
  ...
)

Arguments

object.1

The first Seurat object

object.2

The second Seurat object

assay.1

Name of the assay to use in the first object. If NULL, use the default assay

assay.2

Name of the assay to use in the second object. If NULL, use the default assay

sep.1

Genomic coordinate separators to use for the first object

sep.2

Genomic coordinate separators to use for the second object

regions.use

Which regions to use when naming regions in the merged object. Options are:

  • 1: Use the region coordinates from the first object

  • 2: Use the region coordinates from the second object

distance

Maximum distance between regions allowed for an intersection to be recorded. Default is 0.

new.assay.name

Name for the merged assay. Default is 'peaks'

project

Project name for the new object

verbose

Display messages

...

Additional arguments passed to CreateAssayObject

Value

Returns a Seurat object

Details

This allows a merged object to be constructed with common feature names.

Examples

MergeWithRegions( object.1 = atac_small, object.2 = atac_small, assay.1 = 'peaks', assay.2 = 'bins', sep.1 = c(":","-"), sep.2 = c("-","-") )
#> Intersecting regions across objects
#> Constructing merged object
#> Warning: Non-unique cell names (colnames) present in the input matrix, making unique
#> An object of class Seurat #> 68 features across 200 samples within 1 assay #> Active assay: peaks (68 features, 0 variable features)