FilterCells: Filter cells from fragment file

View source: R/fragments.R

FilterCellsR Documentation

Filter cells from fragment file

Description

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.

Usage

FilterCells(
  fragments,
  cells,
  outfile = NULL,
  buffer_length = 256L,
  verbose = TRUE
)

Arguments

fragments

Path to a fragment file

cells

A vector of cells to keep

outfile

Name for output file

buffer_length

Size of buffer to be read from the fragment file. This must be longer than the longest line in the file.

verbose

Display messages

Value

Filter cells from fragment file

Examples

fpath <- system.file("extdata", "fragments.tsv.gz", package="SignacSlim")
cells <- readLines(system.file("extdata", "cell_name.txt", package="SignacSlim"))
tmpf <- tempfile(fileext = ".gz")
FilterCells(
  fragments = fpath,
  cells = cells,
  outfile = tmpf
)
file.remove(tmpf)


Honchkrow/SignacSlim documentation built on April 9, 2022, 1:49 a.m.