calc.q99.Expression.and.set.all.genes: calc.q99.Expression.and.set.all.genes

View source: R/Seurat.Utils.R

calc.q99.Expression.and.set.all.genesR Documentation

calc.q99.Expression.and.set.all.genes

Description

Calculate the gene expression of the e.g.: 99th quantile (expression in the top 1% cells).

Usage

calc.q99.Expression.and.set.all.genes(
  obj = combined.obj,
  quantileX = 0.99,
  max.cells = 1e+05,
  slot = "data",
  assay = c("RNA", "integrated", "SCT")[1],
  set.misc = TRUE,
  assign_to_global_env = TRUE,
  suffix = substitute_deparse(obj),
  plot = TRUE,
  show = TRUE,
  obj.version = obj@version
)

Arguments

obj

Seurat object, Default: combined.obj

quantileX

Quantile level, Default: 0.9

max.cells

Max number of cells to do the calculation on. Downsample if excdeeded. Default: 1e+05

slot

slot in the Seurat object. Default: 'data'

assay

RNA or integrated assay, Default: c("RNA", "integrated")1

set.misc

Create the "all.genes" variable in @misc? Default: TRUE.

assign_to_global_env

Create the "all.genes" variable in the global env?, Default: TRUE.

plot

Plot the expression distribution? Default: TRUE.

show

Show the distribution plot? Default: TRUE.

obj.version

Manuallyoverride the Version of the Seurat object. Useful when you used the problematic SeuratObject::UpdateSeuratObject().Default: no override obj@version.

See Also

character(0)

Examples

## Not run: 
if (interactive()) {
  combined.obj <- calc.q99.Expression.and.set.all.genes(
    obj = combined.obj, quantileX = 0.9,
    max.cells = 25000
  )
  head(sort(as.numeric.wNames(obj@misc$expr.q90), decreasing = TRUE))
  combined.obj <- calc.q99.Expression.and.set.all.genes(
    obj = combined.obj, quantileX = 0.95,
    max.cells = 25000, set.all.genes = FALSE
  )
}

## End(Not run)

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.