Remove all fragments that are not from an allowed set of cell barcodes from
the fragment file. This will create a new file on disk that only contains
fragments from cells specified in the cells
argument. The output file
is block gzip-compressed and indexed, ready for use with Signac functions.
FilterCells(
fragments,
cells,
outfile = NULL,
buffer_length = 256L,
verbose = TRUE
)
fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac")
tmpf <- tempfile(fileext = ".gz")
FilterCells(
fragments = fpath,
cells = head(colnames(atac_small)),
outfile = tmpf
)
#>
#> Compressing filtered file
#> Indexing fragment file
file.remove(tmpf)
#> [1] TRUE