Get footprints around a set of genomic coordinates
Arguments
- fragments
IterableFragments object
- ranges
Footprint centers given as GRanges, data.frame, or list. See
help("genomic-ranges-like")
for details on format and coordinate systems. Required attributes:chr
,start
,end
: genomic positionstrand
: +/- or TRUE/FALSE for positive or negative strand
"+" strand ranges will footprint around the start coordinate, and "-" strand ranges around the end coordinate.
- zero_based_coords
If true, coordinates start and 0 and the end coordinate is not included in the range. If false, coordinates start at 1 and the end coordinate is included in the range
- cell_groups
Character or factor assigning a group to each cell, in order of
cellNames(fragments)
- cell_weights
Numeric vector assigning weight factors (e.g. inverse of total reads) to each cell, in order of
cellNames(fragments)
- flank
Number of flanking basepairs to include on either side of the motif
- normalization_width
Number of basepairs at the upstream + downstream extremes to use for calculating enrichment
Value
tibble::tibble()
with columns group
, position
, and count
, enrichment
Examples
## Prep data
frags <- get_demo_frags()
## Motif positions taken from taking a subset of GATA1 motifs
## positions in peaks using motifmatchr
## See basic tutorial for description of generating
## positions
motif_positions <- tibble::tibble(
chr = rep("chr4", 3),
start = c(338237, 498344, 499851),
end = c(338247, 498354, 499861),
strand = c("-", "+", "+"),
score = c(8.1422, 8.1415, 9.59462)
)
## Run footprinting
footprint(frags, motif_positions)
#> # A tibble: 251 × 4
#> group position count enrichment
#> <chr> <int> <dbl> <dbl>
#> 1 all -125 0 0
#> 2 all -124 1 2
#> 3 all -123 0 0
#> 4 all -122 0 0
#> 5 all -121 2 4
#> 6 all -120 0 0
#> 7 all -119 1 2
#> 8 all -118 0 0
#> 9 all -117 0 0
#> 10 all -116 1 2
#> # ℹ 241 more rows