View source: R/initialize_ploidy_group.R
| initialize_ploidy_group | R Documentation | 
Pre-estimate ploidies across cells with shared clonal memberships
initialize_ploidy_group(Y, Yhat, ref, groups, 
                        maxPloidy = 6, minPloidy = 1.5,
                        minBinWidth = 5, SoS.plot = FALSE)
| Y | raw read depth matrix after quality control procedure | 
| Yhat | normalized read depth matrix | 
| ref | GRanges object after quality control procedure | 
| groups | clonal membership labels for each cell | 
| maxPloidy | maximum ploidy candidate. Defalut is  | 
| minPloidy | minimum ploidy candidate. Defalut is  | 
| minBinWidth | the minimum number of bins for a changed segment.
Defalut is  | 
| SoS.plot | logical, whether to generate ploidy pre-estimation 
plots. Default is  | 
| ploidy.SoS | Vector of group-wise pre-estimated ploidies for each cell | 
Rujin Wang rujin@email.unc.edu
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
# Group-wise ploidy initialization
clones <- c("normal", "tumor1", "normal", "tumor1", "tumor1")
ploidy.sim.group <- initialize_ploidy_group(Y = Y_sim, Yhat = Yhat.noK.sim, 
                                ref = ref_sim, groups = clones)
ploidy.sim.group
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.