Skip to contents

We filter a SummarizedExperiment object to exclude variants and cells.

Usage

Filtering(
  SE,
  cells_include = NULL,
  cells_exclude = NULL,
  fraction_threshold = NULL,
  alts_threshold = NULL,
  min_cells_per_variant = NULL,
  min_variants_per_cell = NULL,
  reject_value = "NoCall",
  verbose = TRUE
)

Arguments

SE

SummarizedExperiment object.

cells_include

A vector of cell barcodes. Only these cells will be retained.

cells_exclude

A vector of cell barcodes. These cells will be removed from the output.

fraction_threshold

Variants with an VAF below this threshold are set to 0. Numeric. Default = NULL.

alts_threshold

Variants with a number of alt reads less than this threshold are set to 0. Numeric. Default = NULL.

min_cells_per_variant

In how many cells should a variant be present to be included? Numeric. Default = 2.

min_variants_per_cell

How many variants should be covered in a cell have to be included? Default = 1.

reject_value

Should cells that fall below a threshold (fraction_threshold or alts_threshold) be treated as Reference or NoCall? Default = NoCall.

verbose

Should the function be verbose? Default = TRUE

Details

We do this for one sample at a time. We want to remove:

  1. all cells not in an allow list,

  2. all cells in an exclusion list,

  3. all cells that do not have at least one variant with >1 (Reference),

  4. all variants that are for alternative transcripts,

  5. all variants that are always NoCall,

  6. set variants with a VAF below a threshold to NoCall or Reference.

Examples

if (FALSE) {
  # Removing all variants that are not detected in at least 2 cells.
  # Before we remove the variants, we set fraction value of variants below 0.05 to 0.
  se_geno <- Filtering(se_geno, min_cells_per_variant = 2, fraction_threshold = 0.05)
}