Count reads per cell overlapping a given set of regions

CountsInRegion(object, assay, regions, ...)

Arguments

object

A Seurat object

assay

Name of a chromatin assay in the object to use

regions

A GRanges object

...

Additional arguments passed to findOverlaps

Value

Returns a numeric vector

Examples

# \donttest{
CountsInRegion(
  object = atac_small,
  assay = 'bins',
  regions = blacklist_hg19
)
#> AAACGAAAGAGCGAAA-1 AAACGAAAGAGTTTGA-1 AAACGAAAGCGAGCTA-1 AAACGAAAGGCTTCGC-1 
#>                  0                  0                  2                  9 
#> AAACGAAAGTGCTGAG-1 AAACGAACAAGGGTAC-1 AAACGAAGTCAGGCTC-1 AAACGAAGTGCCCGAT-1 
#>                  0                  3                  1                  2 
#> AAACGAAGTTGTATCG-1 AAACGAATCAGTTGAC-1 AAACGAATCCTTACGC-1 AAACGAATCGTTTGAG-1 
#>                  0                  0                  1                  0 
#> AAACGAATCTGCCGAG-1 AAACTCGAGATGCGCA-1 AAACTCGAGCATGATA-1 AAACTCGAGCGCATTT-1 
#>                  0                  0                  0                  0 
#> AAACTCGAGTACTCTG-1 AAACTCGAGTCACGCC-1 AAACTCGAGTCTCTAG-1 AAACTCGCAAAGAGAG-1 
#>                  2                  1                  1                  2 
#> AAACTCGCAAGCGAAC-1 AAACTCGCACTCAGCG-1 AAACTCGCACTTGCGG-1 AAACTCGCAGCGTCGT-1 
#>                  0                  0                  0                  1 
#> AAACTCGCATCACAGT-1 AAACTCGCATGTGGGA-1 AAACTCGGTCAGAAGC-1 AAACTCGGTCATAGCT-1 
#>                  1                  2                  0                  1 
#> AAACTCGGTGGATTCT-1 AAACTCGGTTTGATCG-1 AAACTCGTCAGGTCTA-1 AAACTCGTCCACTAGA-1 
#>                  2                  3                  2                  1 
#> AAACTCGTCCCAATAG-1 AAACTCGTCGATGTAC-1 AAACTCGTCTGGCACG-1 AAACTCGTCTGGCGCA-1 
#>                  0                  0                  3                  0 
#> AAACTGCAGAATCAAC-1 AAACTGCAGAGTGGAA-1 AAACTGCAGCAAGGTC-1 AAACTGCAGCTCCATA-1 
#>                  1                  0                  1                  2 
#> AAACTGCAGTCTGTGT-1 AAACTGCCAACAAACA-1 AAACTGCCAAGAGATT-1 AAACTGCCAAGCCAGA-1 
#>                  2                  1                  0                  1 
#> AAACTGCCACTTGCGG-1 AAACTGCCATGTATCG-1 AAACTGCGTACTAGAA-1 AAACTGCGTCATAGCT-1 
#>                  0                 16                  1                  1 
#> AAACTGCGTCATGAGG-1 AAACTGCGTCGATTAC-1 AAACTGCGTGCATTCA-1 AAACTGCGTGCTGAAG-1 
#>                  0                  1                  1                  0 
#> AAACTGCGTTACCACA-1 AAACTGCTCATTCATC-1 AAACTGCTCCGTACGG-1 AAACTGCTCCTATCCG-1 
#>                  0                  4                  0                  3 
#> AAACTGCTCGTTCAGA-1 AAACTGCTCTGAGTAC-1 AAAGATGAGAAGGGCG-1 AAAGATGAGCGAGAAA-1 
#>                  1                  0                  2                  0 
#> AAAGATGAGGCTAAAT-1 AAAGATGAGTCCAGAG-1 AAAGATGAGTCGACCC-1 AAAGATGAGTTATGAG-1 
#>                  6                  1                  1                  0 
#> AAAGATGCAACCTCTC-1 AAAGATGCAAGGTCGA-1 AAAGATGCAAGTCTGT-1 AAAGATGCACGTTACA-1 
#>                  0                  0                  1                  3 
#> AAAGATGCAGCAACCC-1 AAAGATGCAGCACATT-1 AAAGATGCAGCGTCGT-1 AAAGATGCATGACTGT-1 
#>                  0                  3                  1                  1 
#> AAAGATGTCCACACCT-1 AAAGATGTCCTGAAAC-1 AAAGATGTCGCGGCAT-1 AAAGATGTCGCTAGTA-1 
#>                  4                  1                  0                  0 
#> AAAGATGTCGTCGCAG-1 AAAGATGTCTAGCAGT-1 AAAGGATAGAACCATA-1 AAAGGATAGAGAATTC-1 
#>                  3                  1                  0                  0 
#> AAAGGATAGAGGAACA-1 AAAGGATAGTCTGGGA-1 AAAGGATAGTGAGTTA-1 AAAGGATCAAGGGAGG-1 
#>                  0                  0                  0                  2 
#> AAAGGATCACCACCAG-1 AAAGGATCACGTTGTA-1 AAAGGATCAGATGGCA-1 AAAGGATCATGGAGGT-1 
#>                  0                  1                  2                 13 
#> AAAGGATGTCCCTTTG-1 AAAGGATGTCGTAATC-1 AAAGGATGTCTAAGAA-1 AAAGGATGTCTCAAAC-1 
#>                  1                  1                  2                  0 
#> AAAGGATGTCTTAGCA-1 AAAGGATGTGGACGAT-1 AAAGGATTCACTACCC-1 AAAGGATTCCAACCTC-1 
#>                  0                  0                  0                  1 
#> AAAGGATTCCGTCAAA-1 AAAGGATTCCTTACGC-1 AAAGGATTCTATGAGC-1 AAAGGATTCTGAACGT-1 
#>                  0                  2                  2                  1 
# }