ploidy {scPloidy}R Documentation

Infer Ploidy from ATAC-seq Fragment Overlap

Description

Infer Ploidy from ATAC-seq Fragment Overlap

Usage

ploidy(
  fragmentoverlap,
  levels,
  s = 100,
  epsilon = 1e-08,
  subsamplesize = NULL,
  dobayes = FALSE,
  prop = 0.9
)

Arguments

fragmentoverlap

Frequency of fragment overlap in each cell computed by the function fragmentoverlapcount.

levels

Possible values of ploidy. For example, c(2, 4) if the cells can be diploids or tetraploids. The values must be larger than one.

s

Seed for random numbers used in EM algorithm.

epsilon

Convergence criterion for the EM algorithm.

subsamplesize

EM algorithm becomes difficult to converge when the number of cells is very large. By setting the parameter (e.g. to 1e4), we can run EM algorithm iteratively, first for subsamplesize randomly sampled cells, next for twice the number of cells in repetition. The inferred lambda/theta parameters are used as the initial value in the next repetition.

dobayes

(experimental feature) Whether to perform Bayesian inference, which takes long computation time.

prop

Proportion of peaks that can be fitted with binomal distribution in ploidy.bayes. The rest of peaks are allowed to have depth larger than the ploidy.

Value

A data.frame with each row corresponding to a cell. For each cell, its barcode, ploidy inferred by 1) moment method, 2) the same with additional K-means clustering, 3) EM algorithm of mixture, and, optionally, 4) Bayesian inference are given. I recommend using ploidy.moment or ploidy.em. When fragmentoverlapcount was computed with dobptonext=TRUE, we only use the chromosomal sites with chromatin accessibility in top 10 This requires longer computation time.


[Package scPloidy version 0.6.2 Index]