Skip to contents

We filter a SummarizedExperiment object to exclude variants and cells.

Usage

Filtering(
  se,
  blacklisted_barcodes_path = NULL,
  fraction_threshold = NULL,
  alts_threshold = NULL,
  min_cells_per_variant = 2,
  min_variants_per_cell = 1,
  reject_value = "NoCall",
  verbose = TRUE
)

Arguments

se

SummarizedExperiment object.

blacklisted_barcodes_path

Barcodes you want to remove. Path to a file with one column without header.

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 that are blacklisted,

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

  3. all variants that are for alternative transcripts,

  4. all variants that are always NoCall,

  5. 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)
}