Skip to contents

Get the Fragment objects

Usage

Fragments(object, ...)

Fragments(object, ...) <- value

# S3 method for class 'ChromatinAssay5'
Fragments(object, ...)

# S3 method for class 'Seurat'
Fragments(object, assay = NULL, ...)

# S3 method for class 'ChromatinAssay5'
Fragments(object, ...) <- value

# S3 method for class 'Seurat'
Fragments(object, assay = NULL, ...) <- value

Arguments

object

A Seurat, GRangesAssay, or ChromatinAssay5 object

...

Arguments passed to other methods

value

A Fragment2 object or list of Fragment objects

assay

Name of assay to use

Value

Returns a list of Fragment2 objects. If there are no Fragment2 objects present, returns an empty list.

Examples

Fragments(atac_small[["peaks"]])
#> list()
Fragments(atac_small)
#> list()
fpath <- system.file("extdata", "fragments.tsv.gz", package = "Signac")
fragments <- CreateFragmentObject(
  path = fpath,
  cells = colnames(atac_small),
  validate.fragments = FALSE
)
#> Computing hash
# Seurat object method
Fragments(atac_small) <- fragments

# Remove fragment objects
Fragments(atac_small) <- NULL

# Assay method
Fragments(atac_small[["peaks"]]) <- fragments