Extract cell names containing reads mapped within a given genomic region

GetCellsInRegion(tabix, region, sep = c("-", "-"), cells = NULL)

Arguments

tabix

Tabix object

region

A string giving the region to extract from the fragments file

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.

cells

Vector of cells to include in output. If NULL, include all cells

Value

Returns a list

Examples

fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac") GetCellsInRegion(tabix = fpath, region = "chr1-10245-762629")
#> $cells #> [1] "AAAGATGAGGCTAAAT-1" "AAACTCGTCTGGCACG-1" "AAACTCGTCTGGCACG-1" #> [4] "AAACTGCAGTCTGTGT-1" "AAACTGCTCCTATCCG-1" "AAAGGATTCCTTACGC-1" #> [7] "AAAGATGAGAAGGGCG-1" "AAACGAAGTGCCCGAT-1" "AAACTGCAGTCTGTGT-1" #> [10] "AAACGAAAGGCTTCGC-1" "AAACTCGCAGCGTCGT-1" "AAACGAAGTGCCCGAT-1" #> [13] "AAACGAATCCTTACGC-1" "AAAGGATCATGGAGGT-1" "AAACTGCTCCTATCCG-1" #> [16] "AAAGATGCACGTTACA-1" "AAAGATGTCCACACCT-1" "AAACGAAAGGCTTCGC-1" #> [19] "AAACTGCAGAATCAAC-1" "AAACTCGGTTTGATCG-1" "AAAGATGCAAGTCTGT-1" #> [22] "AAACTCGTCAGGTCTA-1" "AAACGAAAGGCTTCGC-1" "AAACTGCGTGCATTCA-1" #> [25] "AAACTGCTCCTATCCG-1" "AAACTGCCATGTATCG-1" "AAAGGATTCCTTACGC-1" #> [28] "AAACTGCCAAGCCAGA-1" "AAACTCGAGTACTCTG-1" "AAACTGCTCGTTCAGA-1" #> [31] "AAAGGATGTCGTAATC-1" "AAAGGATTCTATGAGC-1" "AAACGAAGTCAGGCTC-1" #> [34] "AAACTGCAGCTCCATA-1" "AAAGATGAGTCCAGAG-1" "AAAGATGTCCACACCT-1" #> [37] "AAAGATGTCCACACCT-1" "AAACTGCTCATTCATC-1" "AAACGAAAGCGAGCTA-1" #> [40] "AAACTCGGTGGATTCT-1" "AAACGAAAGGCTTCGC-1" "AAACTCGTCTGGCACG-1" #> [43] "AAAGATGTCTAGCAGT-1" "AAAGGATCAGATGGCA-1" "AAACTGCGTACTAGAA-1" #> [46] "AAACGAAAGGCTTCGC-1" "AAAGATGAGGCTAAAT-1" "AAAGATGAGGCTAAAT-1" #> [49] "AAACTCGAGTACTCTG-1" "AAAGATGTCCTGAAAC-1" "AAAGGATCAAGGGAGG-1" #> [52] "AAAGATGCAGCACATT-1" "AAACTCGGTTTGATCG-1" "AAACTCGGTGGATTCT-1" #> [55] "AAACTCGCAAAGAGAG-1" "AAAGATGAGTCGACCC-1" "AAACTCGCATCACAGT-1" #> [58] "AAAGGATTCTATGAGC-1" "AAAGGATGTCCCTTTG-1" "AAACTGCCAACAAACA-1" #> [61] "AAAGATGCATGACTGT-1" "AAAGATGAGAAGGGCG-1" "AAACTCGTCCACTAGA-1" #> [64] "AAAGATGCACGTTACA-1" "AAAGATGCAGCGTCGT-1" "AAACGAAAGGCTTCGC-1" #> [67] "AAAGGATGTCTAAGAA-1" "AAACGAAGTTGTATCG-1" "AAAGGATAGAACCATA-1" #> [70] "AAACTCGCATGTGGGA-1" #> #> $region #> [1] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [4] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [7] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [10] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [13] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [16] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [19] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [22] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [25] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [28] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [31] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [34] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [37] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [40] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [43] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [46] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [49] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [52] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [55] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [58] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [61] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [64] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [67] "chr1-10245-762629" "chr1-10245-762629" "chr1-10245-762629" #> [70] "chr1-10245-762629" #>