Count strand-oriented insertion endpoints around ATAC regions
Source:R/ATACRegions.R
RunATACRegionMatrix.RdBuild group-specific region-by-position matrices from local indexed fragments, without subsampling cells or regions. Repeated endpoints are counted with their multiplicity. This is an explicit SCOP endpoint counter, not a call to Signac's RegionMatrix.
Usage
RunATACRegionMatrix(
object,
regions,
assay = NULL,
group.by = NULL,
cells = NULL,
upstream = 3000L,
downstream = 3000L,
bin.size = 50L,
max.entries = 5e+07,
verbose = TRUE
)Arguments
- object
A Seurat object containing a validated ChromatinAssay with local indexed fragments and explicit cell-to-barcode mappings.
- regions
Non-empty GRanges in 1-based closed coordinates. Each region is centered at start + floor((width - 1)/2). Minus-strand regions are reversed; unstranded regions use genomic orientation. Duplicate genomic intervals are rejected even when their names differ. Unique names are used as row IDs when provided, otherwise genomic coordinate IDs are used.
- assay
Chromatin assay; defaults to the active assay.
- group.by
Metadata column for grouping. NULL uses active identities.
- cells
Unique source-assay cells; NULL includes all assay cells.
- upstream, downstream
Non-negative integer distances from the center. Windows must fit entirely within known chromosome boundaries; no trimming or reference/chromosome conversion is performed.
- bin.size
Positive integer width of positional bins. The last bin may be shorter; actual widths and centers are returned.
- max.entries
Maximum number of dense output entries across all groups. Exceeding this explicit memory guard errors rather than sampling. This guards output size, not transient memory for a single dense fragment query.
- verbose
Whether to print progress messages.
Value
A scop_atac_regions list with matrices (one raw count matrix per group), regions, bin positions/widths, cells.per.group, and a receipt.
Details
A BED fragment [start,end) contributes two endpoints, start + 1 and end, in 1-based coordinates. Only endpoints inside each region window are counted. Read-support column 5 is not a weight. There is no extra Tn5 shift, bias correction, fragment-length weighting or depth normalization. Overlapping windows can count the same endpoint. Grouping is descriptive, not a replicate-level statistical test; library-size and cell-composition confounding remain. Declared reference contigs absent from a file produce zero counts for that file, not evidence of biological inaccessibility. The caller's object is not modified.