initialize_ploidy: Ploidy pre-initialization

Description Usage Arguments Value Author(s) Examples

View source: R/initialize_ploidy.R

Description

Pre-estimate ploidies across all cells

Usage

1
2
initialize_ploidy(Y, Yhat, ref, maxPloidy = 6, minPloidy = 1.5,
                minBinWidth = 5, SoS.plot = FALSE)

Arguments

Y

raw read depth matrix after quality control procedure

Yhat

normalized read depth matrix

ref

GRanges object after quality control procedure

maxPloidy

maximum ploidy candidate. Defalut is 6

minPloidy

minimum ploidy candidate. Defalut is 1.5

minBinWidth

the minimum number of bins for a changed segment. Defalut is 5

SoS.plot

logical, whether to generate ploidy pre-estimation plots. Default is FALSE.

Value

ploidy.SoS

Vector of pre-estimated ploidies for each cell

Author(s)

Rujin Wang rujin@email.unc.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
Gini <- get_gini(Y_sim)

# first-pass CODEX2 run with no latent factors
normObj.sim <- normalize_codex2_ns_noK(Y_qc = Y_sim,
                                        gc_qc = ref_sim$gc,
                                        norm_index = which(Gini<=0.12))
Yhat.noK.sim <- normObj.sim$Yhat
beta.hat.noK.sim <- normObj.sim$beta.hat
fGC.hat.noK.sim <- normObj.sim$fGC.hat
N.sim <- normObj.sim$N

# Ploidy initialization
ploidy.sim <- initialize_ploidy(Y = Y_sim, 
                                Yhat = Yhat.noK.sim, 
                                ref = ref_sim)
ploidy.sim

SCOPE documentation built on Nov. 8, 2020, 5:27 p.m.