GenomeBinMatrix: Genome bin matrix

Description Usage Arguments Details Value Examples

View source: R/quantification.R

Description

Construct a bin x cell matrix from a fragments file.

Usage

1
2
3
4
5
6
7
8
9
GenomeBinMatrix(
  fragments,
  genome,
  cells = NULL,
  binsize = 5000,
  process_n = 2000,
  sep = c("-", "-"),
  verbose = TRUE
)

Arguments

fragments

Path to tabix-indexed fragments file or a list of Fragment objects

genome

A vector of chromosome sizes for the genome. This is used to construct the genome bin coordinates. The can be obtained by calling seqlengths on a BSgenome-class object.

cells

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

binsize

Size of the genome bins to use

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

Details

This function bins the genome and calls FeatureMatrix to construct a bin x cell matrix.

Value

Returns a sparse matrix

Examples

1
2
3
4
5
6
7
8
9
genome <- 780007
names(genome) <- 'chr1'
fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac")
fragments <- CreateFragmentObject(fpath)
GenomeBinMatrix(
  fragments = fragments,
  genome = genome,
  binsize = 1000
)

Signac documentation built on Dec. 11, 2021, 9:55 a.m.