FeatureMatrix: Feature Matrix

Description Usage Arguments Value Examples

View source: R/quantification.R

Description

Construct a feature x cell matrix from a genomic fragments file

Usage

1
2
3
4
5
6
7
8
FeatureMatrix(
  fragments,
  features,
  cells = NULL,
  process_n = 2000,
  sep = c("-", "-"),
  verbose = TRUE
)

Arguments

fragments

A list of Fragment objects. Note that if setting the cells parameter, the requested cells should be present in the supplied Fragment objects. However, if the cells information in the fragment object is not set (Cells(fragments) is NULL), then the fragment object will still be searched.

features

A GRanges object containing a set of genomic intervals. These will form the rows of the matrix, with each entry recording the number of unique reads falling in the genomic region for each cell.

cells

Vector of cells to include. If NULL, include all cells found in the fragments file

process_n

Number of regions to load into memory at a time, per thread. Processing more regions at once can be faster but uses more memory.

sep

Vector of separators to use for genomic string. First element is used to separate chromosome and coordinates, second separator is used to separate start and end coordinates.

verbose

Display messages

Value

Returns a sparse matrix

Examples

1
2
3
4
5
6
fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac")
fragments <- CreateFragmentObject(fpath)
FeatureMatrix(
  fragments = fragments,
  features = granges(atac_small)
)

timoast/signac documentation built on Dec. 14, 2021, 11:34 p.m.