findAneuploidCells: findAneuploidCells

View source: R/findAneuploidCells.R

findAneuploidCellsR Documentation

findAneuploidCells

Description

Find cells that are not aneuploid in the dataset.

Usage

findAneuploidCells(
  scCNA,
  assay = "segment_ratios",
  resolution = "auto",
  remove_XY = TRUE,
  simul = TRUE,
  seed = 17
)

Arguments

scCNA

The CopyKit object

assay

String with the name of the assay to pull data from to find normal cells.

resolution

A numeric scalar used as threshold to detect normal cells.

remove_XY

A boolean that removes chrX and chrY from the analysis.

simul

A boolean that if TRUE adds a simulated normal dataset to boost identifying normal cells in datasets with small proportions of normal cells.

seed

Seed passed on to reproduce simulated CV of normal cells.

Details

performs a sample-wise calculation of the segment means coefficient of variation and fits a Gaussian mixture model to the observed distribution from all cells. To increase the sensitivity of the model, the expected distribution of the coefficient of variation for diploid cells is simulated for a thousand cells (mean = 0, sd = 0.01). This way, CopyKit can adequately detect diploid cells even in datasets with limited amounts of diploid cells and guarantees that no aneuploid cell will be removed from datasets without any diploid cells. The distribution with the smallest CV is assumed originate from normal cells. Cells are classified as diploid if they have a coefficient of variance smaller than the mean plus five times the standard deviation of the normal cell distribution.

Value

information is added to colData in a columns named 'is_aneuploid' being TRUE if a cell is detected as aneuploid and FALSE if the cell is detected as euploid.

Examples

set.seed(1000)
copykit_obj <- copykit_example()[,sample(500)]
copykit_obj <- findAneuploidCells(copykit_obj)

navinlabcode/copykit documentation built on Oct. 16, 2024, 2:55 p.m.