Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

IntersectMatrix

Intersect genomic coordinates with matrix rows


Description

Remove or retain matrix rows that intersect given genomic regions

Usage

IntersectMatrix(
  matrix,
  regions,
  invert = FALSE,
  sep = c("-", "-"),
  verbose = TRUE,
  ...
)

Arguments

matrix

A matrix with genomic regions in the rows

regions

A set of genomic regions to intersect with regions in the matrix. Either a vector of strings encoding the genomic coordinates, or a GRanges object.

invert

Discard rows intersecting the genomic regions supplied, rather than retain.

sep

A length-2 character vector containing the separators to be used for extracting genomic coordinates from a string. The first element will be used to separate the chromosome name from coordinates, and the second element used to separate start and end coordinates.

verbose

Display messages

...

Additional arguments passed to findOverlaps

Value

Returns a sparse matrix

Examples

counts <- matrix(data = rep(0, 12), ncol = 2)
rownames(counts) <- c("chr1-565107-565550","chr1-569174-569639",
"chr1-713460-714823","chr1-752422-753038",
"chr1-762106-763359","chr1-779589-780271")
IntersectMatrix(matrix = counts, regions = blacklist_hg19)

Signac

Analysis of Single-Cell Chromatin Data

v1.2.1
MIT + file LICENSE
Authors
Tim Stuart [aut, cre] (<https://orcid.org/0000-0002-3044-0897>), Avi Srivastava [aut] (<https://orcid.org/0000-0001-9798-2079>), Paul Hoffman [ctb] (<https://orcid.org/0000-0002-7693-8957>), Rahul Satija [ctb] (<https://orcid.org/0000-0001-9448-8833>)
Initial release
2021-05-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.